2 setting the serial port mode – Texas Instruments MSC1210 User Manual
Page 93
Setting the Serial Port Mode
9-3
Serial Communication
9.2
Setting the Serial Port Mode
The first thing to be done when using the MSC1210 integrated serial port is, ob-
viously, to configure it. This lets you tell the MSC1210 how many data bits are
needed, the baud rate to be used, and how the baud rate will be determined.
First, the Serial Control 0 (SCON0) SFR is presented and what each bit of the
SFR represents is defined. Remember, SCON1 has the exact same function
but relates to the secondary UART.
The individual bits of SCON0 have the following functions:
7
6
5
4
3
2
1
0
Reset Value
SFR 98H
SM0_0
SM1_0
SM2_0
REN_0
TB8_0
RB8_0
TI_0
RI_0
00H
SM0−2 (bits 7−5)—Serial Port 0 Mode. These bits control the mode of Serial
Port 0. Modes 1, 2, and 3 have one start and one stop bit in addition to the eight
or nine data bits.
Mode
SM0
SM1
SM2
Function
Length
Period
0
0
0
0
Synchronous
8 bits
12 p
CLK
(1)
0
0
0
1
Synchronous
8 bits
4 p
CLK
(1)
1
0
1
x
Asynchronous
10 bits
Timer 1 or 2 baud rate
equation
2
1
0
0
Asynchronous
11 bits
64 p
CLK
(1)
(SMOD = 0)
32 p
CLK
(1)
(SMOD = 1)
2
1
0
1
Asynchronous
with
multiprocessor
communication
11 bits
64 p
CLK
(1)
(SMOD = 0)
32 p
CLK
(1)
(SMOD = 1)
3
1
1
0
Asynchronous
11 bits
Timer 1 or 2 baud rate
equation
3
1
1
1
Asynchronous
with
multiprocessor
communication
11 bits
Timer 1 or 2 baud rate
equation
Notes:
1) pCLK will be equal to tCLK, except that pCLK will stop for IDLE.
REN_0 (bit 4)—Receive Enable. This bit enables/disables the Serial Port 0
received shift register.
0: Serial Port 0 reception disabled.
1: Serial Port 0 received enabled (modes 1, 2, and 3). Initiate synchronous re-
ception (mode 0).
TB8_0 (bit 3)—Ninth Transmission Bit State. This bit defines the state of the
ninth transmission bit in Serial Port 0 modes 2 and 3.
RB8_0 (bit 2)—Ninth Received Bit State. This bit identifies the state of the
ninth reception bit of received data in Serial Port 0 modes 2 and 3. In serial port
mode 1, when SM2_0 = 0, RB8_0 is the state of the stop bit. RB8_0 is not used
in mode 0.