Download Print this page

Texas Instruments SimpleLink CC2620 Technical Reference Manual page 1346

Zigbee rf4ce wireless mcu simplelink cc13 series; simplelink cc26 series

Advertisement

Initialization and Configuration
To enable and initialize the UART, use the following steps:
1. Enable the serial power domain and enable the UART module in the PRCM module by writing to the
PRCM:UARTCLKGR register, the PRCM:UARTCLKGS register, and the PRCM:UARTCLKGDS
register, or by using the driver library functions:
PRCMPeripheralRunEnable(uint32_t), PRCMPeripheralSleepEnable(uint32_t),
PRCMPeripheralDeepSleepEnable(unit32_t)
and loading the setting to the clock controller by writing to the PRCM:CLKLOADCTL register or by
using the function
PRCMLoadSet().
2. Configure the IOC module to map UART signals to the correct GPIO pins. For more information on pin
connections, see
This section discusses the steps required to use a UART module. For this example, the UART clock is
assumed to be 24 MHz, and the desired UART configuration is the following:
115 200 baud rate
Data length of 8 bits
One stop bit
No parity
FIFOs disabled
No interrupts
The first thing to consider when programming the UART is the BRD because the UART:IBRD and
UART:FBRD registers must be written before the UART:LCRH register. Using the equation described in
Section
19.4.2, the BRD can be calculated.
BRD = 24 000 000 / (16 × 115 200) = 13.0208
This means that the UART:IBRD DIVINT field must be set to 13 decimal or 0xD. The value to be loaded
into the UART:FBRD register is calculated by
UART:FBRD.DIVFRAC = integer (0.0208 × 64 + 0.5) = 1
With the BRD values available, the UART configuration is written to the module in the following order:
1. Disable the UART by clearing the UART:CTL UARTEN bit.
2. Write the integer portion of the BRD to the UART:IBRD register.
3. Write the fractional portion of the BRD to the UART:FBRD register.
4. Write the desired serial parameters to the UART:LCRH register (in this case, a value of 0x0000 0060).
5. Enable the UART by setting the UART:CTL UARTEN bit.
1346
Universal Asynchronous Receivers and Transmitters (UARTS)
Chapter
11, I/O Control chapter.
Copyright © 2015, Texas Instruments Incorporated
Equation
4.
SWCU117C – February 2015 – Revised September 2015
www.ti.com
(3)
(4)
Submit Documentation Feedback

Hide quick links:

Advertisement

loading