Hi,
I'm switching between two different register configurations every 100ms, with a SPI clock frequency of 2.48MHz.
Most of the times the return value is correct, but sometimes (random) the return value is too high or too low.
I tried to find the problem with some basic code.
Pseudocode:
- Configure and start single shot/continuous (depends on the test) with the start/sync command.
- wait 100ms.
- Read value and start a new single shot/continuous (depends on the test) with the start/sync command.
Configuration register:
REG0 0b01010001
REG1 0b11010000
REG2 0b01010100
REG3 0b01001000
My test results are:
- Single shot not working correctly because sometimes the return value is too high or too low.
- Continuous not working correctly because sometimes the return value is too high or too low.
- Continuous without configuring and starting the conversion continously (only at the beginning) is working correctly.
What could be the problem? And how to solve?
Thanks,
R. Stark