Architecture
1548
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Universal Parallel Port (uPP)
32.2.6 Initialization and Operation
32.2.6.1 Step-by-Step Procedure
NOTE:
When initializing the uPP peripheral, the uPP interface configuration register (UPICR) must
be programmed using a single, 32-bit write. Writing UPICR fields one-by-one can lead to
unexpected results.
This section provides step-by-step instructions for initializing and running the uPP peripheral in various
modes. These instructions are given assuming that the device has just come out of a power-on reset
(POR) state.
1. Apply the appropriate pin multiplexing settings. See the
System Configuration (SYSCFG) Module
chapter, your device-specific data manual, and/or pin multiplexing utility for more information.
2. Enable the power and clocks to the uPP peripheral. See the
Device Clocking
chapter for more
information.
3. Set the SWRST bit in the uPP peripheral control register (UPPCR) to 1 to place uPP in software reset.
4. Wait at least 200 device clock cycles, then clear the SWRST bit to 0 to bring the module out of reset.
5. Program the uPP configuration registers: UPCTL, UPICR, UPIVR, UPTCR, and UPDLB. The basic
function of each register is summarized here; for more information, see
.
(a) UPCTL – Transmit/receive selection (see
), data width, data format, data rate, data
interleave enable
(b) UPICR – Signal enable, signal inversion, clock divisor (transmit only)
(c) UPIVR – Idle value (transmit only)
(d) UPTCR – I/O transmit threshold (transmit only), DMA read burst size
(e) UPDLB – Digital loopback (see
6. Program the uPP interrupt enable set register (UPIES) to interrupt generation for the desired events.
Register an interrupt service routine (ISR) if desired; otherwise, polling is required.
7. Set the EN bit in the uPP peripheral control register (UPPCR) to 1 to turn on the uPP peripheral.
8. Allocate and/or initialize data buffers for use with uPP.
9. Program the DMA channels with their first transfers using the uPP DMA channel descriptor registers:
UPID0-2 and/or UPQD0-2.
10. Watch for interrupt events. Reprogram the DMA as necessary (checking that the PEND bit in the uPP
DMA channel status register (UPxS2) is 0).
(a) If polling, check UPIES. Reading a bit as 1 indicates the corresponding event has occurred. Write
the corresponding bit with 1 to clear.
(b) If using ISR, check UPIES inside your ISR. Structure your ISR according to the pseudo-code in