Go Down

Topic: Watchdog in Arduino Library - or at least support by bootloader (Read 32 times) previous topic - next topic

retrolefty


thanks

saw the code snippet,
 
there was some comment about the right boot loader !
    what is the right boot loader ? I use the Arduino IDE, is that the right boot loader ?


Depends on what board model you have. The latest R3 Uno is OK as shipped.

Lefty

drjiohnsmith

thank you

so question still stands,

I have the off the shelf Arduino IDE, program via the ide / code on the standard arduino boards,
    standard boards etc,

I guess like,  most people.


do we have an example design I can download, modify and use ?
    are you saying I need a different set of boot loader and programer for the arduino ?

A guide would be good please.



bperrybap

#17
Nov 20, 2012, 08:46 am Last Edit: Nov 20, 2012, 08:48 am by bperrybap Reason: 1

I have the off the shelf Arduino IDE, program via the ide / code on the standard arduino boards,
   standard boards etc,

What does that mean?
There are many different versions of the IDE and many different arduino boards as well
as revisions of those boards.


Quote

do we have an example design I can download, modify and use ?

I haven't seen one, but then I haven't looked. It is pretty simple to use.
Nick provided an outline of the code you need to make watchdog work.
If you want to know more you can consult the AVR libc manual:
http://www.nongnu.org/avr-libc/user-manual/group__avr__watchdog.html
What is useful on that page are the other timer timeout defines like
WDTO_2S, WDTO_120MS, etc.. So you can see the other timeout values
available.



Quote

   are you saying I need a different set of boot loader and programer for the arduino ?

Without knowing exactly what you have, it will be impossible to say.

If you have an ISP programmer you can use the 1.x IDE to burn a new optiboot bootloader
into the AVR on your m328 based board that will work with the watchdog timer.
i.e. you can convert your older arduino into a board that will appear to be
an "uno" with optiboot as far as the IDE is concerned.

But depending on what board you have, you may not have to do this.

--- bill

westfw

Well, we know "recent UNOs" (perhaps even "all Unos") should have a bootloader that correctly disables the watchdog on RESET.  Note that this means that your sketch will not be able to tell that it was restarted by the watchdog (which is occasionally useful.)

And we know that all Arduino MEGAs currently in production have a bootloader that does NOT disable the watchdog.
There's actually a patch for the MEGA bootloader to fix this; it's just not shipping yet.

Official Duemilanove and earlier 28-pin CPUs may or may not work.
There are some third-party bootloaders (ie AdaBoot) that fixed this.

Typical usage of the watchdog would be to do the wdt_enable (WDTO_1S); in setup(), and then call wdt_reset() at the start of loop().  If the loop execution takes longer than (in this case) one second, the watchdog will reset the chip and it will start over.

I'm not sure how much more of an API you'd be able to wrap around this...

drjiohnsmith

thank you west fw.

seems from what I read that it could be construed that arduino is not one product.
   
to answer an earlier comment,  I like the mega, and I have the official IDE that comes from the arduino web site,
   as in here

http://arduino.cc/en/Main/Software

would be nice if there was an example I could use, same as we have examples for things like lcd's in the ide.
   
how about an example,

suggestions.
  print out to rs232 message.
    flashes the led, using say delay
     that needs say a key to be pressed on the terminal within say 10 seconds,
            if you press a key, led stays on for a second,
                 if you don't press a key in time,  program resets

just an idea,
   thanks

Go Up