ZealOS/src/Doc/PIT.DD

13 lines
827 B
Text
Raw Normal View History

2020-02-16 17:57:16 +00:00
$WW,1$The $FG,2$Programmable Interval Timer$FG$ has two purposes: Generate interrupts, and control the $FG,2$PC speaker$FG$.
It has 3 channels:
2020-02-17 01:36:52 +00:00
$LK,"Channel 0",A="MN:PIT0"$ can generate an interrupt, IRQ 0, at a defined frequency. We set it up in $LK,"TimerInit",A="MN:TimerInit"$(), and use it in $LK,"SysTimerRead",A="MN:SysTimerRead"$().
2020-02-16 17:57:16 +00:00
2020-02-21 05:05:16 +00:00
Channel 1 was used historically to refresh the DRAM, but now it is obsolete as the hardware does this itself. Channel 1 is useless and might not even be implemented anymore on modern machines.
2020-02-16 17:57:16 +00:00
$LK,"Channel 2",A="MN:PIT2"$'s output is connected to the PC speaker.
The Command port is used to control each of these 3 channels. The relevant $LK,"flags",A="MN:PIT_CMDF_OPMODE_RATE_GEN"$ are defined.
See $LK,"Sound",A="MN:Sound"$() for how the PC speaker frequency is changed.$WW,0$