I'm having trouble getting the ADXL372 to wait for a shock in Instant ON mode.
I looked around for example code found the "ADXL Demo Suite", but that seems to be specific to the ADuCM3029 CPU and the ADXL372 evaluation board which does not yet appear to be available.
So I very carefully ported the adxl372_spi_drv.c code to my environment (EFM32 and Rowley) and tested it very very carefully and thoroughly.
The related code adxl_example.c uses this driver code to collect acceleration data in FULL_BW_MEASUREMENT mode via FIFO. This seems to work fine for me. Here is the api calls that do this:
result = rb_Detect_ADXL372_Sensor(); // reset chip
result = rb_ADXL372_Init(); // set chip to FULL_BW_MEASUREMENT mode and set up/enable FIFO to STREAM
status = rb_ADXL372_Read_FIFO_Data(); // read data from FIFO
Then I modify this code to:
result = rb_Detect_ADXL372_Sensor(); // reset chip
result = rb_adxl372_Configure_FIFO(512, BYPASSED, XYZ_FIFO); // reset FIFO just on general principals
result = rb_ADXL372_Init(); // comment out setting the chip to FULL_BW_MEASUREMENT mode;
result = rb_adxl372_Set_Op_mode(STAND_BY);
result = rb_adxl372_Set_Op_mode(INSTANT_ON);
status = rb_ADXL372_Read_FIFO_Data();
while(true);
And the chip drops all the way through to the while loop without waiting for a shock.
I repeated this many times while testing until I was absolutely sure everything had been ported correctly and was working. Basically with the INSTANT_ON modification the chip continued to work as if it was still in FULL_BW_MEASUREMENT mode.
Then I tried my software on a new board. On the new board it hung waiting for a shock just as it should. Exactly once. Then it went into the same mode as the first board. Power cycling and the included reset instruction did not change the behaviour back to the correct one.
The I tried a third board. Same thing. It worked once and then it no longer paused waiting for a shock.
Is there something else I should be doing to get the chip into INSTANT_ON mode?
Is there example code that demonstrates INSTANT_ON mode? There seems to be very little code available for this chip.
Is there chip errata? I looked and couldn't find anything. Its too bad Google can't search the analog.com site.
The chip really does not seem that complicated, but maybe there is something missing from the documentation
Thanks for any help.
- Rod