SLAU846B June 2023 – November 2024 MSPM0G1105 , MSPM0G1106 , MSPM0G1107 , MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G3105 , MSPM0G3106 , MSPM0G3107 , MSPM0G3505 , MSPM0G3506 , MSPM0G3507
The DAC can be configured to operate in 8-bit or 12-bit resolution setting using the CTL0.RES bit. The CTL0.DFM bit can be used to select the data format to be straight-binary or twos-complement. When using straight-binary data format, the formula for the output voltage is given in Table 16-1.
Resolution | CTL0.RES | Output Voltage Formula |
---|---|---|
12-bit | 1 | Vout = Vref × (DATA_VALUE / 4096) |
8-bit | 0 | Vout = Vref × (DATA_VALUE / 256) |
The DAC can be enabled by setting the CTL0.ENABLE bit . When the DAC is enabled, the DAC core and output buffer start to settle and the module ready interrupt condition (MODRDYIFG) is generated once to indicate that the DAC is ready for use.
The DAC must be enabled after the configuration of all control registers as required in the application. If a configuration change is required when the DAC is running, the DAC must be disabled first and re-enabled after the new configuration is programmed into the control registers. Any change in control registers while the DAC is running can cause unpredictable results.