Hi,
-I have a custom board using nrf 52832 and I have interfaced sensor using an SPI interface.
-I am using SDK 15.2.0 and SPI driver.
-I am collecting raw data and send them serially.
===============================================================================
NRF_SERIAL_DRV_UART_CONFIG_DEF ( m_uart0_drv_config,
RX_PIN_NUM,
TX_PIN_NUM, // Rx pin = P0.03 -- Tx pin = P0.04
RTS_PIN_NUMBER , CTS_PIN_NUMBER ,
NRF_UART_HWFC_DISABLED, NRF_UART_PARITY_EXCLUDED,
UART_BAUDRATE_BAUDRATE_Baud1M,
UART_DEFAULT_CONFIG_IRQ_PRIORITY ) ;
NRF_SERIAL_QUEUES_DEF(serial_queues, SERIAL_FIFO_TX_SIZE, SERIAL_FIFO_RX_SIZE);
NRF_SERIAL_BUFFERS_DEF(serial_buffs, SERIAL_BUFF_TX_SIZE, SERIAL_BUFF_RX_SIZE);
NRF_SERIAL_UART_DEF(serial_uart, 0);
================================================================================
void init_spi(void)
{
nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;
spi_config.ss_pin = 17;
spi_config.miso_pin = 16;
spi_config.mosi_pin = 15;
spi_config.sck_pin = 18;
spi_config.irq_priority = APP_IRQ_PRIORITY_LOW ; // original
spi_config.frequency = NRF_SPI_FREQ_4M;
spi_config.mode = NRF_DRV_SPI_MODE_0;
spi_config.bit_order = NRF_DRV_SPI_BIT_ORDER_MSB_FIRST;
//APP_ERROR_CHECK(nrf_drv_spi_init(&spi, &spi_config, spi_event_handler));
APP_ERROR_CHECK(nrf_drv_spi_init(&spi, &spi_config, spi_event_handler, NULL));
}
=====================================================================================
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
I have performed some calculations as follows.
SPi Freq 4000000
Time for 1 bit 0.25us
Time for 1 byte 4 us
Time for 12-byte value 48 us
As per my calculation, spi read operation should be completed within 48 us. But actually, it takes more time to complete spi transactions. What is the reason? is it any spi overhead?

