Panasonic MN103S User Manual page 406

Panaxseries
Hide thumbs Also See for MN103S:
Table of Contents

Advertisement

Chapter 13
Serial Interface 2
(7) Set the SC2CTR2 register
Control the output data
SC2CTR2(0x0000A124)
bp0: SC2BRKE=0
Select the added parity bit
SC2CTR2(0x0000A124)
bp3: SC2NPE=0
bp5-4: SC2PM1-0=00
Specify the frame mode
SC2CTR2(0x0000A124)
bp7-6: SC2FM1-0=11
(8) Set the SC2CTR1 register
Set the communication style
SC2CTR1(0x0000A121)
bp0: SC2CMD=1
Select the clock dividing
SC2CTR1(0x0000A121)
bp3: SC2CKM=1
bp2: SC2MST=1
Control the pin function
SC2CTR1(0x0000A121)
bp4: SC2SBOS=1
bp5: SC2SBIS=1
bp7: SC2IOM=0
(9) Set the interrupt level
G15ICR(0x0000893C)
bp14-12: G15LV2-0=100
(10) Enable the interrupt
G15ICR(0x0000893C)
bp8: G15IE0=1
bp9: G15IE1=1
(11) Start the serial transmission
Transmission data→SC2TB(0x0000A130)
Reception data→input to SBI2 pin
Note: Each in (6), (7), and (8) can be set at once.
XIII - 34
Operation
Setup Procedure
(7) Set the SC2BRKE flag of the SC2CTR2 register to "0" to
select the serial data transmission.
Set the SC2PM1-0 flags of the SC2CTR2 register to
"00" to select 0 parity and the SC2NPE flag to "0" to
enable the parity bit added.
Set the SC2FM1-0 flags of the SC2CTR2 register to
"11" to select 8 bits + 2 stop bits to the frame mode.
(8) Set the SC2CMD flag of the SC2CTR1 register to "1" to
select duplex UART.
Set the SC2CKM flag of the SC2CTR1 register to "1" to
select 16 dividing of source clock. Be sure to set the
SC2MST flag to "1" and select the clock timer.
Set the SC2SBOS and SC2SBIS flags of the
SC2CTR1 register to "1" to set the SBO2 pin to the
serial data output and the SBI2 pin to the serial data
input.
(9) Set the interrupt level by the G15LV2-0 flags of the
G15ICR register.
(10) Set the G15IE0 flag of the G15ICR register to "1" and
the G15IE1 flag to "1" to enable the interrupt. When the
interrupt request flag is already set, clear the request
flag.
(11) If transmission data is set to the serial interface 2
transmission data buffer (SC2TB), transmission is
started. When transmission is completed, the serial 2
transmission interrupt (SC2TIRQ) is generated. Also,
reception data is fed to the SBI2 pin; and, the serial 2
reception interrupt (SC2RIRQ) is generated.
Description

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mn103sa7dMn103sa7g

Table of Contents