Hi to all,
I have issue with my BMA400, the sensor is managed by a PIC18 on I2C bus. I configured the sensor by following the official example code on GitHub.
The configuration of the sensor is:
- ODR=25Hz => 25frame/s => 175bytes/secondo @12-bit di risoluzione
- range=2g
- normal power mode set
- interrupt active low, push-pull on INT1 pin
- active FIFO watermark on x,y, z axis, watermark=217bytes ( => 31(frame)x7), NO sensortime, teaming mode enabled.
- set latching mode (interrupt cleaned after status interrupt read out)
- FIFO_WM_INT is enabled and mapped on INT1 pin
The init phase follow the diagram above:
One flush cmd is sent before to enable the interrupt.
Every time the FIFO wm trigger the interrupt, a dedicated routine was called, the flow chat of is:
the operations are more or less the same on example code done in the example file (https://github.com/boschsensortec/BMA400_SensorAPI ).
And now the problem that I see:
- if I use ODR>25Hz, after the first FIFO wm complete acquisition, the other are incomplete, by increasing the ODR, the lost frame are increasing too, but with the oscilloscope I can see the change of the pin state;
- so, i fixed the ODR to 25Hz, but I notice that the accelerations are very similar for every fifo wm, for example in picture below, in left side the sensor is upside-down compared with the position (and acceleration) on right side
- after the extraction and print of the accelerations, a flush cmd is sent and after that I must repeat the FiFO configuration, otherwise I can't see a new interrupt.
I also used as refernce the documents "How to use BMA400 FIFO.pdf".
I'm sure that the problem is on FIFO configuration, but I don't know/understund what I'm missing or what I'doing wrong. I hope, someone in the community could help me....
To exclude an hardware problem, I also simulate a FIFO wm by using "data ready" with interrupt and in my opinion, it is working, I can modify the configurations and I read correclty the acceleration data when the sensor is moved in all the directions!
Thanks to all,
Mari