Read Sensor at 1344Hz
Posted: Thu May 11, 2023 9:16 pm
Dear community,
I want to acquire data from accelerometer LIS3DH at 1344Hz sample rate.
- Approach using ISR rising edge for data ready pin, that means LIS3DH generate interrupt at approximately 1344Hz. In the ISR will enable semaphore which is evaluate in ReadSensorTask, the problem with this approach is that system doesn't work. It run slowly or sometime stuck, I try to collect 1024 samples and print msg when it succeed however the time to get 1024 samples is irregular or sometimes stuck. Maybe because tick rate is 1ms and the interrupt happen fastest than it.
- Another approach, will try to use a DelayTask with 1/1344ms, i don't know if tick rate can be reconfigure without generate possible error in RTOS. That is possible?
Another approach or some idea to test.
I want to acquire data from accelerometer LIS3DH at 1344Hz sample rate.
- Approach using ISR rising edge for data ready pin, that means LIS3DH generate interrupt at approximately 1344Hz. In the ISR will enable semaphore which is evaluate in ReadSensorTask, the problem with this approach is that system doesn't work. It run slowly or sometime stuck, I try to collect 1024 samples and print msg when it succeed however the time to get 1024 samples is irregular or sometimes stuck. Maybe because tick rate is 1ms and the interrupt happen fastest than it.
- Another approach, will try to use a DelayTask with 1/1344ms, i don't know if tick rate can be reconfigure without generate possible error in RTOS. That is possible?
Another approach or some idea to test.