Using the watchdog and saving current

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm working on an application where the current and space budgets are extremely tight. There is an MCU in there which has to keep track of time. That is, it has to wake up every 2 seconds or so, do its task and go back to sleep. We are currently at the 90S1200 because the 20-pin ssop is actually smaller than an 8-pin soic. There is an external crystal running at a locked frequency of 4MHz.

The easiest way to do the timing control is to use the 8-bit timer/counter with a prescale. Unfortunately, the 0.4mA drawn in idle mode is something we can't live with. So the next candidate is the watchdog. It is probably OK to shut off the crystal, but we still need to make sure that the sleep time does not deviate enormously.

So my question is: Could anyone please help me out with some info on how to calibrate the watchdog timer? Any tips on keeping track of time while saving current are also very welcome.

Best regards,

Børge Strand

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think I might have exactly what you want. I am using a 2343 with the internal ceramic oscillator and I have made a C-function that puts it to sleep for a wanted time (ms to seconds) and is waked up by the watch dog.

First, and IMPORTANT!!!!! I don't think you can use the 1200 if you want to use the watch dog as wake up source. The 1200 is not guarenteed to keep the I/O after a rest. Se this answer from Atmel in the newsgroup:https://www.avrfreaks.net/phorum/...

If you want to save current, be aware that a ceramic oscillator is consuming (slightly?) less current than an oscillator. But if you must have very exact time that may not be an option for you. Also, 2343 and internal oscilator will be smaller than 1200 in ssop and external crystall. THe best way to save current depends of how much is consumed of other circuits at the short times during the wake ups. The most important method to reduce the current in the CPU is to run it at an resonable low speed. It depends of your application if it is better to make a fast execution and go fast to sleep again.

The watch-dog timer speed is depending of the supply voltage and it will be very big differences in current during sleep if you run the CPU in lowest possible voltage because the oscillator during sleep will be slower. But if you have any other thing that can wake up the CPU, use it. Current consumtion during Power Down with watch dog disabled is just tens of nano amps.

I use the Imagecraft C compiler.

/Bengt Ragnemalm

My favorites:
1. My oscilloscope, Yokogawa DLM2024.
2. My soldering iron, Weller WD2M, WMRP+WMRT.
3. JTAGICE3 debugger.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi!

Just one comment: It's true that the AT90S1200 doesn't keep its memory contents after a WD Reset, but you could make detection of the type of reset available with code. Writing a signature to EEPROM prior to sleep, and then reading this memory location in your RESET code, would enable you to identify a WD reset.

Just in case you had a '1200 and wanted to continue using it...

Any other suggestions?

Best regards,

Morten, AVR tech. support, Atmel FAE

admin's test signature