Tuesday, March 11, 2014

Oh Bother . . . Arduino does not support watchdog in 3.3v boot loader.

I have been using the Arduino programming environment for this project to take advantage of its rather simple and integrated approach.  It also does make code a bit simpler to follow, for example:
 
    pinMode(FIELD_PWM_PORT, OUTPUT);

does tend to read better then:
  
     DDRA = 0b11111111;

However it also comes with downsides.  Such as slightly larger code (example, the DDRA code above sets 8 ports at a time), and other side effects.  One of which I came across today...

Seems the default Arduino boot loader does not always support watchdog timers in the 3.3v version.  (See here for some insight:  http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=1123964 )

Bother.

This impacts the current code in two ways:
  1. Reliability with availability of Watchdog
  2. Us of watchdog function to force a reset of the code (ala, during a recoverable fault)

I will need to research a bit more how to get the watch dog functioning.  Clearly I can modify the boot loader, and that in the end might be what needs to be done.  But bother - kind of gets away from the 'simple integrated programming environment'






No comments:

Post a Comment