Chapter 12
Serial interface 0 and 1
Operation XII - 25
Note: Each setting in (5) can be set at the same time.
(5) Set the SC0CTR register
Set the protocol
SC0CTR(0x0000A100)
bp11: SCA0PTL=0
Set the first transfer bit
SC0CTR(0x0000A100)
bp9: SCA0OD=1
Set the transfer bit count
SC0CTR(0x0000A100)
bp7: SCA0LN=1
Set the parity bit
SC0CTR(0x0000A100)
bp6-4: SCA0PTY2-0=100
Set the stop bit
SC0CTR(0x0000A100)
bp3: SCA0SB=1
Set the clock source
SC0CTR(0x0000A100)
bp1-0: SCA0S1-0=11
(5) Set the SCA0PTL flag of the SC0CTR register to “0” to
select the UART (start-stop) communication.
Set the SCA0OD flag of the SC0CTR register to “1” to
set the first transfer bit to MSB.
Set the SCA0LN flag of the SC0CTR register to “1” to
set the transfer bit count to 8 bits.
Set the SCA0PTY2-0 flags of the SC0CTR register to
“100” to select “ fixed at 0”.
Set the SCA0SB flag of the SC0CTR register to “1” to
set the stop bit to 2 bits.
Set the SCA0S1-0 flags of the SC0CTR register to “11”
to set the clock source to 1/16 of the timer 14
underflow.
(6) Enable the transmission/reception
SC0CTR(0x0000A100)
bp14: SCA0REN=1
bp15: SCA0TEN=1
(6) Set the SCA0REN flag of the SC0CTR register to “1” to
enable reception, and set the SCA0TEN flag to “1” to
enable transmission.
(7) Set the interrupt level
G13ICR(0x00008934)
bp14-12: G13LV2-0=100
(7) Set the interrupt level by the G13LV2-0 flags of the
G13ICR register.
(8) Enable the interrupt
G13ICR(0x00008934)
bp8: G13IE0=1
bp9: G13IE1=1
(8) Set the G13IE0 flag of the G13ICR register to “1” and the
G13IE1 flag to “1” to enable the interrupt. If an interrupt
request flags has been set already, clear the request
flag.
(9) Start the serial transmission
Transmission data → SC0TB
(0x0000A10C)
Reception data → Input to the SBI0 pin
(9) Transmission is started by setting transmission data to
the serial 0 transmission register (SC0TB). When
transmission is completed, the serial 0 transmission
interrupt (SC0TIRQ) is generated. Also, reception data
is stored in the SBI0sbi0 pin and the serial 0 reception
interrupt (SC0RIRQ) is generated.
Setup Procedure Description