ESP3hursday2 (late ESP32uesday): Poking DMA With a Stick

Normally I blog about ESP32 on Tuesdays, but was super exhausted after a trip to a monster-themed convention, so this one’s late. Saw some excellent monsters though!

Recap: I’ve been tasked with learning the intricacies of the ESP32 family, as they’re more available than other parts during this chip shortage. A pressing need is to get the Adafruit_Protomatter RGB matrix library working with the LCD peripheral unique to the ESP32-S3. Not quite there yet, but making headway. Part 1. Part 2.

The S3’s LCD peripheral requires using DMA (direct memory access), which I was dreading as another steep learning curve…but as it turns out, it’s not entirely unfamiliar, somewhat resembling the DMA implementation on Atmel SAMD chips, which I’ve used quite a bit! Much of the jargon and concepts are exactly the same…channels, descriptors, linked lists and so forth…

Left: ESP32-S3 Technical Reference Manual. Right: SAMD51 Datasheet. Both use linked lists of DMA descriptor structures.

The ESP32-S3 is a bit different from prior ESP32 generations. The new “General DMA” (GDMA) allows somewhat arbitrary mapping between channels and peripherals, whereas prior ESP32’s tended toward peripheral-specific DMA instances and channels…

Left: ESP32-S2 DMA Modules. Right: ESP32-S3 Channels and Modules. Nice.

The only place it gets peculiar compared to SAMD is that RAM-to-RAM DMA transfers (e.g. like a background memcpy()) require two channels, an “inlink” and “outlink” with GDMA as the middleman. That’s not something needed in Protomatter, just an interesting tidbit learned along the way.

Additionally, ESP32-S3’s GDMA supports “round-robin” scheduling (cycling through DMA channel transactions, rather than each in turn)…again, not vital for Protomatter, but I could see this being helpful for other projects like NeoPXL8 (not currently ESP32-compatible) and am eager to explore this later. SAMD51 is supposed to support round-robin scheduling but I could never get it to work, unsure if ineptitude on my part or a documentation or silicon errata issue.

Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on, jump into CircuitPython to learn Python and hardware together, TinyGO, or even use the Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for CircuitPython, MakeCode, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.

Join 32,000+ makers on Adafruit’s Discord channels and be part of the community!

Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7pm ET! To join, head over to YouTube and check out the show’s live chat – we’ll post the link there.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Follow Adafruit on Instagram for top secret new products, behinds the scenes and more

CircuitPython – The easiest way to program microcontrollers –

Maker Business — A paradigm shift

Wearables — Look sharp with this quick tip!

Electronics — Straw Diffusers

Python for Microcontrollers — Python on Microcontrollers Newsletter: MicroPython 1.19 released and more! #Python #CircuitPython @micropython @ThePSF

Adafruit IoT Monthly — eInk Postcard, VR Spectrum Instrumentation, and more!

Microsoft MakeCode — MakeCode Thank You!

EYE on NPI — Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey

New Products – Adafruit Industries – Makers, hackers, artists, designers and engineers! — New Prods 6/22/22 Feat. ADS1115 16-Bit ADC – 4 Channel w. Programmable Gain Amplifier – STEMMA QT!

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at !

No Comments

No comments yet.

Sorry, the comment form is closed at this time.