Below are the generic
initialization steps to configure a UNICOMM instance and the
recommended order for software to execute these steps. Peripheral
specific initializations are listed in the respective sections.
- First,
put the UNICOMM instance into reset by setting the
RSCTL.RESETASSERT register bit from UNICOMM Registers.
- Enable
power to the UNICOMM instance by writing "0hB1" to
the KEY field and setting the EN bit for the PWREN
register in UNICOMM Registers.
- Configure
the peripheral mode for the UCx instance in the
IPMODE.SELECT field from the UNICOMM Registers to operate as a UART, SPI, I2C Controller, or I2C
Target.
- (Optionally) Configure the inter-module internal
loopback/pairing settings in SPG Registers between two UCx modules in the same SPG. See the
UNICOMM Block Diagram to understand how UCx pairings are available
within a SPG module.
- Configure the loopback pairs (maximum of one pair
per SPG module) in the LPBK0 register field.
- Configure the I2C pairs (maximum of one pair per
SPG module) in the PAIR0 register field.
- Enable
the pin functionality for each GPIO being used in
the peripheral configuration in IOMUX Registers.
- Configure
the below settings in the UNICOMM-UART
Registers / UNICOMM-SPI Registers /
UNICOMM-I2C Registers.
- To enable clocking of the UNICOMM
module, configure the clock source in the CLKSEL
register to decide the functional clock of
UNICOMM.
- Configure the clock divider for the UNICOMM
instance's peripheral-specific functional clock in
the CLKDIV.RATIO register field. This decides how
much to divide down the overall UNICOMM clock
source for each specific UNICOMM instance clock.
- Configure the interrupt masks for the peripheral
in the CPU_INT.IMASK register.
- Configure the emulation mode for the peripheral
in the PDBGCTL register.
- Perform peripheral-specific initializations
(example: SPI peripheral vs. controller mode, UART
baud rate etc.) Follow the detailed steps in in
the UART Initialization, SPI
Initialization, I2C Controller
Initialization, and I2C Target
Initialization chapters.