[Top][All Lists]

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

[avr-libc-dev] New example: TWI

From: Joerg Wunsch
Subject: [avr-libc-dev] New example: TWI
Date: Wed, 18 Dec 2002 23:44:49 +0100
User-agent: Mutt/1.2.5i

Hi *,

after experimenting a bit to learn how to use the TWI interface,
playing around with a 24C04 EEPROM that happened to lay around in
a drawer, i decided to publish the result as yet another example.
In contrast to say, an LM75 temperature sensor, talking to an
EEPROM seemed to be a better example to me (even though the
additional EEPROM space is certainly not needed ;-) since it
involves both, read and write operations including an operation
that uses a repeated start condition in order to switch the data
transfer direction without losing bus arbitration.

I'm now also convinced that <avr/twi.h> should stay :), the file
is useful, the contents is basically a reproduction of an
assembler definition file that is present in the datasheet of the
ATmega163, except that Marek prepended TW_ before each symbol.
I've already added a few other macros that are useful for the newer
ATmegas since the status register is now also used for clock
prescaler option bits that must be masked off before extracting the
actual TWI status.  I'll also document that file RSN.
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/

reply via email to

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