View Single Post
Old 06-02-2009, 02:12 PM   #77 (permalink)
MPaulHolmes
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Seattle, WA
Posts: 2,552

Michael's Electric Beetle - '71 Superbeetle 500000
Thanks: 371
Thanked 296 Times in 187 Posts
I don't think the microcontroller freezing would be a problem. You can just have a watchdog timer set so that the program restarts in like 1 second if the microcontroller freezes up. Then the program just goes right back to its charging algorithm. I guess you would have to make sure that you start the charging algorithm sort of passively, to see if the battery is mostly charged already? So that if it hangs repeatedly and keeps starting over, it wouldn't be hard on a fully charged battery.

By the way, I never knew what watchdog was until like 1 month ago. The watchdog is a separate timer that keeps counting even if the microcontroller freezes up. If it ever reaches its max, it triggers a reset of the program. So, you put code in that makes sure the watchdog keeps starting over so it never reaches its max value (that you choose). That way, if the code stops running for some reason, the watchdog triggers a reset. It's awesome! ya!
__________________
When I die, I would like to go peacefully, in my sleep, like my grandfather did. Not screaming and yelling like the passenger in his car.
  Reply With Quote