I am running a bldc motor using Instaspin 2802FOC chip. I am using lab 5b from Motorware Software and did the following changes to that code. I have configured GPIO 17 to read the short circuit. The pin goes low for 30ms when there is short circuit on the board. I want to completely disable the motor when this happenes. So in the main forever loop I added one if loop:
bool gSckt;
if (gSckt == false)
{
for (;;)
{
gMotorvars.Flag_enableSys = false;
}
}
I inserted this portion in the forever loop, but the code is not working.
I have added external on/off switch similarly and it is working fine, just the short circuit is not working.
Any help would be appriciated.