beautypg.com

2 master receiver mode, Table 25-3 on, Table – Rainbow Electronics ATmega128RFA1 User Manual

Page 390: 3 on, Atmega128rfa1

background image

390



8266A-MCU Wireless-12/09

ATmega128RFA1

Table 25-3. Status codes for Master Transmitter Mode

Application Software Response

To TWCR

Status Code

(TWSR)

Prescaler
Bits are 0

Status of the 2-wire

Serial Bus and 2-wire

Serial Interface

Hardware

To/from TWDR

STA

STO

TWINT

TWEA

Next Action Taken by TWI
Hardware

0x08

A START condition has
been transmitted

Load SLA+W

0

0

1

X

SLA+W will be transmitted; ACK or
NOT ACK will be received

0x10

A repeated START
condition has been
transmitted

Load SLA+W or

Load SLA+R

0

0

0

0

1

1

X

X

SLA+W will be transmitted; ACK or
NOT ACK will be received
SLA+R will be transmitted; Logic will
switch to Master Receiver mode

0x18

SLA+W has been
transmitted; ACK has
been received

Load data byte o

No TWDR action or

No TWDR action or

No TWDR action

0

1

0

1

0

0

1

1

1

1

1

1

X

X

X

X

Data byte will be transmitted and
ACK or NOT ACK will be received
Repeated START will be transmitted

STOP condition will be transmitted
and TWSTO Flag will be reset
STOP condition followed by a START
condition will be transmitted and
TWSTO Flag will be reset

0x20

SLA+W has been
transmitted; NOT ACK
has been received

Load data byte or

No TWDR action or

No TWDR action or

No TWDR action

0

1

0

1

0

0

1

1

1

1

1

1

X

X

X

X

Data byte will be transmitted and
ACK or NOT ACK will be received
Repeated START will be transmitted

STOP condition will be transmitted
and TWSTO Flag will be rese
STOP condition followed by a START
condition will be transmitted and
TWSTO Flag will be reset

0x28

Data byte has been
transmitted; ACK has
been received

Load data byte or

No TWDR action or

No TWDR action or

No TWDR action

0

1

0

1

0

0

1

1

1

1

1

1

X

X

X

X

Data byte will be transmitted and
ACK or NOT ACK will be received
Repeated START will be transmitted

STOP condition will be transmitted
and TWSTO Flag will be reset
STOP condition followed by a START
condition will be transmitted and
TWSTO Flag will be reset

0x30

Data byte has been
transmitted; NOT ACK
has been received

Load data byte or

No TWDR action or

No TWDR action or

No TWDR action

0

1

0

1

0

0

1

1

1

1

1

1

X

X

X

X

Data byte will be transmitted and
ACK or NOT ACK will be received
Repeated START will be transmitted

STOP condition will be transmitted
and TWSTO Flag will be reset
STOP condition followed by a START
condition will be transmitted and
TWSTO Flag will be reset

0x38

Arbitration lost in SLA+W
or data bytes

No TWDR action or

No TWDR action

0

1

0

0

1

1

X

X

2-wire Serial Bus will be released and
not addressed Slave mode entered
A START condition will be
transmitted when the bus be-comes
free

25.7.2 Master Receiver Mode

In the Master Receiver mode, a number of data bytes are received from a Slave
Transmitter (for Slave see

Figure 25-13 on

page 391). In order to enter a Master mode,

a START condition must be transmitted. The format of the following address packet
determines whether Master Transmitter or Master Receiver mode is to be entered. If
SLA+W is transmitted, MT mode is entered, if SLA+R is transmitted, MR mode is
entered. All the status codes mentioned in this section assume that the prescaler bits
are zero or are masked to zero.