Hello all,
I'm fairly new to working with I2C, so bear with me if I am a little slow in figuring things out.
I have an ESP-32S WROOM32 module and I'm trying to read accelerometer/magnetometer values from a FXOS8700CQ. The sensor is on the The NXP Precision 9DoF breakout board (from Adafruit). I added 2 pullup resistors (9k) to the SCL and SDA lines. The example code for reading the FXOS8700CQ sensor from an Arduino works nicely. Previously I had been using a ADXL345 sensor connected in the exact same manner to the ESP and it worked perfectly. I tried to adapt that code to work with the FXOS8700CQ, and that's where I'm stuck. Somehow, when I write the address of the FXOS8700CQ to the bus for the first time (sensors.c, in the initACC() function, attempting to set up the sensor range, power state, etc), it's incorrect or somehow the sensor was not initiated properly. I don't think the address is wrong, but I'm not sure what is. What am I doing wrong?
Cannot communicate with FXOS8700CQ sensor over I2C
Cannot communicate with FXOS8700CQ sensor over I2C
- Attachments
-
- esp32_i2c_fxoS8700_fxas21001_main.c
- (1.06 KiB) Downloaded 968 times
-
- sensors.h
- (4.64 KiB) Downloaded 904 times
-
- i2c.h
- (1.04 KiB) Downloaded 931 times
Re: Cannot communicate with FXOS8700CQ sensor over I2C
When trying to solve I2C based puzzles, I can't work without a $10 logic analyzer connected to my PC. This allows me to sense the data and clock lines and get a visualization of what is happening under the covers. I'd recommend plugging one of those into your story and examining the results.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Who is online
Users browsing this forum: No registered users and 46 guests