RTC: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content added Content deleted
No edit summary
Line 53: Line 53:


====Interrupts and Register C====
====Interrupts and Register C====
It is important to know that upon a IRQ 8, register C will contain a bitmask telling which interrupt happened. The RTC is capable of producing a periodic interrupt(what we use), an update ended, and a alarm interrupt. If you are only using the RTC as a simple timer, this is not important. What is important is that if register C is not read after an IRQ 8, then the interrupt will not happen again. So, even if you don't care about what type of interrupt it is, just attach this code to the bottom of your IRQ handler to be sure you get another interrupt.
It is important to know that upon a IRQ 8, register C will contain a bitmask telling which interrupt happened. The RTC is capable of producing a periodic interrupt(what we use), an update ended interrupt, and an alarm interrupt. If you are only using the RTC as a simple timer, this is not important. What is important is that if register C is not read after an IRQ 8, then the interrupt will not happen again. So, even if you don't care about what type of interrupt it is, just attach this code to the bottom of your IRQ handler to be sure you get another interrupt.
<pre>
<pre>
outportb(0x70, 0x0C); //select register C
outportb(0x70, 0x0C); //select register C