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

ThomasESP32
Posts: 191
Joined: Thu Jul 14, 2022 5:15 am

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

Postby ThomasESP32 » Mon May 29, 2023 7:35 am

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

MicroController
Posts: 1136
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

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

Postby MicroController » Mon May 29, 2023 12:17 pm

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.

Who is online

Users browsing this forum: No registered users and 136 guests