SLAU927 March 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.
For variables in global IQ format(IQ27):
DAC_OUTPUT_VOLTAGE = (VARIABLE_VALUE × DAC_SCALING_FACTOR + 1) × 1.65V
In the above eqaution setting the DAC_SCALING_FACTOR to 1 enables user to represent a data of IQ(1.0) to IQ(-1.0) in between 0 - 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 shit 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 | 0x202001B0 |
B phase current | 0x202001B4 |
C phase current | 0x202001B8 |
A phase current raw ADC value | 0x202001BC |
B phase current raw ADC value | 0x202001C0 |
C phase current raw ADC value | 0x202001C4 |
A phase voltage | 0x20200208 |
B phase voltage | 0x2020020C |
C phase voltage | 0x20200210 |
A phase voltage raw ADC value | 0x20200214 |
B phase voltage raw ADC value | 0x20200218 |
C phase voltage raw ADC value | 0x2020021C |
D axis current | 0x202002D0 |
Q axis current | 0x202002D4 |
D axis voltage | 0x202002D8 |
Q axis voltage | 0x202002DC |
Estimated motor velocity filtered | 0x20200700 |
Estimated rotor angle | 0x20200708 |
SVM ouput duty A phase | 0x202002A4 |
SVM ouput duty B phase | 0x202002A8 |
SVM ouput duty C phase | 0x202002AC |