Page 1 of 1

ESP32-S3 : Use DMA to sample an input pin.

Posted: Mon May 29, 2023 7:35 am
by ThomasESP32
Good morning,

using an ESP32-S3, I would like to sample an input digital pin every 1ms during 100ms.
Is it possible to do this using a DMA ? The goal would be to delay a task during 100ms
and after the task wakes up, I would like to have the possibility the get the 100
results.

Do you think it is possible ?
best regards,

Thomas TRUILHE

Re: ESP32-S3 : Use DMA to sample an input pin.

Posted: Mon May 29, 2023 12:17 pm
by MicroController
At 1ms intervals, it is possible to use the high resolution timer. Set up a periodic timer with 1000 micro-seconds interval and in the timer callback sample the input pin and add the sample to a sample buffer. After 100 samples are taken, stop the timer and notify the task that it can now process the data.