Watchdog

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

I get the following error when using the watchdog functions. It worked okay with the newer version of winavr, but when I reverted back to an older version, problems.

void initialize(void)
{
//Clear Interrupts
cli();

//Disable JTAG
MCUCR = 0x80;
MCUCR = 0x80;

//Configure Watchdog
wdt_reset();
572 wdt_disable();
573 wdt_enable(WDTO_2S);

sensor.c: In function `initialize':
sensor.c:572: warning: asm operand 0 probably doesn't match constraints
sensor.c:573: warning: asm operand 0 probably doesn't match constraints
sensor.c:572: error: impossible constraint in `asm'
sensor.c:573: error: impossible constraint in `asm'
make: *** [sensor.o] Error 1
Build failed with 2 errors and 2 warnings...

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

Checking the header "avr/wdt.h" looks like your reference to watchdog control register (WDTCSR or WDTCR) isn't right.

However, you should at least mention the compiler version and the AVR part you're compiling for; otherwise could be hard guessing why is such.

Only (blind) advice: check #include directives and any re-definition.

~ Lou

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

Did you remember to include "avr/wdt.h"