SLAU948 October 2024 MSPM0G3507
32-bit algorithm variables can be output in real time from the MCU through the DAC. DAC output is enabled by setting DAC_EN = 1. The DAC in MSPM0 is 12 bit, thus a scaling needs to be applied before output. User has two ways to scale the variable before output.
DAC_OUTPUT_VOLTAGE = (VARIABLE_VALUE × DAC_SCALING_FACTOR + 1) × 1.65V
In the above equation setting the DAC_SCALING_FACTOR to 1 enables user to represent a data of IQ(1.0) to IQ(-1.0) in between 0V and 3.3V. To represent the data exceeding the value 1.0 use higher DAC_SCALING_FACTOR.
For Example: To represent a data from -2.0 to +2.0 , set the DAC_SCALING_FACTOR to 0.5.
For output of any other IQ, user can left shift or right shift the variable to bring the data in a 12-bit range before output. This mode is selected by setting DAC_SCALING_FACTOR to 0.
If variable value is less than a 12-bit value, set DAC_SCALE to positive, the DAC output follows as below:
DAC_OUTPUT_VOLTAGE = (VARIABLE_VALUE << DAC_SCALE) × 3.3V
If variable value is greater than a 12-bit value, set DAC_SCALE to negative, the DAC output follows as below
DAC_OUTPUT_VOLTAGE = (VARIABLE_VALUE >> DAC_SCALE) × 3.3V
Variable | Address |
---|---|
A phase current | 0x202005FC |
B phase current | 0x20200600 |
C phase current | 0x20200604 |
A phase current raw ADC value | 0x20200608 |
B phase current raw ADC value | 0x2020060C |
C phase current raw ADC value | 0x20200614 |
A phase voltage | 0x2020066C |
B phase voltage | 0x20200670 |
C phase voltage | 0x20200674 |
A phase voltage raw ADC value | 0x20200678 |
B phase voltage raw ADC value | 0x2020067C |
C phase voltage raw ADC value | 0x20200680 |
D axis current | 0x20200778 |
Q axis current | 0x2020077C |
D axis voltage | 0x20200780 |
Q axis voltage | 0x20200784 |
Estimated motor velocity filtered | 0x20200A5C |
Estimated rotor angle | 0x20200A64 |
SVM output duty A phase | 0x20200748 |
SVM output duty B phase | 0x2020074C |
SVM output duty C phase | 0x20200750 |