Skip to content

Latest commit

 

History

History
37 lines (21 loc) · 2.56 KB

README.md

File metadata and controls

37 lines (21 loc) · 2.56 KB

〰️ ESP32S3 Digital to Analog Considersations

The ESP32S3 is full of built-in features from bluetooth to USB, but surprisingly lacks a DAC! Some ESP32 skus have an I2S to internal DAC which sounds like a great feature, but unfortunately, not only does the ESP32S3 version no have it, this feature is deprecated... bummer.

The recommended way forward is to either use the PWM (their LEDC peripheral) or Sigma-Delta output, either way you low pass filter the output to generate the output level.

Here we choose the PWM route simply because Micropython already has PWM support for the ESP32S3 target.

Passive filter

We also implement a basic LPF, where $R = 4.7K Ohm$ and $C = 4.7\mu F$. That gives about a 5kHz cutoff covering $f_{mark} = 1200Hz$ and $f_{space} = 2200Hz$.

DMA-like output at fixed frequency

Some micropython ports include a function write_timed which "Initiates a burst of RAM to DAC using a DMA transfer" We again do not have this function built-in functionality with the ESP32S3 port. Fortunately, this functionality is easy to implement with good old fashion timers and interrupts as is done in the out_afsk function.

AFSK Output rate comparison

AFSK sampling rates from 11k to 44k all functional for creating demodulatable signal. One consideration I noticed was at 44.1kHz, the microcontroller was periodically having issues keeping up. Recommendation going with 22kHz or even 11kHz depending on application and timing margin needed.

44.1kHz

22.05kHz

11.025kHz

🙌 Acknowledgements