This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Is there any reason this simple GPIO timing should be much faster with SDK 11.0 ?

I've got an application that does a lot of nRF51822 GPIO wiggling and the timing needs to be controlled. In one spot I simply set a pin high then low like this:

nrf_gpio_cfg_output(5);
nrf_gpio_pin_set(5);
nrf_gpio_pin_clear(5);

I've ensured that the 16MHz clock is running like this:

// Start 16 MHz crystal oscillator.
NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
NRF_CLOCK->TASKS_HFCLKSTART    = 1;
// Wait for the external oscillator to start up.
while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0) {  };  // Spin waiting for HFclock to start 

OK, so the strange thing is that with the older SDK the pulse high time was about 1uSec. With the new SDK it is about 186nSec. That sounds like it is now taking three 16MHz clock cycles to run. And it seemed to take a lot longer before. Anyone have an explanation ? Did "nrf_gpio_pin_set/clear" get a lot faster ?

Thanks, -Russ

Parents Reply Children
No Data
Related