Panasonic MN103001G/F01K User Manual page 322

Panax series microcomputer
Table of Contents

Advertisement

Serial Interface
I2C mode transmission/reception
The transmission/reception procedure in I2C mode is described below.
(Refer to Fig. 13-2-15.)
• Make the initial settings as described below.
(1) I/O port setting
Set the SBT and SBO pins as general-purpose input ports.
For details on the settings, refer to the chapter on I/O ports.
(2) Transmission/reception mode setting (SC0CTR register)
Be certain to set the flags listed below to the specified values.
SBT0 pin output control flag (SC0TOE):
Protocol selection flags (SC0MD1,0):
I2C mode selection flag (SC0IIC):
Break transmission flag (SC0BKE):
Reception operation enable flag (SC0RXE):
Transmission operation enable flag (SC0TXE): 0
Flags other than those listed above may be set as desired.
However, the clock source must be selected from among the following four:
1/8 IOCLK
1/32 IOCLK
1/8 timer 3 underflow
1/8 timer 9 underflow
Set the parity bits each transmission/reception.
(3) I/O port setting
Set the I/O ports to SBT and SBO .
Leave the I/O port input/output control registers set to "input".
(4) Interrupt mode register setting (SC0ICR register)
Set the interrupt sources as "transmission end".
(5) Transmission/reception enable
Enable both transmission and reception operations.
• Send the start sequence (A) according to the procedure described below:
(1) Sending start sequence
When the I2C mode selection flag (SC0IIC) is changed from "0" to "1", a low signal is output on the SBO pin
as the start sequence.
(2) Confirmation of sending start sequence
If the start sequence was generated normally, the I2C start sequence detection flag (SC0STF) changes to "1".
In this case, even if there are simultaneous starts, "arbitration lost" is not detected.
13-20
0
10 (I2C mode)
0
0
0

Advertisement

Table of Contents
loading

Table of Contents