SLAA475A October   2010  – March 2019 MSP430L092

 

  1.   MSP430x09x Analog Pool: Feature Set and Advanced Use
    1.     Trademarks
    2. 1 MSP430x09x Overview
    3. 2 Analog Pool (A-Pool)
      1. 2.1  Input Dividers
      2. 2.2  Internal Reference
      3. 2.3  Starting and Stopping the A-Pool
      4. 2.4  Comparator Function
      5. 2.5  8-Bit DAC Function
      6. 2.6  8-Bit ADC Function
        1. 2.6.1 ADC Conversion Using Ramp
          1. 2.6.1.1 ADC Conversion Without Error Compensation
          2. 2.6.1.2 ADC Conversions With Overdrive Compensation
          3. 2.6.1.3 ADC Conversions With Offset Compensation
          4. 2.6.1.4 ADC Conversions With Overall Compensation
          5. 2.6.1.5 Windowed ADC Conversion
        2. 2.6.2 ADC Conversion Using SAR
        3. 2.6.3 Multiple ADC Conversions
        4. 2.6.4 Comparison Between Different Measurement Methods
        5. 2.6.5 Error Dependencies
      7. 2.7  SVM Function
      8. 2.8  Use of Multiple Features
      9. 2.9  Temperature Measurements With the A-Pool
      10. 2.10 Fractional and Integer Number Use
      11. 2.11 APINTB and APFRACTB Use With ATBU and EOCBU
      12. 2.12 A-Pool Trigger Sources
      13. 2.13 Filtering ADC Conversions With Digital Filters
    4. 3 Summary
    5. 4 References
  2.   Revision History

8-Bit DAC Function

Within the MSP430x09x, an 8-bit DAC is implemented to generate voltages between 0 and 256 mV. The reference voltage for the DAC is the 256 mV generated internally from the reference module. The DAC voltage either can be used internally as an input for the comparator selected with the multiplexers or can be switched out on the AOUT pin. To set a voltage, the APINT register must be filled with the correct value, and the output buffer select (OSEL) and DAC buffer enable signal (DBON) bits must be set. To output the analog voltage on the port pin, it is necessary also to set the output driver (ODEN) bit. Any change of the APINT value is directly visible on the generated analog voltage.

A simple DAC code example follows. On the AOUT pin, a rising wave can be observed. Figure 4 shows the used paths through the A-Pool.

#include "msp430l092.h" void main( void ) { // Stop watchdog timer to prevent time out reset WDTCTL = WDTPW + WDTHOLD; APCNF = DBON+CONVON+APREFON; // Enable DAC buffer + // Enable conversion + // Enable reference APCTL = ODEN+OSEL; // Set DAC output to pin + // Select output buffer while (1) { APINT = APINT + 1; // Increment APINT value } }
example_dac_slaa475.gifFigure 4. Example of DAC Function