This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ADS7953EVM-PDK: Mode control programming not effective

Part Number: ADS7953EVM-PDK
Hey,

I'm trying to talk to ADS7953 over SPI from my nRF52832. I'm programming it in auto2 mode and am using the code below to program it.
First, I try to program the range for auto2 mode to 5 channels, so I send a 0x9140 (ADS7953_PROG_AUTO2 | AUTO2_CHANRNG_SEL_5).
Then I send the mode control register data as 0x3C40 (ADS7953_AUTO_MODE2 | AUTO2_PROG_ENABLE | AUTO2_CHAN_COUNT_RESET | AUTO2_5VRANGE_SEL | AUTO2_NORM_OP_SEL | AUTO2_CHAN_ADDY_SEL).
I start seeing a stream of data but I see all channels (as in screenshot). Whatever value for channel range I try, I always see all 16 channels. This also makes me skeptic whether the data that I see is correct or not. I also noticed that even for a 5V range, I see 0x0FFF with 4V.
What am I doing wrong here?

Thanks for your help,
Vandita


nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG; spi_config.ss_pin = SPI_SS_PIN; spi_config.miso_pin = SPI_MISO_PIN; spi_config.mosi_pin = SPI_MOSI_PIN; spi_config.sck_pin = SPI_SCK_PIN; spi_config.frequency = NRF_DRV_SPI_FREQ_125K;; //slow it down! spi_config.mode = NRF_DRV_SPI_MODE_1; // try different modes APP_ERROR_CHECK(nrf_drv_spi_init(&spi, &spi_config, spi_event_handler)); printf("\r\nStart: \r\n"); // Reset rx buffer and transfer done flag memset(m_rx_buf, 0, m_length); spi_xfer_done = false; // Request programming access for Auto Mode 2 and set the range to all channels uint16_t prg_wrd = ADS7953_PROG_AUTO2 | AUTO2_CHANRNG_SEL_5; APP_ERROR_CHECK(nrf_drv_spi_transfer(&spi, (uint8_t*)&prg_wrd, m_length, NULL, 0)); while (!spi_xfer_done) { __WFE(); } // Program Auto Mode 2 memset(m_rx_buf, 0, m_length); spi_xfer_done = false; prg_wrd = ADS7953_AUTO_MODE2 | AUTO2_PROG_ENABLE | AUTO2_CHAN_COUNT_RESET | AUTO2_5VRANGE_SEL | AUTO2_NORM_OP_SEL | AUTO2_CHAN_ADDY_SEL; APP_ERROR_CHECK(nrf_drv_spi_transfer(&spi, (uint8_t*)&prg_wrd, m_length, NULL, 0)); while (!spi_xfer_done) { __WFE(); } // Write 0x0000 to ADS7953 to continue collecting data with the programmed parameters prg_wrd = ADS7953_CONT_OP; while (1) { memset(m_rx_buf, 0, m_length); spi_xfer_done = false; APP_ERROR_CHECK(nrf_drv_spi_transfer(&spi, (uint8_t*)&prg_wrd, m_length, m_rx_buf, m_length)); while (!spi_xfer_done) { __WFE(); } }

Screenshot -
2 is the number of bytes received and then data is printed in next line, MSB first.