k_timer_sync is not accurate

Dear,

- nRF connect SDK 1.9.1

- nRF5340 DK

We use 5340 spi to control an adc chip. The sample rate we need is 1kHz, so we use k_timer to produce a 1ms timer.

However, we find that the actual interval is not accurate 1ms but over 1ms. Is there a problem with the way we use functions?Or are there other timer functions that are more accurate?

				k_timer_status_sync(&my_sync_timer);
				k_timer_start(&my_sync_timer, K_USEC(1000), K_NO_WAIT);
				tx_buffer[0] = tx_adc_command[2*i];
				tx_buffer[1] = tx_adc_command[(2*i+1)];
				err = nrfx_spim_xfer(&spim, &xfer_desc, 0);

Parents Reply Children
No Data
Related