[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Problem with atmega162 timer interrupt

From: Joerg Wunsch
Subject: Re: [avr-gcc-list] Problem with atmega162 timer interrupt
Date: Wed, 15 Aug 2007 22:19:43 +0200 (MET DST)

"Henko Gouws" <address@hidden> wrote:

> If I understand correctly: There seems to be a difference in the
> interrupt vectors of the atmega162 and the 90s8515 - the 90s8515
> interrupt vectors are short vectors of 8bit each and the atmega162
> vectors are 16 bit vectors.  Could this be the reason?

No, that's automatically handled by the library.

I don't have any much ideas about it.  Can you post your test program?

Random remarks about the linker line you posted:

> -minit-stack=0x7FFF

Drop that one.  It might not have an affect at all anymore (yes, we
need to update the docs), the only way to modify the stack
initialization in future will be to change the value of __stack (at
link time).  Also, locating the stack in external memory is a bad
idea.  External memory requires longer access times, and having the
stack in external RAM was known to be broken at least for some AVRs in
the past.  I don't see it listed as errata in the ATmega162 datasheet,
but I personally just wouldn't trust it. ;-)

> -Xlinker --defsym -Xlinker __init_wdtcr__=0x00
> -Xlinker --defsym -Xlinker __init_mcucr__=0x80

These are no-ops, and have been for many years.  The correct way to
modify the startup behavior is to provide your own init functions,
preferrably located in section .init3.  See the avr-libc documentation
about memory sections.

> -Wl,-Tdata=0x801000

Change that to -Wl,--section-start=.data=0x801000.

> -Xlinker --defsym -Xlinker __stack=0x7fff

OK, that obviates the -minit-stack option anyway, but the remarks
about the stack in external RAM remains.

> obj/toggleNew2.o: In function ...:

What exactly came here?  Seems to me you didn't tell us about your
compilation or linker warnings.

cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]