Jump to content
I2Cdevlib Forums

Iain Frew

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by Iain Frew

  1. I did a little more digging on this problem. I enabled the debug statements and homed in on the issue. It turns out its not the mpu.getintstatus() method that is causing the issue. That was a side effect of the underlying problem. The real issue is reading the mpu 6050 fifo. For some reason, when trying to read the fifo even though it reports there is data to be read , the expressif twowire esp32 core library is returning 0 bytes read. This had the knock on effect of the mpu.getintstatus returning the last byte in the fifo whose value was FF. 

    Reading up on some of the issues of the mpu6050 i2c bus and its use of the SDA and SCL lines on other forums, it looks like we have a real problem to be fixed here. Not sure best how to proceed. I see a dev on the expressif/esp32 forum who has worked on previsou issues of using the mpu6050 so I will reach out to him to see if he can help. 

     

    Just posting this for others who may come across the problem.

    getfifobytesdmp.txt

  2. Hi,

    First time posting to this forum and hopefully some folks including Jeff are still reading this. I wrote an app for the Nodemcu esp8266 using the MPU6050 and the i2cdevlib libraries and it works great. I thought I would port to the ESP32 since it has more pins available. Got the code compiled and running but having some issues with the interrupt reset. I have set the ODR to 200Hz so expect ~5ms interrupts. With the code I have based on Jeff's mpu6050_dmp example, I wasn't getting that. I honed the problem down to the following. After the initial interrupt occurs at 5ms, the interrupts are cleared using the mpu.getIntStatus() method. On the esp8266 this works well. However on the esp32, the bits are not cleared but are set to all 1's,. ie. the status returned form this method is integer value 255. This cause the code I have not to work. 

     

    So finally the question, has anybody got the mpu6050 library to work with esp32 platform yet? if not, any idea why the i2cdev library is returning this value?

    The sketch I have is attached. along with the output showing the int status value returned.

     

    Cheers

    Iain

     

    esp32output.txt

    testmpu6050esp32.ino

×
×
  • Create New...