With the maximum SPI speed of 8 Mbps, I was expecting to be able to send 2 bytes in just a little over 2 us, but it takes a lot longer. It appears that the mandatory event wait time between bytes (to avoid overwriting the first one) is about 4 us and, if I include the time it takes to toggle the slave device CE line on and off, the total transmission time is about 10 us. This gives me a throughput of only about 1.6 Mbps.
Is there any way to speed that up? I'm even using some "INLINE" instructions (see below):
NRF_GPIO->OUTCLR = CE_BIT_POS;
dac_spi_base_address->TXD = (uint32_t)(tx_data[0]);
while (dac_spi_base_address->EVENTS_READY == 0U) { } dac_spi_base_address->EVENTS_READY = 0U; rx_data[0] = (uint8_t)dac_spi_base_address->RXD;
dac_spi_base_address->TXD = (uint32_t)(tx_data[1]);
while ((dac_spi_base_address->EVENTS_READY == 0U) /&& (counter < DAC_TIMEOUT_COUNTER)/) { } dac_spi_base_address->EVENTS_READY = 0U; rx_data[1] = (uint8_t)dac_spi_base_address->RXD;
NRF_GPIO->OUTSET = CE_BIT_POS;
Thank you for any ideas!
Gil