need help with system speaker control in c

Discussion in 'Software' started by Jim S, Mar 1, 2006.

  1. Jim S

    Jim S Private E-2

    Hopefully no one will be too mad at me because I accidently posted this in the software forum too and can't figure out how to delete it...

    I can't find much help on the internet about how to control the system speaker on a computer. I got some help from this site which explains that you have to first send a "PIT comtrol word" to 43H then a counter value to 42H and finally to turn on the speaker by turning bits 0 and 1 on at 61H.

    So, I sent B6H to to port 43H as given in the example. I'm really confused as to what this does. I then send some number to 42H and the number 3 to 61H. I know this will turn off all other bits at port 61H besides the last two, but it works anyway. Here is what im pretty much doing in C:
    outportb(0x43,0xb6);
    outportb(0x42,12);
    outportb(0x61,3);
    I get some sound out but I'm a little confused as to why this is happening.

    my two major questions are:
    -what does this "PIT control word" mean?
    -is there any table i could look at to see what number means what note when sending something to 42H?
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds