Architecture
1551
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Universal Parallel Port (uPP)
32.2.6.3 System Tuning Tips
The uPP peripheral can operate at high speed and transfer data at a very high rate. When operating the
uPP near its upper limits, tuning certain parameters can help decrease the incidence of errors and the
software overhead incurred servicing uPP data.
lists several parameters that can be useful in
system tuning. A parameter is defined as a “coarse” adjustment, if changing the parameter directly alters
the peripheral throughput. A “fine” adjustment does not change the peripheral throughput, but it does
affect general system performance.
(1)
These values vary per application. One example could be a 16-KB transfer. The same total data could be transferred as 16 1-KB
lines or 2 8-KB lines.
(2)
System priority settings are not set within the uPP peripheral. See the
System Configuration (SYSCFG) Module
chapter for more
information.
Table 32-9. uPP Parameters Useful for System Tuning
Parameter
Register
Register
Field
Edge Value
Safe Value
Description
Data Rate
UPCTL
DRB
1
0
Double data rate increases data transfer
by a factor of 2 and greatly increases
system loading for the same clock divisor.
This is a coarse adjustment and is
probably fixed due to design constraints.
DRA
Clock Division
UPICR
CLKDIVB
0
1+
Increasing clock division is the most
straight-forward way to decrease system
loading. This is a coarse adjustment; the
difference between CLKDIVx = 0 and 1 is
the same (in terms of data rate) as the
difference between single and double data
rate.
CLKDIVA
DMA Read Burst Size
UPTCR
RDSIZEQ
0
3h
Increasing the DMA read threshold
decreases system loading by generating
fewer, larger DMA events. This is a fine
adjustment.
RDSIZEI
DMA Line Size, Count
UPxD1
LNCNT
(1)
(1)
Condensing uPP transfers into fewer,
larger lines generates fewer end-of-line
interrupts and, thus, invokes fewer ISR
calls. This is a fine adjustment.
BCNT
Total Transfer Size
UPxD1
LNCNT
(1)
(1)
Performing many small uPP transfers can
require excessive software overhead
(programming DMA descriptors, handling
interrupts, etc.) at high data rates. This is
a fine adjustment.
BCNT
System Priority
(2)
(2)
(2)
When the uPP operates in parallel with
other data masters, such as EDMA,
assigning higher priority to the uPP may
help the uPP avoid underflow or overflow
conditions. This is a fine adjustment.
32.2.6.4 Sample Interrupt Service Routine
The following pseudo-code serves as a template for writing a uPP interrupt service routing (ISR) function.
Note that the uPP combines all events into a single CPU interrupt, and a new interrupt does not call the
ISR if the previous interrupt still has not returned from the ISR. To allow future ISR calls, the uPP end-of-
interrupt register (UPEOI) must be written with a zero value. Thus, the ISR should check for multiple
events, and should continue rechecking after handling each individual event until no more events are
found. Then, it must write UPEOI = 0 before returning.