View Single Post
Old 06-02-2009, 03:12 PM   #77 (permalink)
MPaulHolmes
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832

Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000
Thanks: 1,362
Thanked 1,202 Times in 765 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!
__________________
kits and boards
  Reply With Quote