9/24/2023 0 Comments Arduino due i2cThe lower resistance the shorter controller's life. It may work for a while, but eventually the controller will die if the resistor value is not very large. Without a proper 3.3V to 5V voltage translator, a 5V output pin will still be able to control a 3.3V input via a current limit resistor, but it will stress the microcontroller. The resistor network that contains the 2 pull up resistors has 4 resistors in its package, fortunately other two resistors are not used. If you are brave enough you can remove those two pull-up resistors, the I2C circuit should start to work normally. 4-channel I2C-safe Bi-directional Logic Level Converter : ID 757 : $3.95 : Adafruit Industries, Unique & fun DIY electronics and kits If you use a MOSFET circuit as a logic level translator, the 5V output may not be able to pull down the 3.3V input lower enough to make Vgs large enough to fully turn on the MOSFET. It requires a 50K pull-up as it's recommended by adafruit 8-channel Bi-directional Logic Level Converter : ID 395 : $7.95 : Adafruit Industries, Unique & fun DIY electronics and kits so it can pull the input pin down to (3.3V x 4)/54=0.135V. It won't pull down an input pin low enough to make it as logic "0" if the input pin has a 1K pull-up, it does not even work if the pull-up is 10K. A translator chip like the TXB0108 has an internal 4K current limit resistor in series with each I/O pin. These two 1K pull-ups may be the cause why the I2C works better without a 3.3V to 5V logic translator. I don't know why the controller needs such low value pull-ups. I have not seen an I2C circuit that uses such low value pull-ups and initially I thought that it was a misprint, but late verified that the schematic matches the PCB for the resistor value. I first noticed that the Due has two 1K pull up resistors on SCA and SDA pins when I read its schematic. Note: the software was compiled with the 1.5.1r2 compiler, as well as the 1.5.2-beta (which I rebuilt a day ago). And I've been careful not to overload these inputs. I'm particularly worried that it's some sort of hardware issue (hopefully if it's a software thing that'll be fixed sooner than later). Since the peripherals are running at 3.3V Vcc shouldn't be an issue (if anything, I'd expect the Mega to have issues with that, NOT the Due!)Ĭonsidering I just spent a fair chunk of change on the Due, I'm a little surprised this is not working. No additional pull-ups were used (my understanding is that the appropriate resistors are already present on both boards). The Due fails to see these devices with the same program via the same pins 20/21. Using I2Cscanner ( Arduino Playground - I2cScanner) I can easily get the address of either device (just testing them independently) using the Mega and pins 20/21. I'm facing a similar problem: I have a Mega and a Due side-by-side, and am testing a Chronodot and a Wii nunchuck dongle, each running at 3.3V. The Due, however, always returns 0 for each sensor. This program works fine on a Mega and returns 200 for each sensor not plugged in. Reading = reading << 8 // shift high byte to be high 8 bits SONAR DEBUG - must be running updateMap to fill SonarArrayĬlass for each sonar sensor #ifndef _IC2SONAR_H_ There is just no response from the sensor. Using an oscilloscope I can see the signal is being sent. I have tried a few different level shifters, resistor combinations, and both I2C ports on the Due. I am having trouble interfacing a 5v SRF02 sonar sensor with the Arduino Due.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |