russell Posted September 27, 2013 Report Share Posted September 27, 2013 I've been trying to use the 'MPU6000_DMP6' example with an mbed board to program utilise the DPU on the MPU-6050, but have run into problems with reading the FIFO count. The program runs through the initialisation fine, until it gets to the point where it reads the FIFO count until it is greater than 2. At this point, the MPU6050::getFIFOCount() function repeatedly returns 0. Sometimes this will eventually (after up to minutes) return a large value, which will sometimes be 65535 (i.e. a full FIFO). At this point the program will continue to the next instance of waiting for FIFO count > 2, then sometimes continue to the main loop, where there will be a very long (again up to minutes) delay between samples being returned while it waits for the FIFO count, and the values returned will always be the same. I've tried the 'MPU6050_raw' example on the mbed, and that seems to work fine, so it looks like my port of the library is ok. Does anyone have any suggestions as to why the FIFO count registers are not returning correct values? Thanks Quote Link to comment Share on other sites More sharing options...
russell Posted October 14, 2013 Author Report Share Posted October 14, 2013 Figured this out now - the pgm_read_byte() definition in 'MPU6050.cpp' of the ported I2CDev library was incorrect and resulted in the wrong data being written to the MPU's memory. For reference, the correct definition is: #define pgm_read_byte(addr) (*(const unsigned char *)(addr)) SVFeingold 1 Quote Link to comment Share on other sites More sharing options...
SVFeingold Posted November 7, 2013 Report Share Posted November 7, 2013 Oh. My. God. Thank you so much for this!!! I have had the exact same problem and have been agonizing over it for a week!! Thank you! Now I just need to figure out why my output is gibberish, but the FIFO counter is working now! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.