VOGONS

Common searches


First post, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Hi, just stumbled over a datasheet of the Motorola MC146818.
That chip was used in the IBM AT -and- some PC/XT clones a long time ago.
(Source: http://www.lpjjl.net/pgm/fichiers/docasm/RTC.txt)

Originally, the PC/XT had no RTC, but could be upgraded with third-party RTCs (like the DS1216E),
in which case it required a little utility to sync the DOS clock with one of them.

What took my attention was the Programmable Square-Wave Output Signal.

Now I wonder - In the PC/AT, is that output connected to the PC Speaker, too ?
And if so, could it be used as a tone generator ?

If not, how was the alarm feature beeing used or implemented back then ?

Was this task up to the BIOS, DOS (ie, display alarm message, cause an interrupt, make beeps, etc.) ?

What do you think ?

Any thoughts welcome.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 1 of 7, by Jo22

User metadata
Rank l33t++
Rank
l33t++

No ideas ? Come on, don't be shy! 😉

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 2 of 7, by vladstamate

User metadata
Rank Oldbie
Rank
Oldbie
Jo22 wrote:
Hi, just stumbled over a datasheet of the Motorola MC146818. That chip was used in the IBM AT -and- some PC/XT clones a long tim […]
Show full quote

Hi, just stumbled over a datasheet of the Motorola MC146818.
That chip was used in the IBM AT -and- some PC/XT clones a long time ago.
(Source: http://www.lpjjl.net/pgm/fichiers/docasm/RTC.txt)

Originally, the PC/XT had no RTC, but could be upgraded with third-party RTCs (like the DS1216E),
in which case it required a little utility to sync the DOS clock with one of them.

What took my attention was the Programmable Square-Wave Output Signal.

Now I wonder - In the PC/AT, is that output connected to the PC Speaker, too ?

No, it is not connected to the speaker.

Jo22 wrote:

And if so, could it be used as a tone generator ?

I do not believe the frequency is high enough to do anything. Plus the timer chip in the XT and AT already do that. They are connected to the speaker and generate proper frequencies. What do you think the RTC can do more?

Jo22 wrote:

If not, how was the alarm feature beeing used or implemented back then ?

Was this task up to the BIOS, DOS (ie, display alarm message, cause an interrupt, make beeps, etc.) ?

Correct, it was implemented via an interrupt. You program it with port 0x70 and 0x71 and you get an interrupt for when an alarm is happening. It was up to the BIOS or the OS (which could hijack that interrupt) to do everything else (messages, sounds, etc).

YouTube channel: https://www.youtube.com/channel/UC7HbC_nq8t1S9l7qGYL0mTA
Collection: http://www.digiloguemuseum.com/index.html
Emulator: https://sites.google.com/site/capex86/
Raytracer: https://sites.google.com/site/opaqueraytracer/

Reply 3 of 7, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Thanks a lot for your reply! 😀

vladstamate wrote:

[

Jo22 wrote:

And if so, could it be used as a tone generator ?

I do not believe the frequency is high enough to do anything. Plus the timer chip in the XT and AT already do that. They are connected to the speaker and generate proper frequencies. What do you think the RTC can do more?

Well, I thought that RTC chip was a general-purpose clock module. Something that was used to build alarm clocks, too.
So I hoped that module was able to produce audible tones, just like an ordinary alarm clock or wristwatch would be able to.
All in all, this would have been interesting to experiment with. Even though if the PC speaker had been on par with that
tone generator or if it had been better, it would have had provided another audio channel. That's why I asked.

By the way, speaking of the PC speaker or more precisely, the i8253 PIT:
Do you know of other computer platforms that used it as a tone generator ? 😕
I mean, platforms that made full use of it as a tone generator ?
From what I read, the PC speaker gets only one counter (counter 2 ?) for producing sounds.

The reason I ask, is, because I love chip tunes of all sorts, including simple tone generators (incl. 555 based ones)
and because I grew up with the Sharp MZ series, which included an i8253 "PC speaker", too. 😊
Speaking of the Sharp MZ line, it seemed to have had more channels/counters dedicated to the speaker.
Please excuse my imprecise wording.. What I mean is the type of sound effect like used in DEFENDER.
I made a recording (bad, since the emulator is DOS based and uses speaker-passthrough) here.
The sound effects of the "attack wave completed" screen sounds not like a typical IBM PC-Speaker SFX.

Edit: Just made a new video. It shows the game running on a good MZ-800 emulator, with better sound support.
It's available here: https://youtu.be/ZrNZ7-jV8p4?t=100

Last edited by Jo22 on 2018-07-17, 12:11. Edited 1 time in total.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 4 of 7, by Scali

User metadata
Rank l33t
Rank
l33t
Jo22 wrote:

From what I read, the PC speaker gets only one counter (counter 2 ?) for producing sounds.

Yes, the PC speaker is connected to the 8255 PPI chip.
The 8255 can either control the PC speaker directly (you can toggle a bit to make the cone go 'in' or 'out'), or it can connect the PC speaker to channel 2 of the 8253 timer.
The timer then has two useful modes to generate sound: square wave and one-shot countdown.
Square-wave will obviously generate a square wave signal. The one-shot countdown allows you to create any waveform via PWM, so you can use it for sample playback.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 5 of 7, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Thank you very much for the quick and precise explanation, Scali! ^^
I've always wondered about these details. For some reasons, other platforms sounded more melodic
to me when using the 8255/8253 speaker.

Even Windows 3.x platform. To name an example, one game that took my attention was
"Jiji and the mysterious forest" (not listed at Mobygames) when I was a kid at age 7 or so.
It's a naive little J-RPG. 😊

Do you have any clue, perhaps, which technique is uses to produce such melodies ?
Any special combination of 8255 and 8253, or by using the WIndows timer, perhaps ?
- It doesn't sound like the typical BASICA game, Sierra AGI game or DOS game I know of.

I have recorded a video about it, since the other people on YT seemed to oversee
the fact that it used the speaker for background music (BGM).
https://youtu.be/LM8gPlANYCg

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 6 of 7, by Scali

User metadata
Rank l33t
Rank
l33t
Jo22 wrote:

Do you have any clue, perhaps, which technique is uses to produce such melodies ?

Well, unless I missed something, it sounds like pretty standard 'beep' stuff to me?
So 8253 generating square wave, and using the PPI to turn the speaker on and off for each note.
Windows has the beep() API for that, perhaps that is what they use: https://msdn.microsoft.com/en-us/librar ... s.85).aspx
Then again, in Win16 they could program the hardware directly.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 7 of 7, by yawetaG

User metadata
Rank Oldbie
Rank
Oldbie
Scali wrote:

The timer then has two useful modes to generate sound: square wave and one-shot countdown.
Square-wave will obviously generate a square wave signal. The one-shot countdown allows you to create any waveform via PWM, so you can use it for sample playback.

If the two sound modes can be used at the same time, then you could use one mode's output to modulate the other one's output (like on many synthesizers).