
MOTOROLA
Appendix D. TPU3 ROM Functions
D-3
Programmable Time Accumulator (PTA)
The RCPU selects which entry table to use by setting the ETBANK field in the TPUMCR2
register. This register is written once after reset. Although one entry table is specified at
start-up, in some cases it is possible to use functions from both tables without resetting the
microcontroller. A customer may, for example, wish to use the ID function from bank 1 to
verify the TPU3 microcode version but then use the MCPWM function from bank 0. As a
customer will typically only run the ID function during system configuration, and not again
after that, the bank 1 entry table can be changed to the bank 0 entry table using the soft reset
feature of the TPU3. This procedure is described in the following steps:
1. Set ETBANK field in TPUMCR2 to 0b01 to select the entry table in bank 1
2. Run the ID function
3. Stop the TPU3 by setting the STOP bit in the TPUMCR to one
4. Reset the TPU3 by setting the SOFTRST bit in the TPUMCR2 register
5. Wait at least nine clocks
6. Clear the SOFTRST bit in the TPUMCR2 register
The TPU3 stays in reset until the RCPU clears the SOFTRST bit. After the SOFTRST bit
has been cleared, the TPU3 will be reset and the entry table in bank 0 will be selected by
default. To select the bank 0 entry table, write 0b00 to the ETBANK field in TPUMCR2.
Always initialize any write-once register to ensure that an incorrect value is not accidentally
written.
The sections below document the bank 0 and bank 1 functions listed in
Table D-1 of the
TPU3 ROM module.
D.2
Programmable Time Accumulator (PTA)
PTA starts on a rising or falling edge and accumulates, over a programmable number of
periods or pulses, a 32-bit sum of the total high time, low time, or input signal period. After
the specified number of periods or pulses, the PTA generates an interrupt request.
One to 255 period measurements can be accumulated before the TPU3 interrupts the
RCPU, providing instantaneous or average frequency measurement capability. See
Motorola TPU Progamming Note Programmable Time Accumulator TPU Function (PTA),
(TPUPN06/D). Figure D-2 shows all of the host interface areas for the PTA function.