avr-gcc-list
[Top][All Lists]
Advanced

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

[avr-gcc-list] Problem with TWI and ATmega128


From: Geoffrey Wossum
Subject: [avr-gcc-list] Problem with TWI and ATmega128
Date: Wed, 23 Jan 2002 19:40:13 -0600 (CST)

Hi all,

I'm having problems compiling code to use the hardware TWI unit on the
ATmega128.  I'm using gcc 3.0.2 and binutils-2.11.2 patched for the
ATmega128, along with avr-libc-20020115.

If I try to compile the following piece of code:

---begin---
#include <io.h>
#include <twi.h>

void i2c_start(void)
{
    outp(BV(TWINT) | BV(TWSTA) | BV(TWEN), TWCR);
}
---end---

using 'avr-gcc -mmcu=atmega128 -O2 -c test.c', I get the following errors:

---begin---
test.c: In function `i2c_start':
test.c:6: warning: asm operand 0 probably doesn't match constraints
test.c:6: warning: asm operand 1 probably doesn't match constraints
test.c:6: inconsistent operand constraints in an `asm'
---end---

Why isn't this working?  Some simple blink some LED's code works, so the
tool chain is at least seemingly functional.

TIA,

---
Geoffrey Wossum
Project AKO - http://ako.sf.net

avr-gcc-list at http://avr1.org



reply via email to

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