The PSION Organiser II Homepage
Forum Home Forum Home Help Help Search Search Members Members Login Login Register Register

Welcome, Guest. Please Login or Register.
Why register?
   The Psion Organiser II Forum
   User Forum
   Help
(Moderator: Mikesan)
   Controlling the buzzer
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Controlling the buzzer  (Read 986 times)
Sora
Administrator




   


Posts: 57
Controlling the buzzer
« on: Feb 16th, 2013, 6:35pm »
Quote Quote Modify Modify

I'm working on writing a new psion2 emulator for windows and unix (Me and Boris (RIP) mentioned it somewhere else on here a while ago).
 
I'm just looking at implementing the code for the buzzer emulation, however I don't know how the buzzer is controlled by the OS. In machine code I always have called the buzzer routines, ive never done it myself.
 
So if anyone knows how to control the buzzer directly (machine code example would be great), or point my to some useful info, so I can write the emulator code. That would be great.

Psiora - Psion II Emulator by Scott Richards
New download coming soon...
POISN
active Member




   


Posts: 48
Re: Controlling the buzzer
« Reply #1 on: Mar 10th, 2013, 8:36am »
Quote Quote Modify Modify

The buzzer is driven by software. It is connected to the ALARM signal on the power supply board. The OS call simply turns the ALARM signal on and off many times per second (thus producing a square wave with 50% duty cycle) which is what produces a tone on the beeper. What happens when the OS routine is called to produce a beep at a given frequency for a given duration is that it first sets up a timer for the desired duration. The number you give it for the frequency just tells it how many times to loop on an inner delay loop before toggling ALARM. This is the reason for the formula given in the programming manual: freq=921600/(78+2*y%). The CPU runs at 921600 cycles per second, the outer loop takes 78 cycles to execute, and the inner loop takes two cycles to execute. When the timer has run out, the routine returns.
Sora
Administrator




   


Posts: 57
Re: Controlling the buzzer
« Reply #2 on: Mar 10th, 2013, 8:52am »
Quote Quote Modify Modify

Thank you, this makes sense.
So as far as emulation is concerned, I should just create that tone through the speakers everytime the alarm signal is altered, and the OS should do the rest itself.
 
My only other question is how do I know when the alarm signal isn't for producing sound, as I believe its used as part of datapak programming as well? I looked into it and got a bit confused. Am I right in saying that if pulse is active, the alarm is connected to datapak, and if pulse is deactived, then the alarm is connected to buzzer?

Psiora - Psion II Emulator by Scott Richards
New download coming soon...
POISN
active Member




   


Posts: 48
Re: Controlling the buzzer
« Reply #3 on: Mar 10th, 2013, 9:57am »
Quote Quote Modify Modify

The technical reference manual states that the SVPP regulator is switched on and off by a combination of the PACON_B, OE_B, and ALARM signals. To switch it on, PACON_B must be low, and both ALARM and OE_B must be high. If either ALARM or OE_B are low, then the regulator switches off. The buzzer element is driven from the ALARM signal through a 1K resistor.
 
If you want the emulator to isolate buzzer operation from datapack writing, then you could have it to look at OE_B whenever ALARM is asserted, and if it's high then it's a pack writing operation, and if it's low, then it's a buzzer operation. However, isolating these functions may not be strictly necessary as the Organiser itself does not do so. The Organiser always makes a clicking sound in the buzzer when it writes to a datapack due to the sharing of the ALARM signal by the buzzer and charge pump circuitry.
« Last Edit: Mar 10th, 2013, 10:09am by POISN »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

The Psion Organiser II Forum » Powered by YaBB 1 Gold - SP 1.1!
YaBB 2000-2002,
Xnull. All Rights Reserved.
top