Questions about PC speaker
Posted: Tue Jul 11, 2006 4:35 pm
Well I'm trying to add some basic sound and decided to start with the pc speaker but I don't know some stuff so...
1. which IRQ is PIT channel 2
2. I got some code but I don't understand what it does
I don't get what that would do, what is counter suppose to be? an alarm or frequency or what?
and I'll have plenty of other questions as I go more through this tutorial
1. which IRQ is PIT channel 2
2. I got some code but I don't understand what it does
Code: Select all
PIT_CHANNEL_2 = $42;
procedure Sound(frequency : word);
var counter : word;
begin
{ Program the PIT chip }
counter := PIT_FREQ div frequency;
Port[PIT_CONTROL] := $B6;
Port[PIT_CHANNEL_2] := Lo(counter);
Port[PIT_CHANNEL_2] := Hi(counter);
{ Connect the speaker to the PIT }
Port[SPEAKER_PORT] := Port[SPEAKER_PORT] or 3;
end;
and I'll have plenty of other questions as I go more through this tutorial