mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2025-01-28 15:16:05 +00:00
13 lines
No EOL
828 B
Text
Executable file
13 lines
No EOL
828 B
Text
Executable file
$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:PIT_0"$ 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"$().
|
|
|
|
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.
|
|
|
|
$LK,"Channel 2",A="MN:PIT_2"$'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$ |