![](http://datasheet.mmic.net.cn/30000/MN101CF54DBF_datasheet_2374941/MN101CF54DBF_381.png)
XI - 27
Chapter 11
Serial Interface 0
Operation
11-3-2
Setup Example
nTransmission / Reception Setup Example
The setup example for clock synchronous serial communication with serial 0 is shown. Table 11-3-11
shows the conditions at transmission / reception.
Table 11-3-11
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
bp3
: SC0TMSEL= 0
(3)
Control the pin type.
SC0ODC (x'3F96')
bp1-0
: SC0ODC1-0= 11
P0PLUD (x'3F40')
bp2, 0
: P0PLUD2, 0= 1, 1
(4)
Control the pin direction.
P0DIR (x'3F30')
bp2-0
: P0DIR2-0 = 101
(5)
Set the SC0MD0 register.
Select the transfer bit count.
SC0MD0 (x'3F90')
bp2-0
: SC0LNG2-0= 111
(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 bp3-0 to "0100" to select "fs/2".
(3)
Set the SC0ODC1-0 flag of the SC0ODC
register to "11" to select "N-ch open drain" to
the SBO/SBT pin. Set the P0PLUD2, 0 flag of
the P0PLUD register to "1, 1" to add pull-up/
pull-down resistor.
(4)
Set the P0DIR2-0 flag of the port 0 pindirection
control register (P0DIR) to "101" to set P00, P02
"output mode", and to set P01 "input
mode".
(5)
Set the SC0LNG2-0 flag of the serial 0 mode
register (SC0MD0) to "111" to set the transfer
bit count "8 bits".
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
(with 3 channels)
Clock source
fs/2
Transfer bit count
8 bits
Clock source 1/8 dividing
divided by 8
Start condition
none
SBT / SBO pin style
Nch open-drain
First transfer bit
MSB
SBT pin pull-up resistor
Added
Input edge
falling edge
SBO pin pull-up resistor
Added
Output edge
rising edge
Serial 0 communication
complete interrupt
Enable
Clock
Internal clock