avr-chat
[Top][All Lists]
Advanced

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

[avr-chat] SFRs in assembly code


From: Daniel Otte
Subject: [avr-chat] SFRs in assembly code
Date: 22 Jul 2009 16:10:19 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.1.21) Gecko/20090331 Thunderbird/2.0.0.21 Mnenhy/0.7.6.666

Hi all,
I'm having problems assembling the following code:
[...]
19    #include "config.h"
20    #include <avr/io.h>
21
22    .global uart0_init
23    uart0_init:
24    #define BAUD UART0_BAUD_RATE
25    #include <util/setbaud.h>         
26      ldi r24, UBRRH_VALUE
27    #if _SFR_IO_REG_P(UBRRH0)
28      out _SFR_IO_ADDR(UBRRH0), r24
29    #else
30      sts _SFR_MEM_ADDR(UBRRH0), r24
31    #endif
[...]

The Errors I get are:
avr-gcc -mmcu=atmega644   -c -o uart_ni-asm.o uart_ni-asm.S
uart_ni-asm.S: Assembler messages:
uart_ni-asm.S:28: Error: constant value required
uart_ni-asm.S:28: Error: number must be positive and less than 64

I've read http://www.nongnu.org/avr-libc/user-manual/group__avr__sfr__notes.html
but it seems to not offer a solution.

Thanks for your help in advance,
  Daniel

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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