Panasonic MN103S User Manual page 371

Panaxseries
Hide thumbs Also See for MN103S:
Table of Contents

Advertisement

Setup Procedure
(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
(6) Enable the transmission/reception
SC0CTR(0x0000A100)
bp14: SCA0REN=1
bp15: SCA0TEN=1
(7) Set the interrupt level
G13ICR(0x00008934)
bp14-12: G13LV2-0=100
(8) Enable the interrupt
G13ICR(0x00008934)
bp8: G13IE0=1
bp9: G13IE1=1
(9) Start the serial transmission
Transmission data → SC0TB
(0x0000A10C)
Reception data → Input to the SBI0 pin
Note: Each setting in (5) can be set at the same time.
(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) 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 by the G13LV2-0 flags of the
G13ICR register.
(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) 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.
Serial interface 0 and 1
Description
Operation
Chapter 12
XII - 25

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mn103sa7dMn103sa7g

Table of Contents