![]() I have narrowed the issue to the function I am using to read 2 bytes from the slave. I tested updated Wire library with Arduino as slave, PN532 NFC reader (hope, we soon release library for it), AM2320 i2c temperature/humidity sensor (library will be added in 2.0.8) and it works correct in all cases.I am working on a project which requires communication from an Arduino Due ( Master) and an FDC2214Q1 C to D IC ( Slave), but there is some variability as to whether the code works or not depending on seemingly random variables. ![]() note that I2C is not located on the same pins on the Due (20 and 21) as the. We found problems with time intervals in I2C and fixed them. The Arduino Due is a microcontroller board based on the Atmel SAM3X8E ARM. MY_SERIAL.print("I2C bus error (pinONOFF): ") Looking around on the web, there are various answers concerning different versions of wire.cpp, pull-up resistors etc. Running the i2c scanner shows nothing, yet if I run another day it is fine. Hello all, Ive been writing code for some time on Arduino Uno and Mega units, but recently got a Due. Sometimes it works and sometimes it doesnt. In the example here, they use 330 series resistance and 4.7K pullup resistors: Series resistors on I2C lines. Hi all Ive been using the i2c on my Due to connect to and write to an EEPROM. ![]() Wire.write(COMMAND_PINOUTLOW | (pin & 0x0F)) It improves noise immunity and reduces ringing on the lines, EMI, signal reflection. Wire.write(COMMAND_PINOUTHIGH | (pin & 0x0F)) Attached you can find a picture from the logic analyser capturing the moment of the bus lock up and an oscilloscope picture showing the signal quality. Wire.write(COMMAND_READADC | (pin & 0x0F)) The Due is configured as master and is connected to several slaves, PWM chips, temperature sensors, EEPROM. MY_SERIAL.println("Sketch is starting.") The Arduino Due is the first Arduino board based on a 32-bit ARM core microcontroller. Wire.begin() // join i2c bus with address #8 this function is registered as an event, see setup() function that executes whenever data is requested by master ![]() In case the timeout is reached, try first to reset the I2C bus: Reconfigure the SCL line in GPIO output and generate nine clock pulses via software to unlock the I2C device. A good practice with I2C would be to implement a timeout each time the I2C master reads an I2C slave. This is where much of the confusion over I2C with the DUE comes from. The DUE I2C bus is sensitive to EMI, but there are several workarounds. Wire.onRequest(requestEvent) // register event So, were currently in a situation where some I2C devices work on most other flavors of Arduinos, but perhaps not on the DUE. Wire.begin(8) // join i2c bus with address #8 ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |