Setup Programmable Intervall Timer

Hi folks,

I’m trying to setup an Programmable Intervall Timer (PIT) on a x86 machine, but it doesn’t work anyway. I’ve registered an ISR at IRQ0, wrote timer control word to port 0x43, and wrote timer-value to 0x42.
Soo far, soo good.
My counter was counting and Interrupts happened, but not from my ‘source’ :frowning:.
Perhaps someone have idea how to use this timers excatly.

Thanks a lot


Are you talking about the timer on the CMOS chip? It’s not connected to IRQ0.

I mean the intel 8254 chip. I don’t know if it is on the CMOS chip but I think its in the southbridge.

The timer I was talking about is sometimes called the “Real-Time” clock, which is clearly not what you are talking about. There is an interval timer that the OS uses for scheduling and most timer services, which fires interrupt 0. You should not be programming this timer directly. I may be missing something however.

thanks for your reply.
As far as I know the system uses the counter0, which fires IRQ 0, as you say, but on this chip(it’s the intel 8254) there are two more timers (one was used for the dram-refesh and the other one is normally used for generating the input for the small speaker in the pc. But one can change their mode). Perhaps you know something about them??? hope so ;)

Otherwise do you know if there any other possiblities on a x86 machine, to use a counter which fires every 0.5 ms (or less) an interrupt???

I although found this (which is nearly excatly what I want):

rgallen wrote:

Doesn’t the 8254 use the same interrupt for all counters? If so, if any of them fire all attached handlers get called.

Along with using a POSIX timer, hooking into interrupt 0 and figuring out what its frequency is, you can use the REAL-TIME clock, which is on another interrupt, I believe 8.


the realtime clock worked :slight_smile:
it was the ‘thing’ I was looking for ;)

thank you very much…