Chapter 13 Programmable Trigger Unit (PTUV2)
MC9S12ZVM Family Reference Manual Rev. 1.3
Freescale Semiconductor
481
13.4.3
Reload mechanism
Each trigger generator uses two lists to load the trigger values from the memory. One list can be updated
by the CPU while the other list is used to generate the trigger events. After enabling, the TG uses the lists
in alternate order. When the update of alternate trigger list is done, the SW must set the PTULDOK bit. If
the load OK bit is set at the time of reload event, the TG switches to the alternate list and loads the first
trigger value from this trigger event list. The reload event clears the PTULDOK bit.
The TG0LIST and TG1LIST bits shows the currently use list number. These bits are writeable if the
associated TG is disabled.
If the PTULDOK bit was not set before the reload event then the reload overrun error flag is set
(PTUROIF)and both TGs do not switch to the alternative list. The current trigger list is used to load the
trigger values.
shows an example. The PTULDOK bit can be used by other modules as
glb_ldok.
To reduce the used memory size, it is also possible to set TG0L0IDX equal to TG0L1IDX or to set
TG1L0IDX equal to TG1L1IDX. In this case the trigger generator is using only one physical list of trigger
events even if the trigger generator logic is switching between both pointers. The SW must make sure, that
the CPU does not update the trigger list before the execution of the trigger list is done. The time window
to update the trigger list starts at the trigger generator done interrupt flag (TGxDIF) and ends with the next
reload event. Even if only one physical trigger event list is used the TGxLIST shows a swap between list
0 and 1 at every reload event with set PTULDOK bit.
Figure 13-24. TG0 Reload behavior with local PTULDOK
13.4.4
Async reload event
If the reload and reload_is_async are active at the same time then an async reload event happens. The PTU
behavior on an async reload event is the same like on the reload event described in
PTULDOK
TG0LIST
PTUROIF
set by SW
switch to new list index
PTULDOK bit was not
stay at current list index
set by CPU
set reload overrun error flag
TG0DIF
TG0DIF
reload event