Chapter 12
Serial Interface 2
Operation
XII - 25
Setup Procedure
Description
Note : In the above (5) to (8), each settings can be set at the same time.
(6)
Set the SC2STE flag of the SC2MD0 register to "1"
to enable start condition.
(7)
Set the SC2DIR flag of the SC2MD0 register to "0"
to set MSB as the first transfer bit.
(8)
Set the SC2CE1 flag of the SC2MD0 register to "1"
to set the transmission data output edge to "rising",
and the received data input edge to "falling".
(9)
Set the SC2MST flag of the SC2MD1 register to
"1" to select clock master (internal clock).
(10) Set the SC2SBOS, SC2SBIS, SC2SBTS flags of
the SC2MD1 register to "1" to set the SBO2 pin to
serial data output, the SBI2 pin to serial data
input, and the SBT2 pin to serial clock I/O. Set the
SC2IOM flag to "0" to set "serial data input from
the SBI2 pin".
(11) Set the interrupt level by the SCLV1-0 flag of the
serial 2 interrupt control register (SC2ICR).
(12) Enable the interrupt to the SC2IE flag of the
SC2ICR register. If the interrupt request flag
(SC2IR of the SC2ICR register) is already set,
clear SC2IR before the interrupt is enabled.
(13) Set the transmission data to the serial
transmission/receiption shift register SC2TRB.
The internal clock is generated to start
transmisqsion/ reception. After the communication
is finished, the serial 2 interrupt SC2IRQ is gener
ated.
(6)
Select the start condition.
SC2MD0 (x'3FA0')
bp3
: SC2STE
= 1
(7)
Select the first bit to be transferred.
SC2MD0 (x'3FA0')
bp4
: SC2DIR
= 0
(8)
Select the transfer edge.
SC2MD0 (x'3FA0')
bp6
: SC2CE1
= 1
(9)
Select the transfer clock.
SC2MD1 (x'3FA1')
bp2
: SC2MST
= 1
(10) Control the pin function.
SC2MD1 (x'3FA1')
bp4
: SC2SBOS = 1
bp5
: SC2SBIS = 1
bp6
: SC2SBTS = 1
bp7
: SC2IOM
= 0
(11) Set the interrupt level.
SC2ICR (x'3FF8')
bp7-6
: SC2LV1-0 = 10
(12) Enable the interrupt.
SC2ICR (x'3FF8')
bp1
: SC2IE
= 1
(13) Start serial transmission.
Transmission data
→ SC2TRB (x'3FA2')
[
Chapter 3 3-1-4. Interrupt Flag Setup ]