SAADC internal timer setup requirements for continuous mode

Hi there,

I'm using the product specification of the nRF52840 to program the SAADC in continuous mode using its internal timer. I'm not able to use your SDK. Unfortunately, I'm having difficulty in getting a repeated sampling to occur. I can get one-shot sampling working very well.

I'm doing everything per https://infocenter.nordicsemi.com/topic/ps_nrf52840/saadc.html?cp=4_0_0_5_22_3#saadc_easydma and Figure 4, sans firing the SAMPLE task. My expectation is that the SAMPLE task is fired by the internal timer of the SAADC. I see the STARTED event but then nothing else. I then read https://devzone.nordicsemi.com/f/nordic-q-a/73186/nrf52840-saadc-continuous-sampling-not-started-with-task_start and saw that a SAMPLE task should be issued after the first START task to kick things off (there being an omission in the product specification). When I do issue an initial SAMPLE task, I see the STARTED event and then an END event with samples... At this point, I issue another START task (as per Figure 4), but I don't see any more END events.

Here's the logging of events with the initial SAMPLE task included:

0 INFO Started
1 INFO Done
2 INFO Result done
3 INFO Done
4 INFO Result done
5 INFO Ended
6 INFO sample len=500
7 INFO Started

I'm logging Stopped events also, but not seeing them (which is good).

My sample rate is specified as 1600 and I also set TIMER mode. I'm using double-buffering, each buffer sized for 500 samples, and swap buffers on processing the Started event. There is just one channel configured.

Thanks for any help or guidance.

Kind regards,
Christopher

Parents
  • Additional info: if I drive the TASK_SAMPLE from a timer via PPI instead of the internal clock on the SAADC then I get the same behaviour i.e. the first sample is performed, but no more. I've verified that the PPI and timer is set up correctly by toggling an LED instead. This suggests that the behaviour I'm observing perhaps isn't due to the lack of TASK_SAMPLE being fired.

  • Hello Christopher,

    I'm using the product specification of the nRF52840 to program the SAADC in continuous mode using its internal timer. I'm not able to use your SDK.

    Just to clarify, what do you mean when you say you are not able to use our nRF5 SDK? Do you mean that there is a requirement or constraint in your application that prevents you from utilizing it, or are you saying that you are having some trouble using it? In case of the latter please let me know and I will try to assist you in getting it up and running.
    The SDK is very useful, as it saves you the trouble of having to reimplement a lot of the peripheral procedures. The nrfx_saadc_v2 driver in particular makes the SAADC a lot easier to work with.

    I then read https://devzone.nordicsemi.com/f/nordic-q-a/73186/nrf52840-saadc-continuous-sampling-not-started-with-task_start and saw that a SAMPLE task should be issued after the first START task to kick things off (there being an omission in the product specification).

    Yes, unfortunately it seems that the product specification does not document the continuous mode of the SAADC with enough depth. I have asked our technical writers to have a look at this.

    Here's the logging of events with the initial SAMPLE task included:

    So, the main issue is that you do not get another end event, following the started one?
    How are you providing the second buffer to the SAADC? If possible, it would be helpful if I could see how you have implemented this.
    Are you triggering any SAMPLE tasks after the initial one? Do you perform any calibrations in your program?
    Could I ask you to share the entire log, along with the SAADC configuration and code you are running?
    If you would not like to share any code publicly please let me know and I will convert the ticket to Private so that it is only viewable by yourself and the support staff here at Nordic.

    My sample rate is specified as 1600 and I also set TIMER mode. I'm using double-buffering, each buffer sized for 500 samples, and swap buffers on processing the Started event. There is just one channel configured.
    Christopher Hunt said:
    Additional info: if I drive the TASK_SAMPLE from a timer via PPI instead of the internal clock on the SAADC then I get the same behaviour i.e. the first sample is performed, but no more. I've verified that the PPI and timer is set up correctly by toggling an LED instead. This suggests that the behaviour I'm observing perhaps isn't due to the lack of TASK_SAMPLE being fired.

    Thank you for elaborating on this. I concur that this then do not sound like a missing TASK_SAMPLE. Instead, I suspect that there might be an issue with the SAADC buffers, and I'd like for us to take a closer look at how the double buffering is implemented.

    Best regards,
    Karl

Reply
  • Hello Christopher,

    I'm using the product specification of the nRF52840 to program the SAADC in continuous mode using its internal timer. I'm not able to use your SDK.

    Just to clarify, what do you mean when you say you are not able to use our nRF5 SDK? Do you mean that there is a requirement or constraint in your application that prevents you from utilizing it, or are you saying that you are having some trouble using it? In case of the latter please let me know and I will try to assist you in getting it up and running.
    The SDK is very useful, as it saves you the trouble of having to reimplement a lot of the peripheral procedures. The nrfx_saadc_v2 driver in particular makes the SAADC a lot easier to work with.

    I then read https://devzone.nordicsemi.com/f/nordic-q-a/73186/nrf52840-saadc-continuous-sampling-not-started-with-task_start and saw that a SAMPLE task should be issued after the first START task to kick things off (there being an omission in the product specification).

    Yes, unfortunately it seems that the product specification does not document the continuous mode of the SAADC with enough depth. I have asked our technical writers to have a look at this.

    Here's the logging of events with the initial SAMPLE task included:

    So, the main issue is that you do not get another end event, following the started one?
    How are you providing the second buffer to the SAADC? If possible, it would be helpful if I could see how you have implemented this.
    Are you triggering any SAMPLE tasks after the initial one? Do you perform any calibrations in your program?
    Could I ask you to share the entire log, along with the SAADC configuration and code you are running?
    If you would not like to share any code publicly please let me know and I will convert the ticket to Private so that it is only viewable by yourself and the support staff here at Nordic.

    My sample rate is specified as 1600 and I also set TIMER mode. I'm using double-buffering, each buffer sized for 500 samples, and swap buffers on processing the Started event. There is just one channel configured.
    Christopher Hunt said:
    Additional info: if I drive the TASK_SAMPLE from a timer via PPI instead of the internal clock on the SAADC then I get the same behaviour i.e. the first sample is performed, but no more. I've verified that the PPI and timer is set up correctly by toggling an LED instead. This suggests that the behaviour I'm observing perhaps isn't due to the lack of TASK_SAMPLE being fired.

    Thank you for elaborating on this. I concur that this then do not sound like a missing TASK_SAMPLE. Instead, I suspect that there might be an issue with the SAADC buffers, and I'd like for us to take a closer look at how the double buffering is implemented.

    Best regards,
    Karl

Children
No Data
Related