BAT32G1x9 user manual | Chapter 19 Universal serial communication unit
571 / 1149
Rev.1.02
19.2.3
Shift Register (SCI1/SCI2)
This is a 16-bit register that converts parallelly and serially to and from each other.
Convert the input data of the serial input pins into parallel data when receiving data; When data is sent,
the value that will be passed to this register is output from the serial output pin as serial data. Shift registers
cannot be manipulated directly through the program.
To read and write data from the shift register, use the serial data register mn (SDRmn) during operation
(SEmn=1).
19.2.4
Serial data register mn(SDRmn) (SCI1/SCI2).
The SDRmn register is the transmit and receive data registers (16 bits) of channel n.
When the operation stops (SEmn=0), bit15~9 is used as a crossover setting register for the operating
clock (f
MCK
). During operation (SEmn=1) bit15~9 is used as a transmit and receive buffer register.
When receiving data, save parallel data converted by shift registers to serial data register SDRmn;
When sending data, the transmit data that will be transferred to the shift register is set to the serial data
register SDRmn.
Regardless of the output order of the data, bit3 to bit 0 (DLSmn3~) of the set register mn (SCRmn) is run
according to the serial communication DLSmn0) settings, the data saved to the SDRmn register is as follows:
• 7 bits of data length (bit0~6 saved in the SDRmn register).
• 8 bits of data length (bit0~7 saved in the SDRmn register).
:
• 16-bit data length (bit0~15 saved in the SDRmn register).
SDRmn registers can be read and written in 16-bit increments.
At SEmn=1, the lower 8 bits of the SDRmn register can be read and written as SDRmnL in 8 bits.
Depending on the communication mode, the SDRmnL register can be read and written with the following
SFR name.
•
SSPIp communication... SDIOpL
•
UARTq receives... RXDq (UARTq Receive Data Register).
•
UARTq sends... TXDq (UARTq Transmit Data Register).
•
IICr communication... SDIOr (IICr Data Register).
After generating the reset signal, the value of the SDRmn register changes to "0000H".
Note 1
At run stop (SEmn=0), it is forbidden to
rewrite
SDRmn [7:0] via the
8-bit memory operation instruction
(otherwise,
SDRmn[15:9]
is all cleared
"0").
Note 1.m: Unit number (m=1,
2) n: Channel number (n=2,
3).
p:
SSPI
number (p=20,
21,
30,
31
)
q: UART number (q=2, 3) r: IIC number (r=20, 21, 30, 31)
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Shift register