TC1796
Peripheral Units (Vol. 2 of 2)
General Purpose Timer Array (GPTA)
User’s Manual
24-229
V2.0, 2007-07
GPTA, V2.0
24.4.2.3 Multiplexer Register Array Programming
A total of 40 control registers are required to program the configuration of the output
multiplexer and the LTC input multiplexer of the Input/Output Line Sharing Unit. These
IOLS control registers are combined into a Multiplexer Register Array FIFO that can only
be read or written sequentially. Therefore, the control registers values cannot be
accessed directly but must be accessed in a specific sequential order.
Three registers are available for controlling the Multiplexer Register Array:
•
Multiplexer Register Array Control Register MRACTL
•
Multiplexer Register Array Data In Register MRADIN
•
Multiplexer Register Array Data Out Register MRADOUT
shows the structure of the multiplexer array FIFO with the arrangement of
the multiplexer control registers.
For programming of the multiplexer array FIFO, the following steps must be executed:
1. Disable interconnections of the multiplexer array by writing MRACTL.MAEN = 0
(default after reset). The multiplexer array is disabled, all cell input lines are driven
with 0, and device pins assigned to LTCA2 I/O lines or output lines are disconnected.
2. Reset the write cycle counter to 0 by writing MRACTL.WCRES = 1.
3. Write sequentially the multiplexer control register contents one after the other
(40 values) into MRADIN, starting with the register values for OMCRH13, OMCRL13,
… up to LIMCRH0, LIMCRL0 (see
). After the first MRADIN write
operation, the contents for OMCRH13 is at FIFO position 1. With each following
MRADIN write operation, it becomes shifted one FIFO position upwards. After the 40.
MRADIN write operation, the OMCRH13 value is at its final position. The contents of
FIFO position 40 can be read via register MRADOUT. With each MRADIN write
operation the write cycle counter MRACTL.FIFOFILLCNT is incremented by 1. After
all FIFO entries have been written, the FIFO is locked, bit MRACTL.FIFOFULL is set,
and further MRADIN write operations are discarded until bit MRACTL.WCRES is
written again with a 0.
4. Enable the multiplexer array by writing MRACTL.MAEN = 1. This establishes and
enables all programmed interconnections.
To check the FIFO contents, the FIFO can be written a second time. At this check
MRADIN is written before MRADOUT is read. This will return the FIFO contents of the
first write sequence in the order of OMCRH13, OMCRL13, …, LIMCRH0, LIMCRL0.
Before disabling the multiplexer array FIFO, LTCA2 output pins that are already enabled
as LTCA2 output should be switched to GPIO function to avoid output spikes. After
enabling the multiplexer array FIFO again, the LTCA2 output can be switched again back
to LTCA2 output function.
Shifting the write data through the FIFO requires a few clock cycles. When new data
becomes written before the FIFO is ready to accept them, wait states will be inserted into
the write access.