Timer Interrupt

Hi friends,

I have a query here.

Recently, I am supposed to program a real time clock to be displayed on

the screen.

The program will accept users' input of hours, minutes, and seconds.

then i will increment from there and so implementing a displayed clock.

the problem now is that my clock runs differently on different PC systems.

sometimes faster sometimes slower...

so i suspect i may have to hook my own ISR to INT 8h or INT 1ch i dun know...

may i get help in doing this ??

can this be done in assembly language, C language or inline assembly ??

Please reply if you know this area. I desperately need some advice !!!!

help appreciated :)


  • Is your program being used in different chipsets? If so,

    that could be the problem. I know that Intel's chips

    have interrupt 0x80 set to interrupt 18.2 times a second.

    If you've written your program with one chip in mind, and

    it's being used under different chips that could be the cause

    of the deviation. Another thing to bare in mind. As far as I know,

    that is with an Intel chip, if your ISR or another one was written

    poorly and hangs the machine for too long, the clock will be thrown

    off. In most cases, an interrupt can not interrupt another interrupt

    until the ISR for that interrupt is over with, unless of course the

    IF(interrupt falg) is set to enable interrupts, although it's not a good

    idea to enable interrupts in the middle of an ISR unless you're careful about it.

    Re-enteracy is typically not a good idea, especially with ISRs. I know this hasn't

    been of much help, but my knowledge on the timer interrupt is limited to Intel chips.

    The best advice I can give you is, assuming an Intel chipset, write your ISR to be as

    quickly executing as possible. That's always a good rule of thumb when writting an ISR.

  • Oh, one more thing. It sounds like your plugging your

    routine into 0x80 in the vector table. You might want to

    try plugging into 0x1C. 0x1C is an interrupt left open to be

    defined by software that is called along with 0x80 every time it

    interrupts. Making use of this one instead could solve your problem.

    Well, hope this helps. C-ya

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!