User manual

...the world's most energy friendly microcontrollers
2012-04-24 - Giant Gecko Family - d0053_Rev0.96 416
www.energymicro.com
after the current, it can start a new transfer directly by transmitting a repeated START condition (Sr)
instead of a STOP followed by a START.
Examples of I
2
C transfers are shown in Figure 16.5 (p. 416) , Figure 16.6 (p. 416) , and Figure 16.7 (p.
416) . The identifiers used are:
ADDR - Address
DATA - Data
S - Start bit
Sr - Repeated start bit
P - Stop bit
W/R - Read(1)/Write(0)
A - ACK
N - NACK
Figure 16.5. I
2
C Single Byte Write to Slave
WS ADDR DATA AA P
Figure 16.6. I
2
C Double Byte Read from Slave
RS ADDR DATAA DATA NA P
Figure 16.7. I
2
C Single Byte Write, then Repeated Start and Single Byte Read
RSr ADDR DATAA N PWS ADDR DATAA A
16.3.1.3 Addresses
I
2
C supports both 7-bit and 10-bit addresses. When using 7-bit addresses, the first byte transmitted after
the START-condition contains the address of the slave the master wants to contact. In the 7-bit address
space, several addresses are reserved. These addresses are summarized in Table 16.1 (p. 416) , and
include a General Call address which can be used to broadcast a message to all slaves on the I
2
C-bus.
Table 16.1. I
2
C Reserved I
2
C Addresses
I
2
C Address R/W Description
0000-000 0 General Call address
0000-000 1 START byte
0000-001 X Reserved for the C-Bus format
0000-010 X Reserved for a different bus format
0000-011 X Reserved for future purposes
0000-1XX X Reserved for future purposes
1111-1XX X Reserved for future purposes
1111-0XX X 10 Bit slave addressing mode
16.3.1.4 10-bit Addressing
To address a slave using a 10-bit address, two bytes are required to specify the address instead of
one. The seven first bits of the first byte must then be 1111 0XX, where XX are the two most significant
bits of the 10-bit address. As with 7-bit addresses, the eight bit of the first byte determines whether the
master wishes to read from or write to the slave. The second byte contains the eight least significant
bits of the slave address.