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 ...

Get ARM® Cortex® M4 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.