c - Restarting counter before it has expired on Programmable Interval Timer (8254) -
i writing preemptive kernel in c , assembly. i've been looking @ , setting timer interrupts through pit , pic 1 thing utterly unable find answer on.
we have initilized 8254 chip counting on counter 0 in mode 2. set fire interrupt on ir0 on pic every 10 ms. after enable ir0 on pic , things work intended.
however lets @ conditions want alter time pit fires @ feeding new value. or restart counter midcounting.
the intel manual chip has detail on gate , using restart counter getting rising edge on gate.
the manual says if give counter new value doesn't reset counter until after current counting sequence finished unless trigger (rising edge on gate) happens before counting over.
the manual says sending new cw chip reset counter, don't believe optimal way of restarting or altering counter.
so question is, how done in either c or assembly? (we got full write access whenever want).
to not leave question unanswered , i've of answer i'll answer myself.
as far i've understood chip has 3 counters counter 2 (we start counting @ 0) has gate pin connected (and 1 has connected speaker). result counter 0 real timer counter doesn't have connection on gate means can't cause trigger on after sending new value.
this means sending value , restarting on value before timer impossible without sending new icw.
in case want reset timer when out of interrupt caused 8259 chip 8254 connected @ end of handling of interrupt (that don't want time running during actual interrupt) best of changing mode mode 0 doesn't restart timer on terminal count , manually restart time want use each time end , interrupt.
Comments
Post a Comment