Tvůrce webu je i pro tebe! Postav třeba web. Bez grafika. Bez kodéra. Hned.
wz

<< Zpět

česky: , English:

TIMER

Systémový časovač

Systémový časovač Intel 8254 je čítač hodinového signálu 1193182 Hz (porty 40h až 43h). Čítač 0 (port 40h) se používá jako systémový časovač (čítač impulsů 55 ms, perioda čítače 65536). Čítač 1 (port 41h) je rezervovaný pro refresh pamětí DRAM. Čítač 2 (port 42h) se používá ke generování tónu pro vestavěný reproduktor.


TimerSetMode - initialize timer counter

INPUT:
AL =
timer mode (TIMER_MODE_CNT, ...)
CX = counter initial value (1 to 65535, 0 stands for 65536)
DL = counter index (0 to 2)

NOTES: On mode TIMER_MODE_GEN value of 1 is illegal. It temporaly disables interrupts. It takes aprox. 7 us.


TimerSetVal - set counter new initial value

INPUT:
CX = counter new init. value (1 to 65535, 0 stands for 65536)
DL = counter index (0 to 2)

NOTES: On mode TIMER_MODE_GEN value of 1 is illegal. It temporaly disables interrupts. It takes aprox. 4 us.


TimerGetVal - get counter current value

INPUT:
DL = counter index (0 to 2)

OUTPUT:
AX = counter current value

NOTES: It temporaly disables interrupts. It takes aprox. 7 us.


TimerGetOut - get counter ouput

INPUT:
DL = counter index (0 to 2)

OUTPUT:
AL = counter current output state (0 or 1)

NOTES: It temporaly disables interrupts. It takes aprox. 4 us.


Timer counter mode

TIMER_FREQ: (=1193182) TIMER frequency 1193181.667 Hz, = 1/3 of the NTSC color subcarrier
TIMER_IRQ: (=0) TIMER IRQ number

TIMER_BASE: (=40h) TIMER base register
TIMER_CTRL: (=TIMER_BASE+3) TIMER control register

counter mode:

TIMER_MODE_CNT: (=0) mode 0: countdown and interrupt
TIMER_MODE_SHT: (=1) mode 1: hw retriggerable one-shot
TIMER_MODE_GEN: (=2) mode 2(6): rate generator
TIMER_MODE_SQR: (=3) mode 3(7): square wave
TIMER_MODE_SWS: (=4) mode 4: sw triggered strobe
TIMER_MODE_HWS: (=5) mode 5: hw triggered strobe

TIMER_MODE_MAX: (=7) maximal mode number


Zdrojový kód TIMER.ASM

<< Zpět