Timer to PPI to GPIOTE propagation delay when Softdevice enabled

Hi,

I'm using TIMER1 CC0 for SAADC sample triggering through PPI and it's working well.

In order to check sampling frequency, for debug pourpose, I'm using PPI fork for toggling one GPIOPE pin.

At low frequency, about 1kHz, all seems ok.

But for higher frequency, about 2kHz or more, toggling show phase shift when softdevice is enabled.

I have not interrupt enabled on timer1, only PPI.

I'm not understand why softdevice introduces shift in the gpiote toggling signal.

I think TIMER1 to PPI to GPIOTE should be hardware routed, so software execution should not affect timeing.

What is it wrong ?

Thanks,

Luca

Parents
  • Hi,

    Can you post your code to setup the TIMER/PPI/GPIOTE, and logic traces showing the phase shift you are observing?

    The PPI signals should be implemented in HW, and should not be affected by the SoftDevice as far as I know, however, the PPI signals are synced to the 16MHz clock, so it will be delayed (up to) one clock cycle:

    "On each PPI channel, the signals are synchronized to the 16 MHz clock to avoid any internal violation of setup and hold timings. As a consequence, events that are synchronous to the 16 MHz clock will be delayed by one clock period, while other asynchronous events will be delayed by up to one 16 MHz clock period."

    Have you tried starting the HFXO in your application and keep this running all the tie, to see if it is the Softdevice's starting of the HFCLK that is affecting your timer? You can use the API sd_clock_hfclk_request() to achieve this.

    Best regards,
    Jørgen

Reply
  • Hi,

    Can you post your code to setup the TIMER/PPI/GPIOTE, and logic traces showing the phase shift you are observing?

    The PPI signals should be implemented in HW, and should not be affected by the SoftDevice as far as I know, however, the PPI signals are synced to the 16MHz clock, so it will be delayed (up to) one clock cycle:

    "On each PPI channel, the signals are synchronized to the 16 MHz clock to avoid any internal violation of setup and hold timings. As a consequence, events that are synchronous to the 16 MHz clock will be delayed by one clock period, while other asynchronous events will be delayed by up to one 16 MHz clock period."

    Have you tried starting the HFXO in your application and keep this running all the tie, to see if it is the Softdevice's starting of the HFCLK that is affecting your timer? You can use the API sd_clock_hfclk_request() to achieve this.

    Best regards,
    Jørgen

Children
Related