cbi(UCSR1B,UDRIE);

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why doesnt this work (mega128 | gcc version 3.0.4) :
sbi(UCSR1B,UDRIE);

sbi(UCSR0B,UDRIE); works fine.

I'm getting the folowing error:
serial.c: In function `_vector_32':
serial.c:40: warning: asm operand 0 probably doesn't match constraints
serial.c:40: warning: asm operand 0 probably doesn't match constraints
serial.c:40: inconsistent operand constraints in an `asm'

Eivind

*** Eivind, webmaster ***

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Because UCSR1B is in the extended IO space.

IMO better is:
UCSR1B |= _BV(UDRIE);
UCSR0B |= _BV(UDRIE);

Using above syntax you can forget about IO space limitations and divisions. I think that two more instructions (but only a clock tick more) is not a big problem.

Reagrds,

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ahh, thanks. I havent read the datasheet for some time :)

Regards,
Eivind

*** Eivind, webmaster ***

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Also gcc 3.0.4 is getting pretty old. Update your tools.

Eric