O'Reilly logo

ARM® Cortex® M4 Cookbook by Dr. Mark Fisher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting up the DAC

The aim of this recipe is to echo the analog voltage input to the ADC to the DAC. The DAC operation is relatively simple as compared to the ADC. The MCBSTM400 evaluation board doesn't provide any means of directly monitoring either of the DAC channels. As DAC channel 2 (output to PA5) drives the clock for the USB 2.0 transceiver (IC6), the only option that we have is to use DAC channel 1 (output PA4). To see an output, we'll need to probe the output PA4 with a test meter. This recipe is called echo_adc_dac_c5v0.

How to do it…

To set up the DAC follow the steps outlined:

  1. Clone adcTimerISR_c5v0 from the Using timers to trigger conversions recipe and extend it by adding the dac.c and dac.h files. These will be used to define a function ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required