20 I
2
C
20-6
EPSON
S1C17704 TECHNICAL MANUAL
Slave address
7-bit address
Transfer direction
0: master
→
slave (transmission)
1: slave
→
master (reception)
A6
A5
D7
D6
A4
D5
A3
D4
A2
D3
A1
D2
A0
D1
DIR
D0
8 low order slave address bits
A7
A6
D7
D6
A5
D5
A4
D4
A3
D3
A2
D2
A1
D1
A0
D0
2 high order
slave address bits
10-bit address
Transfer direction
0: master
→
slave (transmission)
1: slave
→
master (reception)
1
First transmit data
Second transmit data
1
D7
D6
1
D5
1
D4
0
D3
A9
D2
A8
D1
DIR
D0
Figure 20.5.2 Transmit Data to Specify Slave Address and Data Direction
The transfer direction bit specifies the direction for the data transfer that follows the slave address transfer. Set
the transfer direction bit to 0 when transmitting data from the master to the slave; set it to 1 when receiving data
from the slave.
Configure an 8-bit data as above and set it into the transmit/receive data register. After that control data
transmission as described below.
The slave address with a transfer direction bit must be sent once after a START condition has been generated.
After a slave address has been sent, perform data transmission or data reception as many times as necessary. It
is necessary to perform data transmission or data reception according to the transfer direction specified with the
slave address.
Data transmit control
The following explains how to transmit data. The slave address should be sent in the same way.
To transmit byte data, set the data to the RTDT[7:0] bits (D[7:0]/I2C_DAT register). At the same time, set the
TXE bit (D9/I2C_DAT register) to 1 to execute one byte data transmission.
∗
RTDT[7:0]
: Receive/Transmit Data Bits in the I
2
C Data (I2C_DAT) Register (D[7:0]/0x4344)
∗
TXE
: Transmit Execution Bit in the I
2
C Data (I2C_DAT) Register (D9/0x4344)
When the TXE bit is set to 1, the I
2
C module starts data transmission in sync with the clock. If a START
condition is being generated or the previous data is being transferred, the I
2
C module starts data transmission
after waiting for completion of the process.
First, the I
2
C module transfer the written data to the shift register and starts outputting the clock from the SCL
pin. At this time, TXE is reset to 0 and a cause of interrupt occurs. This allows the program to set the next
transmit data and TXE again.
The data bits in the shift register are shifted one by one at the falling edge of the clock and are output from the
SDA pin. The MSB is transmitted first.
The
I
2
C module outputs nine clocks for one data transmission. In the ninth clock cycle, the I
2
C module sets the
SDA signal into high-impedance status to input an ACK or NACK bit from the slave.
If the slave could receive byte data, it returns an ACK (0) bit to the master. If the slave could not receive byte
data, the SDA line is not pulled down. The I
2
C module regards this status as a NACK (1) returned (transmission
fails).
SDA (output)
SDA (input)
SCL (output)
START condition
1
2
8
9
D7
D6
D0
ACK
NACK
Figure 20.5.3 ACK and NACK
Summary of Contents for S1C17704
Page 1: ...TECHNICAL MANUAL S1C17704 CMOS 16 BIT SINGLE CHIP MICROCOMPUTER ...
Page 22: ...1 OVERVIEW 1 10 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 42: ...3 MEMORY MAP BUS CONTROL 3 12 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 82: ...6 INTERRUPT CONTROLLER ITC 6 26 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 108: ...8 CLOCK GENERATOR CLG 8 8 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 112: ...9 PRESCALER PSC 9 4 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 138: ...10 I O PORTS P 10 26 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 156: ...11 16 BIT TIMERS T16 11 18 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 208: ...14 8 BIT OSC1 TIMER T8OSC1 14 16 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 234: ...16 STOPWATCH TIMER SWT 16 14 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 242: ...17 WATCHDOG TIMER WDT 17 8 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 264: ...18 UART 18 22 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 300: ...20 I2C 20 20 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 320: ...21 REMOTE CONTROLLER REMC 21 20 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 360: ...24 ON CHIP DEBUGGER DBG 24 6 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 362: ...25 BASIC EXTERNAL WIRING DIAGRAM 25 2 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...