
Uint32_t gpiote_task_addr = nrf_drv_gpiote_out_task_addr_get(GPIO_OUTPUT_PIN_NUMBER) Nrf_drv_timer_extended_compare(&timer, NRF_TIMER_CC_CHANNEL0, 159, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, false) Nrf_drv_gpiote_out_config_t config = GPIOTE_CONFIG_OUT_TASK_TOGGLE(true) // Initialize highĮrr_code = nrf_drv_gpiote_out_init(GPIO_OUTPUT_PIN_NUMBER, &config) //CNVST Nrf_drv_spis_buffers_set(&spis, m_tx_buf_1, m_length, m_rx_buf_1, m_length) Spis_config.mosi_pin = APP_SPIS_MOSI_PIN ĪPP_ERROR_CHECK(nrf_drv_spis_init(&spis, &spis_config, spis_event_handler)) Spis_config.miso_pin = NRFX_SPIS_PIN_NOT_USED Nrf_drv_spis_config_t spis_config = NRF_DRV_SPIS_DEFAULT_CONFIG Nrf_drv_spi_xfer_desc_t xfer_0 = NRF_DRV_SPI_XFER_TRX(m_tx_buf, m_length, m_rx_buf_0, m_length) Spi_config_0.mosi_pin = NRF_DRV_SPI_PIN_NOT_USED ĪPP_ERROR_CHECK(nrf_drv_spi_init(&spi0, &spi_config_0, spi_event_handler, NULL))


Spi_config_0.ss_pin = NRF_DRV_SPI_PIN_NOT_USED Spi_config_0.frequency = NRF_DRV_SPI_FREQ_8M Nrf_drv_spi_config_t spi_config_0 = NRF_DRV_SPI_DEFAULT_CONFIG Nrf_drv_spis_buffers_set(&spis, m_tx_buf, m_length, m_rx_buf_1, m_length) Void spis_event_handler(nrf_drv_spis_event_t event) Here are relevant functions from my project: I'm open to any suggestions on better ways to accomplish this or if anyone has used this part before with a Nordic MCU.
Set timer 8 minutes how to#
However, I cannot figure out how to set up repeated slave SPI reads like can be done with nrf_drv_spi_xfer() function and the NRF_DRV_SPI_FLAG_REPEATED_XFER flag. To read from both DOUT pins at once I am trying to use a SPI slave instance with its CLK and CS pins physically tied to CLK and CNVST of the SPI master instance. Ret_code_t ret_0 = nrf_drv_spi_xfer(&spi0, &xfer_0, NRF_DRV_SPI_FLAG_HOLD_XFER | NRF_DRV_SPI_FLAG_REPEATED_XFER ) To do the repeated SPI master read I use: I am reading 2000 samples from the ADC then stoppping sampling to do some processing of the data. I have set the conversion rate to 100kHz using a timer and PPI to toggle the CNVST at this rate. The ADC has one CLK pin, one CNVST pin (conversion start, acts as chip select) and 2 DOUT pins.

I am trying to interface with the MAX11198 simultaneous dual ADC over SPI. The ADC has two channels and I am able to read values from one channel at a time using the nRF52832 DK as a SPI master.
