Hello.
I'm trying to read digital inputs as well as analog inputs, but I read what looks like unsense data.
The algorithm I'm using is:
- Initialization at power-on:
- Reset (write 0x07) to the ADC.
- Write Register 0x02 = 0x30
- Write Register 0x03 = 0x02
- Write register 0x0C = 0xF0 (activate GPIO 4 to 7)
- Write register 0x0D = 0xF0 (GPIO 4 to 7 as inputs)
- Read GPIOs -> this read is correct.
- Write Registe 0x00 = 0x01
- Write register 0x03 = 0x21
- Self offset calibration.
- RDATAC mode activation
- On DRDY pulse:
- Read data from ADC using 24 clock pulses ->This is correct.
- Some delay
- Read Digital inputs -> This gives bad results
To read digital inputs I send 0x02E, 0x00 and read 8 bits. I receive 3 different results, as shown in the attached files (output1, output2 and output3). The sent data is shown in input1. All readings are referred to the data clock. I attach the schematic for more reference.
Deactivating and activating continuous data reading didn't solve this problem. What am I doing bad?