ADSP-2126x SHARC Processor Hardware Reference
14-5
Peripheral Timer
source without reference to the timer’s interrupt signal. The
TMSTAT
regis-
ter contains an Interrupt Latch bit (
TIMxIRQ
) and an Overflow/Error
Indicator bit (
TIMxOVF
) for each timer.
The three timer interrupts are connected as follows:
•
TIM0IRQ
to
GPTMR0I
, bit 13 in the
IRPTL
register
•
TIM1IRQ
to
GPTMR1I
, bit 4 in the
LIRPTL
register
•
TIM2IRQ
to
GPTMR2I
, bit 8 in the
LIRPTL
register
These sticky bits are set by the timer hardware and may be watched by
software. They need to be cleared in the
TMSTAT
register by software explic-
itly. To clear, write a one to the corresponding bit in the
TMSTAT
register.
Interrupt and overflow bits may be cleared simultaneously with
timer enable or disable.
To enable a timer’s interrupt, set the
IRQEN
bit in the timer’s Configura-
tion (
TMxCTL
) register and unmask the timer’s interrupt by setting the
corresponding bit of the
IMASK
register. With the
IRQEN
bit cleared, the
timer does not set its Interrupt Latch (
TIMxIRQ
) bits. To poll the
TIMxIRQ
bits without generating a timer interrupt, programs can set the
IRQEN
bit
while leaving the timer’s interrupt masked.
With interrupts enabled, ensure that the interrupt service routine (ISR)
clears the
TIMxIRQ
latch before the
RTI
instruction to assure that the inter-
rupt is not serviced erroneously. In External Clock (
EXT_CLK
) mode, the
latch should be reset at the very beginning of the interrupt routine so as
not to miss any timer event.
Enabling a Timer
To enable an individual timer, set the timer’s
TIMxEN
bit in the
TMSTAT
reg-
ister. To disable an individual timer, set the timer’s
TIMxDIS
bit in the
Summary of Contents for ADSP-21261 SHARC
Page 30: ...Contents xxx ADSP 2126x SHARC Processor Hardware Reference ...
Page 40: ...Register Diagram Conventions xl ADSP 2126x SHARC Processor Hardware Reference ...
Page 58: ...Differences From Previous SHARCs 1 18 ADSP 2126x SHARC Processor Hardware Reference ...
Page 112: ...Secondary Processing Element PEy 2 54 ADSP 2126x SHARC Processor Hardware Reference ...
Page 178: ...Summary 3 66 ADSP 2126x SHARC Processor Hardware Reference ...
Page 204: ...DAG Instruction Summary 4 26 ADSP 2126x SHARC Processor Hardware Reference ...
Page 322: ...Setting Up DMA 7 32 ADSP 2126x SHARC Processor Hardware Reference ...
Page 436: ...SPORT Programming Examples 9 86 ADSP 2126x SHARC Processor Hardware Reference ...
Page 521: ...ADSP 2126x SHARC Processor Hardware Reference 11 31 Input Data Port rts IDP_ISR end ...
Page 522: ...Input Data Port Programming Example 11 32 ADSP 2126x SHARC Processor Hardware Reference ...
Page 590: ...Timer Programming Examples 14 20 ADSP 2126x SHARC Processor Hardware Reference ...
Page 796: ...I O Processor Registers A 174 ADSP 2126x SHARC Processor Hardware Reference ...
Page 800: ...B 4 ADSP 2126x SHARC Processor Core Manual ...
Page 846: ...Index I 36 ADSP 2126x SHARC Processor Hardware Reference ...