[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] wdt problem with mega 88
From: |
Joerg Wunsch |
Subject: |
Re: [avr-libc-dev] wdt problem with mega 88 |
Date: |
Wed, 22 Jun 2005 22:48:01 +0200 |
User-agent: |
Mutt/1.4.2.1i |
As address@hidden wrote:
> I would expect this program to wait for a time and then turn on an
> led indefinately.
I don't have an ATmega88 around to test against, only an ATmega8.
I've inverted the logic for the LED (as the STK500 uses low-active
LEDs) and tried it on an ATmega8 in the STK500. All works well there.
Oh, I just remembered I've also got an ATmega48 lying in a box. Tried
it as well, works likewise.
I first tried to use the binary of the ATmega8 on the '48, that didn't
work. Well, after all, the call/return would not work there due to
the smaller memory size (stack is initialized to the wrong value).
That reminds me: your linker settings are verified to be correct, are
they? Omitting the -mmcu option from the linker command-line is a
common mistake it seems.
Btw., don't roll your own delay functions, GCC's optimizations
occasionally yield unexpected results. Better use one of those
supplied in <avr/delay.h>.
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)