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

ADC & Softcore & mysterious jitter

Hi,

I use a system with BLE softcore running - and can generate highly precise pulses with the gpio pins using Timer1+2 with interrupt service routines. Jitter might be definitely below 10usecs. It does not matter if I send 1 or 13 telegrams a second from mainloop context, ISR timing keeps precise.

If I start regularly a manual ADC conversion (ADC->TASK_START=1)(from main loop or isr (didnt try PPI)) my precise pulse timing is gone. I got up to 700(!!)usecs jitter on my timing signals.

Jitter disappears if I turn off softcore or dont touch the DAC.

Conclusions/Ideas: ...its pretty scary where this 700usecs come from. ...if there is Timer0 running with the BLE stack and polling for non-busy ADC in the isr (how is the RSSI measured ?????) - this could somehow interfere - This would mean if a lower priority runtime / mainloop /low pri irq / is starting the adc - there might be busy blocking in the Timer0 irq from the stack. I read somewhere that the conversion time should be about 70usecs - why is it blocking irqs 700usesc ? Where does this jitter come from ? There has to be an arbitration issue with softcore and ADC. If we have this issue - how could I sample regularly without introducing this runtime penality ?

  • More investigations...., I have one IRQ with 2.5ms and another IRQ with 2.6ms period. If the issue would come from a concurrent usage of the ADC from softcore - than I should see the busy flag - but from IRQ context - ADC busy flag is not set.... With just these two irqs - I can see with my Tek Advanced Trigger pulse option that my gpio pulse is within 2.49ms and 2.51ms.

    If I issues "NRF_ADC->TASKS_START=1" every 4th irq = every 10 milliseconds - my pulse trigger gives me a maximum intermittent period(comes at least within a second) of 3.2ms and a minimum intermittend period of 1.75ms(1s integration) - So it seems that my irq is delayed sometimes by more than 700usecs - the minimum period is just the effect to compensate the stretched period. I assume that the IRQs are turned off for this period ..... but why does this only happen if ADC is triggered ??

Related