Microchip Technology megaAVR 0 Series Manual page 359

Hide thumbs Also See for megaAVR 0 Series:
Table of Contents

Advertisement

24.5.8
Master Address
Name: 
MADDR
Offset: 
0x07
Reset: 
0x00
Property:  -
Bit
7
Access
R/W
Reset
0
Bits 7:0 – ADDR[7:0] Address
When this bit field is written, a Start condition and slave address protocol sequence is initiated dependent
on the bus state.
If the bus state is unknown the Master Write Interrupt Flag (WIF) and Bus Error flag (BUSERR) in the
Master Status register (TWIn.MSTATUS) are set and the operation is terminated.
If the bus is busy the master awaits further operation until the bus becomes idle. When the bus is or
becomes idle, the master generates a Start condition on the bus, copies the ADDR value into the Data
Shift register (TWIn.MDATA) and performs a byte transmit operation by sending the contents of the Data
register onto the bus. The master then receives the response (i.e., the Acknowledge bit from the slave).
After completing the operation the bus clock (SCL) is forced and held low only if arbitration was not lost.
The CLKHOLD bit in the Master Setup register (TWIn.MSETUP) is set accordingly. Completing the
operation sets the WIF in the Master Status register (TWIn.MSTATUS).
If the bus is already owned, a repeated Start (Sr) sequence is performed. In two ways the repeated Start
(Sr) sequence deviates from the Start sequence. Firstly, since the bus is already owned by the master, no
wait for idle bus state is necessary. Secondly, if the previous transaction was a read, the acknowledge
action is sent before the Repeated Start bus condition is issued on the bus.
The master receives one data byte from the slave before the master sets the Master Read Interrupt Flag
(RIF) in the Master Status register (TWIn.MSTATUS). All TWI Master flags are cleared automatically
when this bit field is written. This includes bus error, arbitration lost, and both master interrupt flags.
This register can be read at any time without interfering with ongoing bus activity, since a read access
does not trigger the master logic to perform any bus protocol related operations.
The master control logic uses bit 0 of the TWIn.MADDR register as the bus protocol's Read/Write flag
(R/W).
©
2018 Microchip Technology Inc.
6
5
R/W
R/W
0
0
4
3
ADDR[7:0]
R/W
R/W
0
0
Datasheet Preliminary
®
megaAVR
0-Series
Two-Wire Interface (TWI)
2
1
R/W
R/W
0
0
DS40002015A-page 359
0
R/W
0

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the megaAVR 0 Series and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Atmega4808Atmega4809Atmega3208Atmega3209

Table of Contents