Hi,
I read a few answers about this but I am still unable to properly read the data output from the AS7768-4. I use STM32F730Z8 and I use SPI4 interface in read only slave mode with software NSS. The SPI is configured as follows:
I tried a few different combinations of settings but without success.
The ADC uses a 32.768 MHz crystal (ABMM2-32.768MHZ-E2F-T) as a clock source. CLK_SEL, FORMAT0 and PIN/SPI are all pulled up with 10k resistors and FILTER/GPIO4 is pulled up when the MCU initializes. The DRDY signal is used as an external interrupt (I tried both on rising and falling edge) for the STM32 as a trigger to start reading the data. The MCU SYSCLK is 216 MHz.
For ADC setup I first pulse the reset pin (0 -> wait 2 ms -> 1 -> wait 10 ms) and I then write to the following registers:
- 0x01 - value 0x0C
- 0x04 - value 0x33
- 0x0E - value 0x80
All other registers are left at their default values.
I then read the status register and I read a value 0. Next I pulse the start pin (0 -> wait 110 ns -> 1) and read the status register again which still returns 0. On ADC the SYNC_IN is connected to SYNC_OUT and the START pin is connected to the MCU.
I also tried manually setting the software NSS as it is always low by default so that the SPI interface would only be active for reading the data but that didn't change anything.
I looked at the DOUT0, DCLK and DRDY signals with a logic analyser and the timings are what I calculated they should be:
I didn't check if the values taken with the scope correspond to what I send via USB yet but just looking at it it isn't what I would expect. I do have a matlab figure also available since it is difficult to read anything from the pictures.
For the 2 pictures above I also set the following registers:
- 0x56 - value 0x33
- 0x57 - value 0x05
This is the schematic for the ADC part:
Did I miss something? Can you please help me with reading the data. I am not sure if I set the STM32 correctly but looking at the DOUT signal it also doesn't look right to me especially with the test mode on.
Kind regards