12-11
MSM66573 Family User's Manual
Chapter 12 Serial Port Functions
12
12.4.3 Example of SIO0-related Register Settings
Transmit settings
(1)
Port 7 mode register (P7IO)
If TXD0 (transmit data output) is to be used, set bit 1 (P7IO1) to "1" to configure that port
as an output. If the baud rate clock is to be input externally, reset bit 2 (P7IO2) to "0" to
configure that port as an input.
(2)
Port 7 secondary function control register (P7SF)
If TXD0 (transmit data output) is to be used, set bit 1 (P7SF1) to "1" to configure that port
as a secondary function output. If the baud rate clock is to be input externally, specify with
bit 2 (P7SF2) whether the input will be pulled-up.
(3)
SIO0 transmit control register (ST0CON)
Specify the transmit data length with bit 1 (ST0LN). Specify the stop bit length with bit 3
(ST0STB). With bit 4 (ST0PEN) specify whether there is parity. If parity is selected, specify
the parity bit logic with bit 5 (ST0ODD). With bit 6 (TR0MIE), specify whether interrupt
requests are enabled or disabled when a transmit buffer empty signal occurs. With bit 7
(TR0NIE), specify whether interrupt requests are enabled or disabled when a transmit
complete signal occurs.
(4)
SIO0 receive control register (SR0CON)
Specify with bit 2 (S0EXC) whether the baud rate clock is internal (overflow output of timer
3) or external (RXC0).
(5)
SIO0 transmit-receive buffer register (S0BUF)
Transmission is started by writing the transmit data to S0BUF.
Receive settings
(1)
Port 7 mode register (P7IO)
If RXD0 (receive data input) is to be used, reset bit 0 (P7IO0) to "0" to configure that port
as an input. If the baud rate clock is to be input externally, reset bit 2 (P7IO2) to "0" to
configure that port as an input.
(2)
Port 7 secondary function control register (P7SF)
Specify with bit 1 (P7SF0) whether the RXD0 pin will be pulled-up. If the baud rate clock
is to be input externally, specify with bit 2 (P7SF2) whether the input will be pulled-up.
(3)
SIO0 receive control register (SR0CON)
Specify the receive data length with bit 1 (SR0LN). Specify with bit 2 (S0EXC) whether the
baud rate clock is internal (overflow output of timer 3) or external (RXC0). Specify whether
there is parity with bit 4 (SR0PEN). If parity is selected, specify the parity bit logic with bit
5 (SR0ODD). With bit 6 (RC0IE), specify whether interrupt requests are enabled or
disabled when a receive complete signal occurs. If bit 7 (SR0REN) is set to "1", reception
is enabled and the reception operation is performed when data arrives.