AnsweredAssumed Answered

18-bit SPI

Question asked by chuev.vladimir on Sep 25, 2017
Latest reply on Sep 26, 2017 by John Craven

I'm trying to use two AD7690 (18-bit ADC) http://www.analog.com/media/en/technical-documentation/data-sheets/AD7690.pdf (page 20)

But when I accept the data, I get a mistake  HAL_ERROR

However, I'm getting some data there

 

        HAL_GPIO_WritePin(GPIOA, ADC_CVN_Pin, GPIO_PIN_SET);
        HAL_Delay(10);

        HAL_SPI_Receive(&spi1, (uint8*)data, 8, 1000);

        HAL_GPIO_WritePin(GPIOA, ADC_CVN_Pin, GPIO_PIN_RESET);

 

    spi1.Instance = SPI1;
    spi1.Init.Mode = SPI_MODE_MASTER;
    spi1.Init.Direction = SPI_DIRECTION_2LINES_RXONLY;
    spi1.Init.DataSize = SPI_DATASIZE_8BIT;
    spi1.Init.CLKPolarity = SPI_POLARITY_LOW;
    spi1.Init.CLKPhase = SPI_PHASE_1EDGE;
    spi1.Init.NSS = SPI_NSS_SOFT;
    spi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_256;
    spi1.Init.FirstBit = SPI_FIRSTBIT_MSB;
    spi1.Init.TIMode = SPI_TIMODE_DISABLE;
    spi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
    spi1.Init.CRCPolynomial = 10;

 

 

How do I solve this problem?

Outcomes