English
Language : 

SN8F2250B Datasheet, PDF (114/133 Pages) SONiX Technology Company – 8-Bit Micro-Controller
SN8F2250B Series
USB 2.0 Full-Speed 8-Bit Micro-Controller
10.3 SIOB DATA BUFFER
0B6H
SIOB
Read/Write
After reset
Bit 7
SIOB7
R/W
0
Bit 6
SIOB6
R/W
0
Bit 5
SIOB5
R/W
0
Bit 4
SIOB4
R/W
0
Bit 3
SIOB3
R/W
0
Bit 2
SIOB2
R/W
0
SIOB is the SIO data buffer register. It stores serial I/O transmit and receive data.
Bit 1
SIOB1
R/W
0
Bit 0
SIOB0
R/W
0
10.4 SIOR REGISTER DESCRIPTION
0B5H
SIOR
Read/Write
After reset
Bit 7
SIOR7
W
0
Bit 6
SIOR6
W
0
Bit 5
SIOR5
W
0
Bit 4
SIOR4
W
0
Bit 3
SIOR3
W
0
Bit 2
SIOR2
W
0
Bit 1
SIOR1
W
0
Bit 0
SIOR0
W
0
The SIOR is designed for the SIO counter to reload the counted value when end of counting. It is like a post-scaler of
SIO clock source and let SIO has more flexible to setting SCK range. Users can set the SIOR value to setup SIO
transfer time. The valid SIOR value = 0x0 to 0xFD. To setup SIOR value equation to desire transfer time is as
following.
SCK frequency = SIO rate / (256 - SIOR);
SIOR = 256 - ( 1 / ( SCK frequency ) * SIO rate )
Example: Setup the SIO clock to be 2MHz. Fosc = 12MHz. SIO’s rate = Fcpu/2. Fcpu = Fosc/1 = 12MHz.
SIOR = 256 – (1/(2MHz) * 12MHz/2)
= 256 – 3
= 253
= 0xFD
Example: Master, duplex transfer and transmit data on rising edge
MOV
A,TXDATA
; Load transmitted data into SIOB register.
B0MOV
SIOB,A
MOV
A,#0FEH
; Set SIO clock
B0MOV
SIOR,A
MOV
A,#10000000B
; Setup SIOM and enable SIO function.
B0MOV
SIOM,A
B0BSET
FSTART
; Start transfer and receiving SIO data.
CHK_END:
B0BTS0
FSTART
; Wait the end of SIO operation.
JMP
CHK_END
B0MOV
A,SIOB
; Save SIOB data into RXDATA buffer.
MOV
RXDATA,A
Example: Slave, duplex transfer and transmit data on rising edge
MOV
A,TXDATA
; Load transfer data into SIOB register.
B0MOV
SIOB,A
MOV
A,# 10000100B
; Setup SIOM and enable SIO function.
B0MOV
SIOM,A
B0BSET
FSTART
; Start transfer and receiving SIO data.
CHK_END:
B0BTS0
FSTART
; Wait the end of SIO operation.
JMP
CHK_END
B0MOV
A,SIOB
; Save SIOB data into RXDATA buffer.
MOV
RXDATA,A
SONiX TECHNOLOGY CO., LTD
Page 114
Version 1.1