Re: 1-32khz sensor-sampling loop
- Uses the SAM0 DMA unit to read the ADC and write to memory when the ADC conversion complete event triggers
- Uses the SAM0 event system to hook the timer into the ADC trigger
- Sets up a 32 kHz hardware timer
Hi Nathan. I'm fairly new to Zephyr, but if you're looking for hard real time-ish at 32 kHz then I'd talk straight to the hardware.For example, say I needed to read an ADC channel at 32 kHz on the ATSAMD21. I'd use the Zephyr drivers to initialise the ADC and DMA units and then do custom iniitalisation that:
The DMA can work in ping-pong mode and fire an interrupt when the buffer is half full. This can then set a semaphore and wake up your task.
Hope that helps,
On Fri, 2 Feb 2018 at 17:36 Nathan T <nathan@...> wrote: