Hi, I can not use the GY-521 sensor through Arduino UDOO. I followed this example sketch (# http://playground.arduino.cc/Main/I2cScanner. Uxy1uPl5PuN) without results, the device is not recognized. I connected the sensors (SDA-SCL) to pins 1-2 of J5 pin that on 9-10 J21. With Arduino Uno (external) I have not encountered any problems. Someone who has already used the i2c with UDOO can help me?
I would verify the libraries you are using are good on a Due. Goto the Arduino site and get help there. My understanding is that the Due takes different library on the software side and is not compatible on the hardware sied with 5v devices Not sure why they picked the Due for the Ardunio side of things when you look at compatibility issues You loose a lot of the code already done.
Arduino forum has a section for Due Support here is a link on SPI issues http://forum.arduino.cc/index.php?topic=146802.0
How are you powering it? See: http://playground.arduino.cc/Main/MPU-6050#.UyBg0l7ee3A Specifically this paragraph: GY-521 This sensor board has a voltage regulator. When using 3.3V to the VCC the resulting voltage (after the onboard voltage regulator) might be too low for a good working I2C bus. It is preferred to apply 5V to the VCC pin of the sensor board. The board has pull-up resistors on the I2C-bus. The value of those pull-up resistors are sometimes 10k and sometimes 2k2. The 2k2 is rather low. If it is combined with other sensor board which have also pull-up resistors, the total pull-up impedance might be too low. This schematic is hard to find, so here is a copy: http://playground.arduino.cc/uploads/Ma ... V1-SCH.jpg NOTE that the Uno works on 5V, the Udoo on 3.3V, so that might be why you're having issues....
I'm wondering if you're overpowering the UDoo's pins then... ALL of the IO pins are expecting 3.3V signals, not 5V.
I can confirm the udoo is fitted with pull up resistors because I have used them to try to detect button push (pin getting to LOW on push). And yes, no 5V should get into the IO pins or you may damage the board (on the original Due too) although I may have done that too sometimes (and haven't burnt anything yet)
My sensor has 2 pull-up resistors of 4K7 on SDA and SCL as UDOO on pin 20-21. On schematics I see that SDA1 and SCL1 (pin 9-10 on J21 HEADER 10F) has no resistors. I need to use those pins for mi sensor. With Arduino Due, SDA1 and SCL1 are used through the Wire1 of the Wire.h library. For example if i want use i2cscanner for SDA1 and SCL1: Code: /*MORE CODE*/ void setup() { Wire1.begin(); Serial.begin(9600); Serial.println("\nI2C Scanner"); } /*CODE CODE CODE*/ Is this right? My sensor i powered by 5V, but it have a built-in voltage regulator that produce high logic values at 3.3v. The led on board (of my sensor) blinks but my sketch does not recognize it. I doubt that I can not use SDA1 and SCL1, but that is using SDA and SCL.
My script and wiring is correct and working , but tried the i2c Scanner and that don`t work . That script doesn`t find any devices , but are there and working .. Wire.beginTransmission(address); rtn = Wire.endTransmission(); This should return 0 if the device is there , but always returns 1 , present or not !!! Code: byte, which indicates the status of the transmission: 0:success 1:data too long to fit in transmit buffer 2:received NACK on transmit of address 3:received NACK on transmit of data 4:other error
#include <Wire.h> extern TwoWire Wire1; AND JUST CHANGE WIRE FOR WIRE1 ... void set_pullups( byte data1 , byte data2 ) { Wire1.beginTransmission(MCP23017_ADDRESS); Wire1.write((byte)0x0c); // first pullup reg Wire1.write((byte)data1); // 1 = pullups on Wire1.write((byte)data2); // Wire1.endTransmission(); }
Pull ups are installed on the board , so you don`t need them on the sensor . You can`t switch off the pull ups on the udoo !!!
You are making me work for this one !!!!!!. http://udoo.org/download/files/schemati ... matics.pdf Page6 / i.MX6Q - EIM/STRAP BOOT nvcc_emi0 / eim_d21 and eim_d28
The two I2Cs on the UDOO are very confusing. page 6 shows the pull-ups on nvcc_emi0 / eim_d21 and eim_d28 which I believe from page 15 is the Due's SCL0, SDA0 (communication - J5). While I can't speak for the sensor, the Adafruit MotorShield V2 uses the Due's I2C1 or SCL1, SDA1. These can been seen on the right hand side of page 15, J21. I believe you would use wire1 to use SCL1, SDA1 from wire.h and not wire. I can not get this I2C to work and I haven't yet found if they are pulled up to 3v, but I'm still looking. Once I get a resistor I'll test it. I also noticed that one of the pin numbers for wire1 don't match for the UDOO Due. The UDOO documentation says 70 & 9 while the variant.h says 70 & 71 ????