XI - 39
Chapter 11 Serial Interface 0, 1
Operation
11-3-4 Setup Example
Transmission / Reception Setup Example
The setup example for clock synchronous serial communication with serial 0 is shown. Table 11-3-16
shows the conditions at transmission / reception.
Table 11-3-16 Setup Examples for Synchronous Serial Interface Transmission / Reception
Setup Procedure Description
(1) Select the prescaler operation.
PSCMD (x'3F6F')
bp0 : PSCEN = 1
(2) Select the clock source.
SC0CKS (x'3F97')
bp2-0 : SC0PSC2-0 = 100
(3) Select the used pin.
SC0ODC (x'3F96')
bp7 : SC0SEL = 0
(4) Control the pin type.
SC0ODC (x'3F96')
bp1-0 : SC0ODC1-0 = 11
P0PLU (x'3F40')
bp5, 3 : P0PLU5, 3 = 1, 1
(5) Control the pin direction.
P0DIR (x'3F30')
bp5-3 : P0DIR5-3 = 101
(1) Set the PSCEN flag of the PSCMD register to
"1" to select "prescaler operation".
(2) Select the clcok source by the SC0CKS
register.
Set bp4-0 to "0100" to select "fs/2".
(2) Set the SC0SEL flag of the SC0ODC register to
"0" to set I/O used pin to A (port 0).
(4) Set the SC0ODC1-0 flag of the SC0ODC
register to "11" to select "N-ch open drain" to
the SBO/SBT pin. Set the P0PLU5, 3 flag of
the P0PLU register to "1" to add pull-up
resistor.
5) Set the P0DIR5-3 flag of the port 0 pin
direction control register (P0DIR) to "101" to set
P03, P05 "output mode", and to set P04 "input
mode".
An example setup procedure, with a description of each step is shown below.
Setup item set to Setup item set to
SBI / SBO pin Independent Clock source fs/2
(with 3 channels)
Transfer bit count 8 bits Used pin A (port 0)
Start condition none Clock source 1/8 dividing divided by 8
First transfer bit MSB SBT / SBO pin style Nch open-drain
Input clock edge falling edge SBT pin pull-up resistor Added
Output clock edge rising edge SBO pin pull-up resistor Added
Clock Internal clock Serial 1 communication Enable
complete interrupt