w avr-gcc mniej więcej tak (jak podaje autor programu): avr-gcc -mmcu=at90s2313 -x assembler-with-cpp minidds.asm
i otrzymuję: minidds.asm:169: Error: number must be less than 64
w <avr/io2313.h> jest RAMEND zadeklarowany jako 0xdf, a najwyraźniej o tę linijkę mu chodzi. W pliku zamieniłem includa na <avr/io.h>.
Piszę przeważnie tylko w C, a tu nie za bardzo wiem czego się czepić ;-(
Didn't find your answer? Ask the community — no account required.
Z
Zbych
K.L Piecuch przemówił ludzkim głosem:
Może mój edytor jakoś inaczej liczy linie, ale błąd jest chyba w tej linii: out SPL, r16 ; setup stack pointer
więc zacznij od sprawdzenia, czy definicje rejestrów w pliku *.h nie są przesunięte o 20h, i czy nie powinieneś użyć makra _SFR_IO_ADDR do konwersji pomiędzy adresami SFR, a adresami mapowanymi na RAM.
K
K.L Piecuch
Dnia 28.12.2006 Zbych snipped-for-privacy@onet.pl napisał/a:
Mój tak samo liczy ;-), ale stwierdziłem, że skoro linijkę wcześniej jest ładowana wartość do r16 to pewnie o nią chodzi.
W <avr/io.h> jest #define SPL _SFR_IO8(0x3D)
i to się zgadza z dokumentacją.
Z
Zbych
K.L Piecuch przemówił ludzkim głosem:
A sprawdziłeś jak jest zdefiniowane makro _SFR_IO8 ? W sfr_defs.h masz coś takiego:
Więc jeśli __SFR_OFFSET jest równe 20h, to adres SPL wyjdzie poza zakres I/O. Przejrzyj dokładnie sfr_defs.h tam masz wszystko opisane.
If _SFR_ASM_COMPAT is not defined, C programs can use names like PORTA directly in C expressions (also on the left side of assignment perators) and GCC will do the right thing (use short I/O instructions if possible). The __SFR_OFFSET definition is not used in any way in this case. Define _SFR_ASM_COMPAT as 1 to make these names work as simple constants (addresses of the I/O registers). This is necessary when included in preprocessed assembler (*.S) source files, so it is done automatically if __ASSEMBLER__ is defined. By default, all addresses are defined as if they were memory addresses (used in lds/sts instructions). To use these addresses in in/out instructions, you must subtract 0x20 from them.
K
K.L Piecuch
Dnia 28.12.2006 Zbych snipped-for-privacy@onet.pl napisał/a:
Dziękuję. Pomogło.
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.