Slave transmitter mode, Atmega32(l) – Rainbow Electronics ATmega32L User Manual

Page 190

Advertising
background image

190

ATmega32(L)

2503C–AVR–10/02

Figure 91. Formats and States in the Slave Receiver Mode

Slave Transmitter Mode

In the Slave Transmitter mode, a number of data bytes are transmitted to a master
receiver (see Figure 92). All the status codes mentioned in this section assume that the
prescaler bits are zero or are masked to zero.

Figure 92. Data Transfer in Slave Transmitter Mode

To initiate the Slave Transmitter mode, TWAR and TWCR must be initialized as follows:

S

SLA

W

A

DATA

A

$60

$80

$88

A

$68

Reception of the own
slave address and one or
more data bytes. All are
acknowledged

Last data byte received
is not acknowledged

Arbitration lost as master
and addressed as slave

Reception of the general call
address and one or more data
bytes

Last data byte received is
not acknowledged

n

From master to slave

From slave to master

Any number of data bytes
and their associated acknowledge bits

This number (contained in TWSR) corresponds
to a defined state of the Two-wire Serial Bus. The
prescaler bits are zero or masked to zero

P or S

DATA

A

$80

$A0

P or S

A

A

DATA

A

$70

$90

$98

A

$78

P or S

DATA

A

$90

$A0

P or S

A

General Call

Arbitration lost as master and
addressed as slave by general call

DATA

A

TWAR

TWA6

TWA5

TWA4

TWA3

TWA2

TWA1

TWA0

TWGCE

Value

Device’s Own Slave Address

Device 3

Device n

SDA

SCL

........

R1

R2

V

CC

Device 2

MASTER

RECEIVER

Device 1

SLAVE

TRANSMITTER

Advertising