Post Reply 
Sound/Beeper Software / Hardware acces on HP48
10-02-2016, 04:46 PM
Post: #1
Sound/Beeper Software / Hardware acces on HP48
Does anyone have experience directly accessing the 'Beeper' output on the Saturn processor in the HP48.

I realize that this is a single pin and not a conventional DAC (Digital to Analog Convertor) as one might like/expect.

There have been some interesting examples in the (distant!?) past....in particular a couple that come to mind were named something like 'TV' and 'Television' as found in hpcalc.org and the fine Horn disks. The aforementioned apps obviously directly accessed the beeper - producing a convincing static, relatively wide audio bandwidth.

I've studied all of the available hardware/assembly documents on the HP48, and I find no reference to beeper/sound functionality.

Any helpful recommendations are greatly appreciated,
TomC
Find all posts by this user
Quote this message in a reply
10-02-2016, 06:46 PM
Post: #2
RE: Sound/Beeper Software / Hardware acces on HP48
(10-02-2016 04:46 PM)TomC Wrote:  Does anyone have experience directly accessing the 'Beeper' output on the Saturn processor in the HP48.

I realize that this is a single pin and not a conventional DAC (Digital to Analog Convertor) as one might like/expect.

There have been some interesting examples in the (distant!?) past....in particular a couple that come to mind were named something like 'TV' and 'Television' as found in hpcalc.org and the fine Horn disks. The aforementioned apps obviously directly accessed the beeper - producing a convincing static, relatively wide audio bandwidth.

I've studied all of the available hardware/assembly documents on the HP48, and I find no reference to beeper/sound functionality.

Any helpful recommendations are greatly appreciated,
TomC

Try here:

http://www.hpcalc.org/details/1753

Section 4.8 is what you are looking for.
Find all posts by this user
Quote this message in a reply
10-05-2016, 07:17 AM
Post: #3
RE: Sound/Beeper Software / Hardware acces on HP48
(10-02-2016 06:46 PM)Claudio L. Wrote:  
(10-02-2016 04:46 PM)TomC Wrote:  Does anyone have experience directly accessing the 'Beeper' output on the Saturn processor in the HP48.

I realize that this is a single pin and not a conventional DAC (Digital to Analog Convertor) as one might like/expect.

There have been some interesting examples in the (distant!?) past....in particular a couple that come to mind were named something like 'TV' and 'Television' as found in hpcalc.org and the fine Horn disks. The aforementioned apps obviously directly accessed the beeper - producing a convincing static, relatively wide audio bandwidth.

I've studied all of the available hardware/assembly documents on the HP48, and I find no reference to beeper/sound functionality.

Any helpful recommendations are greatly appreciated,
TomC

Try here:

http://www.hpcalc.org/details/1753

Section 4.8 is what you are looking for.

It's not so easy as it looks like.

The delay for the half time period of the frequency must be generated by CPU waiting. Therefore you're creating a loop and with the knowledge of the CPU cycles for each opcode you know the overall CPU cycles and so the delay.

But, on all Saturn calculators with external static memory, in the case of the HP48 these are ROM and also RAM data access, most of the CPU cycles for each opcode are differ when they are executed on an even or odd address. So in consequence, your code is lying in RAM, you must be sure that your delay code always begin on an even or odd address, depending what cycles you use for calculation.

The beep code of the HP48 is lying in ROM, so the address of the the delay code never move. With an assembler trick in connection with the BSS assembler command HP force the delay code lying on an even address.

Next and final point, the CPU speed is not constant and depend on temperature, humidity and other factors. To get a better accuracy the CPU speed is measured from time to time. Writing an own beeping routine should include this speed correction also.

Conclusion, to get best results use the =makebeep entry for sound output on the HP48.
Visit this user's website Find all posts by this user
Quote this message in a reply
10-05-2016, 01:41 PM
Post: #4
RE: Sound/Beeper Software / Hardware acces on HP48
Christoph:

Thank you for your helpful/informative reply.

If you have any code segments to share, that would be highly appreciated.

TomC
Find all posts by this user
Quote this message in a reply
10-05-2016, 05:36 PM
Post: #5
RE: Sound/Beeper Software / Hardware acces on HP48
(10-05-2016 01:41 PM)TomC Wrote:  Christoph:

Thank you for your helpful/informative reply.

If you have any code segments to share, that would be highly appreciated.

TomC

I'm mainly coming from the other direction. The main question for me was, how to convert the digital output on the OUT pin to a sound output for Emu48?

Here's an assembler code example for a 400Hz tone with 5s duration. The beep flag must be enabled, the clock should be off.

Code:

TITLE Tone 400Hz 5s

ASSEMBLE
  NIBASC /HPHP48-E/

RPL
CODE
        GOSBVL  =SAVPTR         save register

        P=      0
        LC(5)   400             D[A] frequency (hz) = 400Hz
        D=C     A
        LC(5)   5000            C[A] beep duration (ms) = 5s
        GOSBVL  =makebeep

        GOVLNG  =GETPTRLOOP
ENDCODE
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)