
III PERIPHERAL BLOCK: SINGLE MASTER I2C-BUS
S1C33T01 FUNCTION PART
EPSON
B-III-9-5
I/O pin setup
The single-master I
2 C-bus uses two pins: SDAx and SCLx. Set CFP7x[1:0] (D[1:0]) in the P7 function select
register (0x4030A) according to the pins used. (Note that both channels can be used at the same time.)
The SDAx and SCLx pins are set either to low/high-impedance output or to low/high output (for noise
suppression) by the SDAPx and SCLPx bits in the single-master I
2 C-bus I/O select register.
Input clock setup
The single-master I
2 C-bus includes prescalers both for noise filter clock (NCLKx) generation and for SCLx
clock generation. The divisors provided by these prescalers are set by the registers listed in Table 9.2.
Table 9.2
Noise Filter Clock (NCLKx) Divisor Register and SCLx Clock Divisor Register
Channel
Bit
Register
Ch. 0
NIS_P0[3:0]
(D[3:0]) / Single-master I
2C-bus Ch. 0 noise filter clock NCLK0 divisor register (0x40326)
Ch. 1
NIS_P1[3:0]
(D[3:0]) / Single-master I
2C-bus Ch. 1 noise filter clock NCLK1 divisor register (0x40326)
Ch. 0
SCL_P0[2:0]
(D[2:0]) / Single-master I
2C-bus Ch. 0 I2C-bus clock (SCL0) divisor register (0x40327)
Ch. 1
SCL_P1[2:0]
(D[2:0]) / Single-master I
2C-bus Ch. 1 I2C-bus clock (SCL1) divisor register (0x40327)
The frequency of the noise filter clock NCLKx is expressed as follows.
f
NCLKx =fPSCIN /(4×NIS_Px[3:0]) [Hz]
(f
NCLKx =fPSCIN /2 when NIS_Px=0)
f
PSCIN : The prescaler input clock frequency (Hz)
The frequency of SCLx is expressed as follows.
f
SCLx=fNCLKx /(2
n
×4)=f
PSCIN /((4×NIS_Px[3:0])×(2
n
×4)) [Hz]
(f
SCLx=fPSCIN /(2×(2
n
×4)) when SCL_Px=0)
n=SCL_Px[2:0]
See the "Programming Notes" item for detailed information.
DMA transfer mode settings
Either (1) dual address transfers using HSDMA (with EOP), (2) dual address transfers using DMA (no EOP), or (3)
CPU transfer can be selected by setting the single-master I
2 C-bus DMA mode register. However, the only DMA
transfer mode that can be used is single transfer mode, which transfers one byte for each transfer request. The read
DMA request interrupt factor and the write DMA request interrupt factor are used as the start events. Note that when
IDMA transfers are used the single-master I
2 C-bus internal IDMA byte counter is used. This allows the stipulated
number of bytes to be sent or received without incurring CPU overhead.
I
2C-Bus Control and Operation
Transfer commands
Transmit/receive operations are executed by writing transfer commands to the TRNSx[2:0] bits in the control
register.
Ch. 0 operation commands: TRNS0[2:0] (D[2:0]) / Single-master I
2 C-bus Ch. 0 control register (0x40322)
Ch. 1 operation commands: TRNS1[2:0] (D[2:0]) / Single-master I
2 C-bus Ch. 1 control register (0x40332)
Table 9.3
Transfer Commands
TRNSx[2:0]
Operation
001
Generate start condition
010
Generate stop condition
011
Receive data
100
Transfer data
101
Dummy DMA send mode
110
Dummy DMA receive mode
Any other value
Clear the error status register error flags.