SN8P26L38
8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 117
Version 1.5
The SIO supports interrupt function. SIOIEN is SIO interrupt function control bit. SIOIEN=0, disable SIO interrupt
function. SIOIEN=1, enable SIO interrupt function. When SIO interrupt function enable, the program counter points to
interrupt vector (ORG 8) to do SIO interrupt service routine after SIO operating. SIOIRQ is SIO interrupt request flag,
and also to be the SIO operating status indicator when SIOIEN = 0, but cleared by program. When SIO operation
finished, the SIOIRQ would be set to
“1”, and the operation is the inverse status of SIO “START” control bit.
The SIOIRQ and SIO START bit indicating the end status of SIO operation is after one 8-bit data transferring. The
duration from SIO transfer end to SIOIRQ/START active is about
“1/2*SIO clock”
, means the SIO end indicator
doesn
’t active immediately.
Note: The first step of SIO operation is to setup the SIO pins
’ mode. Enable SENB, select CPOL and CPHA
bits. These bits control SIO pins
’ mode.
11.3
SIOM MODE REGISTER
SIOM initial value = 0000 0000
0B4H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
SIOM
SENB
START
SRATE1
SRATE0
MLSB
SCKMD
CPOL
CPHA
Read/Write
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
After reset
0
0
0
0
0
0
0
0
Bit 7
SENB:
SIO function control bit.
0 = Disable SIO function. P5.0~P5.2 are GPIO.
1 = Enable SIO function. P5.0~P5.2 are SIO pins.
SIO pin structure can be push-pull structure and
open-drain structure controlled by P1OC register.
Bit 6
START:
SIO progress control bit.
0 = End of transfer.
1 = SIO transmitting.
Bit [5:4]
SRATE1,0:
SIO’s transfer rate select bit.
These 2-bits are workless when SCKMD=1.
00 = fcpu.
01 = fcpu/32
10 = fcpu/16
11 = fcpu/8.
Bit 3
MLSB:
MSB/LSB transfer first.
0 = MSB transmit first.
1 = LSB transmit first.
Bit 2
SCKMD:
SIO’s clock mode select bit.
0 = Internal. (Master mode)
1 = External. (Slave mode)
Bit 1
CPOL:
SCK idle status control bit.
0 = SCK idle status is low status.
1 = SCK idle status is high status.
Bit 0
CPHA:
The Clock Phase bit controls the phase of the clock on which data is sampled.
0 = Data receive at the first clock phase.
1 = Data receive at the second clock phase.