Panasonic MN103S User Manual page 396

Panaxseries
Hide thumbs Also See for MN103S:
Table of Contents

Advertisement

Chapter 13
Serial Interface 2
(6) Set the pin function
P1MD(0x0000A031)
bp7: P17M=1
P2MD(0x0000A032)
bp0: P20M=1
(7) Set the SC2CTR0 register
Set the transfer bit count
SC2CTR0(0x0000A120)
bp2-0: SC2LNG2-0=111
Select the start condition
SC2CTR0(0x0000A120)
bp3: SC2STE=0
Select the first transfer bit
SC2CTR0(0x0000A120)
bp4: SC2DIR=0
Select the transfer edge
SC2CTR0(0x0000A120)
bp7: SC2CE1=0
(8) Set the SC2CTR1 register
Select the communication style
SC2CTR1(0x0000A121)
bp0: SC2CMD=0
Select the transfer clock
SC2CTR1(0x0000A121)
bp2: SC2MST=1
bp3: SC2CKM=0
Control the pin function
SC2CTR1(0x0000A121)
bp4: SC2SBOS=1
bp5: SC2SBIS=1
bp6: SC2SBTS=1
bp7: SC2IOM=0
(9) Set the interrupt level
G15ICR(0x0000893C)
bp14-12: G15LV2-0=100
(10) Enable the interrupt
G15ICR(0x0000893C)
bp9: G15IE1=1
(11) Start the serial transmission
Transmission data→SC2TB(0x0000A130)
Reception data→input to the SBI2 pin
Note: Each in (1) to (3), (7), and (8) can be set at the same time.
XIII - 24
Operation
Setup Procedure
(6) Set the P17M flag of the P1MD register to "1" to set the
SBO2 pin function, the P20M flag of the P2MD register
to "1" to set the SBT2 pin function.
(7) Set the SC2LNG2-0 flag of the SC2CTR0 register to
"111" to set the transfer bit count to 8 bits.
Set the SC2STE flag of the SC2CTR0 register to "0"
and select "Without start condition".
Set the SC2DIR flag of the SC2CTR0 register to "0" to
set the first transfer bit to MSB.
Set the SC2CE1 flag of the SC2CTR0 register to "0" to
set the transmission data output edge to "falling" and
the reception data input edge to "rising".
(8) Set the SC2CMD flag of the SC2CTR1 register to "0"
and select the synchronous serial.
Set the SC2MST flag of the SC2CTR1 register to "1"
and select the clock master (internal clock).
Set the SC2CKM flag to "0" and select " no 1/16
dividing of the clock source.
Set the SC2SBOS, SC2SBIS, and SC2SBTS flags of
the SC2CTR1 register to "1" to set the SBO2 pin to the
serial data output and the SBT2 pin to the serial I/O pin.
Set the SBI2 pin to the serial data input by setting the
SC2IOM flag to "0".
(9) Set the interrupt level by the G15LV2-0 flags of the
G15ICR register.
(10) Set the G15IE1 flag of the G15ICR register to "1" to
enable the interrupt. If the interrupt request flag
(G15IR1 of the G15ICR register) is already set, clear
the G15IR1 flag to enable the interrupt.
(11) set the transmission data to the serial interface 2
transmission data buffer (SC2TB). The transfer clock is
generated and transmission and reception are started.
When transmission is completed, the serial interface 2
interrupt SC2TIRQ is generated.
Description

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mn103sa7dMn103sa7g

Table of Contents