Artful Bytes

A blog about building and programming hardware.

ADC driver with DMA in C

May 14, 2023 1 min read

New video.

My sumobot has four line sensors to detect the white border that surrounds the platform. In this video, I write an ADC driver to sample the values from these sensors. To reduce CPU load, I employ a sequential sampling strategy where the ADC peripheral samples and writes all channel values to memory via DMA before interrupting the CPU. Finally, I add additional software abstractions to turn the raw voltage values into actual line positions.