Intel C2518 FH8065501516710 Data Sheet

Product codes
FH8065501516710
Page of 746
Intel
®
 Atom™ Processor C2000 Product Family for Microserver
September 2014
Datasheet, Vol. 2 of 3
Order Number: 330061-002US
543
Volume 2—High Precision Event Timer (HPET)—C2000 Product Family
Programming the HPET
28.4
Programming the HPET
28.4.1
Non-Periodic Mode - All Timers
Each timer supports the non-periodic mode of operation. This mode is thought of as 
creating a one-shot. When a timer is set up for the non-periodic mode, it generates an 
interrupt when the value in the main counter matches the value in the timer 
comparator register. As timers 1 and 2 are 32-bit, they generate another interrupt 
when the main counter wraps.
The 64-bit Timer 0 Comparator Value (T0CV) cannot be programmed reliably by a 
single 64-bit write in a 32-bit environment unless only the periodic rate is being 
changed. If T0CV needs to be re-initialized, the algorithm is performed as follows: 
1. Set the Timer Value Set (TVS) - T0C.TVS.
2. Set T0CV[31:0].
3. Set the TVS of the Timer 0 Configuration and Capabilities (TOC) - T0C.TVS.
4. Set T0CV[63:32].
28.4.2
Periodic Mode - Timer 0 Only
When set up for the periodic mode when the main counter value matches the value in 
the Timer 0 Comparator Value (T0CV), an interrupt is generated (if enabled). The 
hardware then increases T0CV by the last value written to T0CV. During run-time, T0CV 
is read to find out when the next periodic interrupt is generated. The software is 
expected to remember the last value written to T0CV.
Example: if the value written to T0CV is 00000123h, then:
• An interrupt is generated when the main counter reaches 00000123h.
• T0CV is then adjusted to 00000246h.
• Another interrupt is generated when the main counter reaches 00000246h.
• T0CV is then adjusted to 00000369h.
When the incremented value is greater than the maximum value for T0CV, the value 
wraps around through 0. For example, if the current value in a 32-bit timer is 
FFFF0000h and the last value written to this register is 20000, then after the next 
interrupt the value changes to 00010000h.
If the software wants to change the periodic rate, it writes a new value to T0CV. When 
the timer comparator matches, the new value is added to derive the next matching 
point. If the software resets the main counter, the value in the Comparator Value 
register must also be reset by setting T0C.TVS. To avoid race conditions, this is done 
with the main counter halted. The usage model is expected as follows:
2. The software clears the main counter by writing a value of 00h to it.
3. The software sets T0C.TVS.
4. The software writes the new value in T0CV.
5. The software sets HPET_GCFG.EN to enable interrupts.