NXP Semiconductors
QN902x
User Manual of QN902x
UM10996
All information provided in this document is subject to legal disclaimers.
© NXP Semiconductors N.V. 2018. All rights reserved.
User Manual
Rev 1.3
— 05 November 2018
85 of 128
The event source can be selected from the Input Capture Pin (ICP) or the Analog
Comparator. The event is triggered by the edge change of ICP or ACMP. The edge can be
selected by setting the register bits ICES[1:0]. In this mode, no interrupt will be
generated by the trigger event. The timer overflow interrupt will be generated at the
end of the specified time.
11.3.4
Input Capture Count mode
This mode is used to calculate how long it takes for specified event (defined by
ICES[1:0]) to happen times specified by TOP register.
Once the specific event occurs, the event counter ECNT continually increments and
compares its value with TOP register. Once the ECNT equals to the TOP register, the
input capture flag (ICF) will be asserted. The input capture interrupt will be generated if
the ICIE is set.
11.3.5
Interrupt
The QN902x Timer module has three interrupt sources:
•
Input capture interrupt
•
Output compare interrupt
•
Timer overflow interrupt
All three can be enabled by setting TCR[3:1]. The interrupt flag can be read through IFR register.
All three interrupts are valid in 4 operation modes.
11.4
Register Description
11.4.1
Register Map
The Timer 0/1/2/3 have the same registers with different register base addresses as the
following.
Timer 0: 0x40002000
Timer 1: 0x40003000
Timer 2: 0x40004000
Timer 3: 0x40005000
Table 60 Timer Register Map
Offset
Name
Description
000h
TCR
Timer control register
004h
IFR
Timer interrupt flag register
008h
TOPR
Timer TOP register
00Ch
ICER
Timer input capture event register
010h
CCR
Timer input capture/compare register
014h
TCNT
Timer counter current value register