Digital To Analog Converter DAC
Digital To Analog Converter DAC
Digital To Analog Converter DAC
DAC
Contain
1. DAC introduction
2. DACx channel block diagram
3. DAC analog output
4. DAC data format
5. DAC conversion triggers
6. DAC noise wave generation
7. DAC triangle wave generation
8. DAC with DMA
DAC introduction
• Interfaces:
• Features and differences:
Interfaces:
• Two 12-bit DAC converters inside STM32F37x:
• DAC1 with 2 DAC output channels
• DAC2 with 1 output channel
• External pin
• EXTI line9
• Software
• SWTRIG bit
DAC noise wave generation
• • Noise generation:
• Based on LFSR (linear feedback shift register):
Initial value = 0xAAAA
• The LFSR 12bits value can be masked partially or totally
• Anti lock-up mechanism: if LFSR equal to 0 then a 1 is injected on it
• Calculated noise value (updated through external trigger) is added to the DAC_DHRx content without
overflow
DAC triangle wave generation
• Triangle generation:
• Add a small-amplitude triangular waveform on a DC or slowly varying signal: used as basic waveform
generator for example
• Calculated triangle value (updated through external trigger) is added to the DAC_DHRx content without
overflow to reach the configurable max amplitude
• Up-Down triangle counter:
Incremented to reach defined max amplitude value
Decremented to return to the initial base value