[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] AtMega128 and Timers
From: |
Andreas Mahr |
Subject: |
Re: [avr-gcc-list] AtMega128 and Timers |
Date: |
Sat, 15 Jun 2002 14:59:33 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020313 |
Hi All!
I found the Problem.
It is the Linker script! If You use the AtMega128 in Mega103
compatibility Mode everithing works fine. But if you change the Fuse
bits to pure Mega128 the RAM starts not at 0x60 like the other devices,
the new start is 0x100.
This has to be corrected in the avr5.x* Linker Scripts:
/* Default linker script, for normal executables */
OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr")
OUTPUT_ARCH(avr:5)
MEMORY
{
text (rx) : ORIGIN = 0, LENGTH = 128K
data (rw!x) : ORIGIN = 0x800100, LENGTH = 0xffa0
eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = 64K
}
and now it works. I have done the change in my Linker Scripts for
avr5 but I'm not sure if this always works. If not, there might be use
for a atmega128.x script?? But this is for the Experts.
Andi
Some time ago I wrote a set of functions for millisecond, so far on all
Devices I tested it, it worked.
But now it dose not work any more and I can't see why. Here is a little
Code:
volatile uint_32 milliseconds;
volatile uint_32 tick;
SIGNAL(SIG_OVERFLOW0)
{
TCNT0 = RELOAD_VAL_TIMER0;
milliseconds++;
}
avr-gcc-list at http://avr1.org