Good afternoon, dear users.
I have a problem reading the AD7685 ADC chip. I am trying to connect this chip to the STM32F411 microcontroller installed on the Nucleo board.
The ADC chip is powered by a 5V reference source, REF, Vio, and SDI pins are also connected to 5V.
I chose CS 3 wire mode, without a busy indicator and use SPI1 on the microcontroller. The microcontroller operates at 100 MHz, SPI operates at a speed of 1.5625 Mbps (prescaler 64).
I generate a pulse on a CNV pin with a duration of 2.625 μs (as I understand it, the duration of this pulse should be more than 2.2 μs with a 5V power supply). After that, I start the function of reading SPI 2 bytes of data, and then I calculate the voltage according to the formula. But for some reason, I get incorrect and unstable data. Data on the ADC comes through the ADA4841 driver, which is enabled in the buffer repeater mode.
I apply a constant voltage of 1V to the driver input and get a value of approximately 30,000 (i.e. approximately 2.390V) through SPI.
The important thing is that I see that when the input voltage value changes, the value obtained through the SPI changes. When the input is already 1.77V, I get 0V, when the input 2V I get already 900mV, and gradually increasing to 3V, I again run into the limit and get 0. Increasing the input voltage again, I again see an increase in the output of the ADC.
Tell me please, what could be my problem?
I attached images from the logical analyzer, and the SPI settings.
uint16_t AD7980_Conversion(void) {
uint16_t receivedData = 0;
// CNV HIGH
GPIOA->ODR |= GPIO_PIN_8;
for(uint8_t i=0;i<50;i++);
// CNV LOW
GPIOA->ODR &= ~GPIO_PIN_8;
HAL_SPI_Receive(&hspi1, (uint8_t*)&receivedData, 1, 0x100);
return(receivedData);
}
Thanks in advance!