ZealOS/src/Doc/PIT.DD

13 lines
823 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:
$LK,"Channel 0",A="MN:PIT0"$ can generate an interrupt, IRQ 0, at a defined frequency. We set it up in $LK,"TimersInit",A="MN:TimersInit"$(), and use it in $LK,"SysTimerRead",A="MN:SysTimerRead"$().
Channel 1 ised to be used 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.
$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$