This tutorial was extracted from Erich Styger blog http://mcuoneclipse.wordpress.com with his agreement.
After working on an ADC example, a DAC one was missing. Julio E. Fajardo is a reader of this blog, and he was so kind to send me an example project for the FRDM-KL25ZFRDM-KL25Z. The example is able to produce produce different waveforms with the DAC. The project has two examples which they are enabled/disabled in main()
. One example waveform the sawtooth:
Sawtooth_FDRM_DAC
And the other example waveform is a sinus:
Sinus_FDRM_DAC_PE
The project sources are available on GitHub. It is using tables with the values so they are not computed at runtime. I tweaked the code a bit, and have defined the table as const
array so it ends up in FLASH.
Many thanks again to Julio for that great example and screenshots!