2024-07-02 08:34 PM
MCSDK: 6.3.0
Algorithm: FOC
Type:INVERTER
Inverter:STEVAL-SPIN3202
Mcu:STSPIN32F0A
I turned on the overcurrent protection function.
I want to modify the threshold in my code project, but I can't find the corresponding code.I want to know where his corresponding code location is.
Solved! Go to Solution.
2024-07-03 03:05 AM
Hi @gtop.1 ,
As stated by @AlexH98 , please read the doc :grinning_face:.
STSPIN32F0 threshold is configured with 2 GPIOs pins. OCTH_STBY1 and OCTH_STBY2, if you open your IOC you will see them:
The configuration of those pins is done in the main.c
static void MX_GPIO_Init(void)
...
/**/
GPIO_InitStruct.Pin = OCTH_STBY2_Pin;
GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT;
GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
GPIO_InitStruct.Pull = LL_GPIO_PULL_DOWN;
LL_GPIO_Init(OCTH_STBY2_GPIO_Port, &GPIO_InitStruct);
/**/
GPIO_InitStruct.Pin = OCTH_STBY1_Pin;
GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT;
GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
GPIO_InitStruct.Pull = LL_GPIO_PULL_DOWN;
LL_GPIO_Init(OCTH_STBY1_GPIO_Port, &GPIO_InitStruct);
Regards
Cedric
2024-07-02 11:08 PM
Hey @gtop.1
the overcurrent protection is done through the hardware, have a look at the part related to this feature in the hardware schematic
refer to the reference manual for the hardware to get the idea.
Also you should know about how the timer brake pin works
regards.
2024-07-03 03:05 AM
Hi @gtop.1 ,
As stated by @AlexH98 , please read the doc :grinning_face:.
STSPIN32F0 threshold is configured with 2 GPIOs pins. OCTH_STBY1 and OCTH_STBY2, if you open your IOC you will see them:
The configuration of those pins is done in the main.c
static void MX_GPIO_Init(void)
...
/**/
GPIO_InitStruct.Pin = OCTH_STBY2_Pin;
GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT;
GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
GPIO_InitStruct.Pull = LL_GPIO_PULL_DOWN;
LL_GPIO_Init(OCTH_STBY2_GPIO_Port, &GPIO_InitStruct);
/**/
GPIO_InitStruct.Pin = OCTH_STBY1_Pin;
GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT;
GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
GPIO_InitStruct.Pull = LL_GPIO_PULL_DOWN;
LL_GPIO_Init(OCTH_STBY1_GPIO_Port, &GPIO_InitStruct);
Regards
Cedric
2024-07-03 03:32 AM
I found it, thanks.