M3 GPIO Mux
C28 GPIO Mux
M3
U
A
R
T
4
P
e
ri
p
h
e
ra
l
C28
S
C
I‐
A
P
e
rip
h
e
ra
l
SERPLOOP[UART4TOSCIA]
0
1
0
1
Tx
Rx
Rx
Tx
M3 UART4 to C28 SCI-A Internal Loopback
1496
SPRUHE8E – October 2012 – Revised November 2019
Copyright © 2012–2019, Texas Instruments Incorporated
M3 Universal Asynchronous Receivers/Transmitters (UARTs)
Figure 21-6. UART and SCI Connections for Loopback Mode
21.4.1 Loopback Initialization and Configuration
To enable M3 UART4 to C28 SCI-A loopback, follow these steps:
1. Enable and configure the M3 UART4 module by following the steps outlined in
2. Enable internal loopback mode by setting SERPLOOP[UART4TOSCIA] = 1 on the M3 subsystem.
3. Enable and configure the C28 SCI-A module as described in the Enhanced SCI Module Overview
section of the
C28 Serial Communications Interface (SCI)
chapter.
To disable loopback between the M3 and C28, set SERPLOOP[UART4TOSCIA] = 0.
21.5 Initialization and Configuration
To enable and initialize the UART, the following steps are necessary:
•
The peripheral clock must be enabled by setting the UART0, UART1, or UART2 bits in the RCGC1
register (see the
System Control and Interrupts
chapter).
•
The clock to the appropriate GPIO module must be enabled via the RCGC2 register in the System
Control module (see the
System Control and Interrupts
chapter).
•
Set the GPIO AFSEL bits for the appropriate pins (see the GPIOs chapter). To determine which GPIOs
to configure, see the
GPIOs
chapter.
•
Configure the GPIO current level and/or slew rate as specified for the mode selected (see the
GPIOs
chapter).
•
Configure the PMCn fields in the GPIOPCTL register to assign the UART signals to the appropriate
pins (see the
GPIOs
chapter).
To use the UARTs, the peripheral clock must be enabled by setting the UART0, UART1, or UART2 bits in
the RCGC1 register (see the
System Control and Interrupts
chapter). In addition, the clock to the
appropriate GPIO module must be enabled via the RCGC2 register in the
System Control and Interrupts
chapter. To find out which GPIO port to enable, refer to the
GPIOs
chapter.
This section discusses the steps that are required to use a UART module. For this example, the UART
clock is assumed to be 20 MHz, and the desired UART configuration is:
•
115200 baud rate
•
Data length of 8 bits
•
One stop bit
•
No parity