2007-09-19 10:09 PM
WDT reset recognition in ST7FMC
2007-09-11 03:40 AM
Hello,
I am projecting e-bike controlling system on the ST7FMC. The SW application is working good, but it is not really protected from the noise and disturbance going from the motor power stage. So I have activated WDT with idea to provide application restoring on any disturbance which causes SW gets crashed or stopped. The current problem for me is to separate external reset event from the one generated by WDT. I have tryied this codes: void main(void) { ClrBit(SICSR,PAGE); if (!ValBit(SICSR,WDGRF)) { //WDT reset observed //reset bit to prepare for next reset ClrBit(SICSR,WDGRF); } else { //external reset oserved } ... But these codes give me the same result every time undependend of the reset source - exactly like reset is always external. What is wrong in my codes? Thank you, Alexander.2007-09-11 10:42 PM
2007-09-12 02:37 AM
Hello Luca,
Thanks for the answer and nice idea. Sure, it could be used in my application(and I will do this, if no success with WDGRF bit), but it has the certain disadvantage, that it doesn't work work for external reset occured while MCU is powered, at this case the pattern left untouched. But you are right, this is a good method to separate WDT and POWERON resets. Do you know something about big WDGRF, it is working or not? Regards, Alexander.2007-09-19 10:09 PM
Hi Luka,
Finally the issue has been solved. I have not found any ideas in the ST7FMC datasheet, but when occasionally I opened datasheet of ST72324, I was suprized found this caution in the chapter 6.4.5: ''CAUTION: When the LVD is not activated with the associated option byte, the WDGRF flag can not be used in the application.'' There such coution is missed in the datasheet of ST7FMC, which I am using in my application for e-bike. So once I activated the LVD bit in the option byte, the issue has been solved. What can I say now? RTFM, especially of the related and similar product. Sometimes solution is nearby at the next door. Regards, Alexander.