by mycroftcomptro · 5y ago · 0 comments
Most chips will have some sort of PWM or advanced timer peripheral that can generate waveforms on a pin without direct CPU intervention. You write to registers to change the frequency, duty cycle, etc.
Many chips also include asynchronous DACs, but they're usually too low-resolution for high-fidelity audio.
Most microcontrollers also include some form of DMA, which can shuttle data between peripherals and memory without CPU intervention. You can also user timer peripherals to trigger DMA transfers, which lets you send buffered data to a DAC on a KHz schedule while the CPU does other things.
And of course, you can usually use timer peripherals to periodically interrupt the main thread when you don't want to wait in a busy-loop.
No comments yet.