RTC as a sound chip / tone generator ?

Announcements, advice, random banter, unrelated discussion, et cetera.

RTC as a sound chip / tone generator ?

Postby Jo22 » 2018-7-06 @ 23:21

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//
User avatar
Jo22
l33t
 
Posts: 2619
Joined: 2009-12-13 @ 07:06
Location: Europe

Re: RTC as a sound chip / tone generator ?

Postby Jo22 » 2018-7-12 @ 21:26

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//
User avatar
Jo22
l33t
 
Posts: 2619
Joined: 2009-12-13 @ 07:06
Location: Europe

Re: RTC as a sound chip / tone generator ?

Postby vladstamate » 2018-7-13 @ 17:24

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 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).
User avatar
vladstamate
Oldbie
 
Posts: 826
Joined: 2015-8-23 @ 01:43

Re: RTC as a sound chip / tone generator ?

Postby Jo22 » 2018-7-17 @ 11:42

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 ? :confused:
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. :blush:
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-7-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//
User avatar
Jo22
l33t
 
Posts: 2619
Joined: 2009-12-13 @ 07:06
Location: Europe

Re: RTC as a sound chip / tone generator ?

Postby Scali » 2018-7-17 @ 12:09

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.
Scali
l33t
 
Posts: 3414
Joined: 2014-12-13 @ 14:24


Return to Milliways

Who is online

Users browsing this forum: No registered users and 0 guests