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.
- Apply the appropriate pin
multiplexing settings. For more information, see the device-specific data
manual, and (or) pin multiplexing utility.
- Enable the clocks to the uPP
peripheral. For more information, see the Clock Control section of this
TRM.
- Wait for few (approximately 32)
device clock cycles, and then clear the “Soft Reset” bit to 0 to bring the
module out of reset.
- Program the following uPP
configuration registers: CHCTL, IFCFG, IFIVAL, THCFG.
- uPP Channel Control
Register (data format, SDR/DDR, TX/RX, single/dual channel, interleave,
demux)
- uPP Interface
configuration Register (IO signal enable, polarity, clock divisor)
- uPP Interface idle value
register (to drive value in idle mode for Tx)
- uPP Threshold
configuration register (TX Size, DMA read burst size)
- Program the uPP interrupt enable
set register to interrupt generation for the desired events. Register an
interrupt service routine (ISR) if desired; otherwise, polling is required.
- Set the “PerEn” bit in the uPP
peripheral control register (PCR) to 1 to turn on the uPP peripheral.
- Allocate or initialize data
buffers for use with uPP.
- Program the DMA channels with
their first transfers using the uPP DMA channel descriptor register0, 1 and 2
(byte count, line count, line offset).
- Once the DMA descriptors are
written, the module starts to receive and transmit data, and performs DMA
transfers. Following is a simple description of how the DMA works.
- Watch for interrupt events.
Reprogram the DMA as necessary. (check that the PEND bit in the uPP DMA channel
status is 0).
- If polling, check uPP
Interrupt enabled status register. Reading a bit as 1 indicates the
corresponding event has occurred. Write the corresponding bit with 1 to
clear.
- If using ISR, check
ENINTST inside your ISR
Once the channel is started, the
initial latency between the time when the first data is received or transmitted on
the pin, and the time when the first DMA burst is transferred on the CBA bus, is
unpredictable. This initial latency is determined by several factors:
- Clock ratio between system clock
and uPP clock
- Various threshold values being
programmed
- Chip-level traffic activities
level
However, once the data is moving, all
subsequent data movement is continuous (streaming). If such data movement cannot be
maintained, then DMA under-run or over-flow situation can occur.