Skip to main content
PBela.1
Associate II
March 11, 2020
Solved

Changing Over Current Protection Comparator threshold does not change the Standby 1 and 2 outputs accordingly in the code

  • March 11, 2020
  • 3 replies
  • 2436 views

I'm currently trying to spin a motor using the STEVAL_SPIN3201 and the motor control workbench and when I add a small load I get the overcurrent fault. After some research in the source code I realised that the OCCOMP was indeed overcurrenting with the 100mV comparator threshold. I then tried to set the threshold to 500mV but when I generate the source code the OCTH_STBY2_Pin stays at GPIO_PIN_RESET and I still overcurrent. I tried changing manually in the source code the output for GPIO_PIN_SET and I don't overcurrent anymore but whenever I regenerate code from motor workbench this gets overwritten. Is there another setting in the motor workbench that prevents this threshold to change or is there a bug in the code generation?

0693W000000TglqQAC.png

0693W000000Tgm0QAC.png

0693W000000TglvQAC.png

Best regards,

This topic has been closed for replies.
Best answer by CLutz.1

Hi,

I can not help on the issue, but I can confirm same situation on SPIN3202. OCTH_STBY1 is reset and OCTH_STBY2 is set. No effect by comperator threshold setting in MCWB. You can try to set OCTH_STBY1 and OCTH_STBY2 again after MX init in /* USER CODE BEGIN 0 */. This will not be overwritten by re-generation.

3 replies

PBela.1
PBela.1Author
Associate II
April 29, 2020

Bumping this questions up since I have not received an answer yet...

CLutz.1
CLutz.1Best answer
Visitor II
May 4, 2020

Hi,

I can not help on the issue, but I can confirm same situation on SPIN3202. OCTH_STBY1 is reset and OCTH_STBY2 is set. No effect by comperator threshold setting in MCWB. You can try to set OCTH_STBY1 and OCTH_STBY2 again after MX init in /* USER CODE BEGIN 0 */. This will not be overwritten by re-generation.

PBela.1
PBela.1Author
Associate II
May 4, 2020

Thanks for the confirmation. This is indeed the workaround that I ended up doing.