SLUUDM5 March 2026 MSPM0G1507 , MSPM0G1519 , MSPM0G3507 , MSPM0G3519
Table 8-10 shows the default mapping relationship for sensorless-foc_DRV8316_LP_MSPM0G3507 project.
| Board Layer | HAL Layer | SysConfig Configurations | ||
|---|---|---|---|---|
| SysConfig Layer | ||||
| Board Connection | ADC CHAN | ADC MEMRES | HAL Layer Macro | |
| Phase A Current | A0_3 | A0_MEM0 A0_MEM1 A1_MEM0 A1_MEM0 | ADC0_CURRENT_U_CH | Initializes Memory 0/1 of ADC0/ADC1. The channel selection does not matter as the FOC application dynamically overwrites the channel settings according to HAL layer macro in runtime. |
| Phase B Current 1 | A0_2 | ADC0_CURRENT_V_CH | ||
| Phase B Current 2 | A1_2 | ADC1_CURRENT_V_CH | ||
| Phase C Current | A1_1 | ADC1_CURRENT_W_CH | ||
| Bus Voltage | A1_3 | A1_MEM2 | FOC_ADC_VOLT_DC_INST ADC_VOLT_DC_IDX | Assign the ADC1 channel 3 to Memory 2. |
| Phase A Voltage | A1_6 | A1_MEM0 | ADC_VOLTAGE_U_INST ADC_VOLTAGE_U_IDX ADC_VOLTAGE_U_CH | Not initialized in SysConfig and dynamically initialized in the FOC application if run ISD function. |
| Phase B Voltage | A0_7 | A0_MEM0 | ADC_VOLTAGE_V_INST ADC_VOLTAGE_V_IDX ADC_VOLTAGE_V_CH | |
| Phase C Voltage | A1_5 | A1_MEM1 | ADC_VOLTAGE_W_INST ADC_VOLTAGE_W_IDX ADC_VOLTAGE_W_CH | |
| ADC Interrupt | NA | A0_MEM1 | FOC_ADC_ISR_INST | Initialize ADC0 interrupt configuration with MEM1 Result Loaded. |
| FOC_ADC_MEM_RES_LOAD | ||||
The FOC application dynamically modifies ADC channel and ADC memory result register mapping for different modes. In ISD mode, FOC applications use ADC0 MEM0 and ADC1 MEM0/1 to store sampled phase voltages. In other mode, FOC application use ADC0 MEM0/1 and ADC1 MEM0/1 to store sampled phase currents. Table 8-11 shows the API used by FOC application in Drv8316_focHalInterface.c file.
| FOC API | HAL Layer Macro | Description |
|---|---|---|
| HAL_GD_ConfigureVoltageChannels() | ADC_VOLTAGE_X_INST ADC_VOLTAGE_X_IDX ADC_VOLTAGE_X_CH | Map the phase voltage channel (X_CH) to certain ADC MEM (X_IDX) of ADC Instance (X_INST). X = U / V / W. |
| HAL_GD_ReadVoltages() | ADC_VOLTAGE_U_INST ADC_VOLTAGE_U_IDX | Read the phase voltage from the ADC MEM (X_IDX) of the ADC Instance (X_INST). X = U / V / W. |
| HAL_GD_ConfigureCurrentChannels() | ADC0_CURRENT_X_CH | Map the phase current channel (X_CH) to the hardcoded ADC instance and ADC Memory. X = U / V / W. |
| HAL_GD_ReadCurrents() | NA | Read the phase current from the hardcoded ADC Memory of ADC Instance. |
| HAL_GD_ReadDCVBusVoltage() | FOC_ADC_VOLT_DC_INST ADC_VOLT_DC_IDX | Read the bus voltage from the pre-defined ADC memory of ADC instance. |
The following sections introduce the flow if user’s hardware does not follow the default mapping of SDK project.