Hardware -- SAMD20 microcontroller

A project log for Heartbeat Logger

A portable device that logs a snippet of your heart at the push of a button.

Ole Andreas UtstumoOle Andreas Utstumo 02/01/2016 at 15:310 Comments

EDIT: Turns out, the D20 doesn't support DMA. D21 does, however.

A common microcontroller can do one thing at a time. This poses a challenge as the device must sample data and store it on the memory card at the same time, without affecting the rate of sampling. Yes, you could use interrupts on each ADC result complete and quickly store the result in a buffer, but there exists a far sexier way. The SAMD20 (Xmega in the prototype) sports a hardware module that handles Direct Memory Access (DMA), hardware that lets the microcontroller move data around without requiring any CPU time at all. It can even operate while the microcontroller is in sleep mode. Neat!

The SAM series of microcontrollers also provide a familiar setting for any one who's done programming and debugging of the AVR chips in Atmel Studio, like myself.