26-2
MC9328MX1 Reference Manual
MOTOROLA
General-Purpose Timers
26.1 Operation
The clock that feeds the prescaler can be selected from the main clock (divided by 1 or by 16), from the
timer input pin (TIN), or from the 32 kHz clock (CLK32). The clock input source is determined by the
clock source (CLKSOURCE) field in the timer control registers (TCTL1 and TCTL2). The timer prescaler
registers (TPRER1 and TPRER2) are used to select the divide ratio of the input clock that drives the main
counter. The prescaler can divide the input clock by a value between 1 and 256. When CLK32 is selected
as the clock source, the timer operates even while the PLL is in sleep mode (at that time, the PERCLK1
from the PLL is off).
Each timer can be configured for free-run or restart mode by programming the free-run/restart (FRR) bit in
the corresponding TCTLx register. In restart mode, after the compare value is reached, the counter resets to
0x00000000, the compare event (COMP) bit of the timer status register is set, an interrupt is issued if the
interrupt request enable (IRQEN) bit of the corresponding TCTLx register is set, and the counter resumes
counting. This mode is useful when you need to generate periodic events or audio tones when the
free-running timer
is used with the timer output signals. In free-run mode, the compare function operates as
it does in restart mode, however the counter continues counting without resetting to 0x00000000. When
0xFFFFFFFF is reached, the counter rolls over to 0x00000000 and keeps counting.
Each timer has a 32-bit capture register that takes a “snapshot” of the counter when a defined transition of
the timer input (TIN) is detected by the capture edge detector. The type of transition that triggers this
capture is selected by the capture edge (CAP) field of the corresponding TCTLx register. Pulses that
produce the capture edge can be as short as 20 ns. The minimum time between pulses is two PCLK
periods.
When a capture or compare event occurs, the corresponding (CAPT or COMP) status bit is set in the timer
status register and an interrupt is posted if the capture function is enabled or if the IRQEN bit of the
corresponding TCTLx register is set. The free-running timer is disabled at reset.
When 1 is written to the software reset (SWR) bit in the TCTLx register, the module resets immediately.
The reset signal is asserted for three times the period of the 96 MHz SystemCLK cycle. For example, if the
system clock period is 10 ns, the reset signal is asserted for 30 ns and then is automatically released.
26.1.1 Pin Configuration for General-Purpose Timers
Figure 26-1 shows the pins used for the General-Purpose Timer module. These pins are multiplexed with
other functions on the device, and must be configured for General-Purpose Timer operation. Table 26-1
lists the pin configuration for the General-Purpose Timers.
NOTE:
The user must ensure that the data direction bits in the GPIO are set to the
correct direction for proper operation. See Section 32.5.1, “Data Direction
Registers,” on page 32-9 for details.
Table 26-1. Pin Configuration
Pin
Setting
Configuration Procedure
TIN
Primary function of
GPIO Port A [1]
1. Clear bit 1 of Port A GPIO In Use Register (GIUS_A)
2. Clear bit 1 of Port A General Purpose Register (GPR_A)
TMR2OUT
Primary function of
GPIO Port D [31]
1.Clear bit 31 of Port D GPIO In Use Register (GIUS_D)
2. Clear bit 31 of Port D General Purpose Register (GPR_D)
Summary of Contents for DragonBall MC9328MX1
Page 68: ...1 12 MC9328MX1 Reference Manual MOTOROLA Introduction ...
Page 86: ...2 18 MC9328MX1 Reference Manual MOTOROLA Signal Descriptions and Pin Assignments ...
Page 116: ...3 30 MC9328MX1 Reference Manual MOTOROLA Memory Map ...
Page 126: ...4 10 MC9328MX1 Reference Manual MOTOROLA ARM920T Processor ...
Page 160: ...8 8 MC9328MX1 Reference Manual MOTOROLA System Control ...
Page 272: ...13 32 MC9328MX1 Reference Manual MOTOROLA DMA Controller ...
Page 281: ...Programming Model MOTOROLA Watchdog Timer Module 14 9 ...
Page 282: ...14 10 MC9328MX1 Reference Manual MOTOROLA Watchdog Timer Module ...
Page 300: ...15 18 MC9328MX1 Reference Manual MOTOROLA Analog Signal Processor ASP ...
Page 438: ...18 16 MC9328MX1 Reference Manual MOTOROLA Serial Peripheral Interface Modules SPI 1 and SPI 2 ...
Page 478: ...19 40 MC9328MX1 Reference Manual MOTOROLA LCD Controller ...
Page 574: ...21 32 MC9328MX1 Reference Manual MOTOROLA Memory Stick Host Controller MSHC Module ...
Page 598: ...23 16 MC9328MX1 Reference Manual MOTOROLA Real Time Clock RTC ...
Page 670: ...24 72 MC9328MX1 Reference Manual MOTOROLA SDRAM Memory Controller ...
Page 726: ...25 56 MC9328MX1 Reference Manual MOTOROLA SmartCard Interface Module SIM ...
Page 736: ...26 10 MC9328MX1 Reference Manual MOTOROLA General Purpose Timers ...
Page 854: ...29 18 MC9328MX1 Reference Manual MOTOROLA I2C Module ...
Page 900: ...30 46 MC9328MX1 Reference Manual MOTOROLA Synchronous Serial Interface SSI ...
Page 942: ...32 26 MC9328MX1 Reference Manual MOTOROLA GPIO Module and I O Multiplexer IOMUX ...