DimonSE / open9x

Automatically exported from code.google.com/p/open9x
0 stars 0 forks source link

Add stock buzzer support for G9X V4.x board #64

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently (r1197) open9x has support for the PWM driven "speaker" (to make 
beeps and buzzes of varying tone) -- and the haptic motor.

However, many people are finding the headphone inserts used as a speak are too 
quiet at the field -- especially for alarms.

The G9X v4.1 board also has the original, stock piezo buzzer ("shreeeeker", in 
some cases) connected, PORTE[3].

It would be nice to have this buzzer added to the SETUP screen, in just the 
same way that Haptic already is -- only without "strength", I guess.

So the screen might end looking something like ...

RADIO SETUP       1/8
Speaker Mode    NoKey
Speaker Length  --|--
Speaker Pitch   0
Piezo Mode      Alarm       <===== Piezo options added
Piezo Length    ---|-       <=====
Haptic Mode     Alarm
etc

You might prefer the word "Beeper" instead of "Piezo", since it is probably a 
little more accurate.

The piezo buzzer/beeper is generally very loud -- arguably too loud in some 
radios I have worked on. This would be good for alarm sounds, if nothing else. 
For me, general key clicks and the like would remain on the speaker. Other may 
prefer those on the piezo as well -- especially in noisy or windy sloping 
conditions.

My guess is that this support could be added quite quickly throughout the 
system by simply changing a a handful of existing macros, currently in use for 
either haptic or speaker output. (???) 

(The code is mostly too complex and changing too fast for me to follow now, 
sorry. Otherwise I'd have a go at a patch to send you. I figure something this 
simple would take you less than 10 minutes. It would take me half a day just to 
figure out where to put it -- and probably still not get it done right.)

Thanks. :-D

Gruvin.

Original issue reported on code.google.com by gru...@gmail.com on 4 Aug 2012 at 7:28

GoogleCodeExporter commented 9 years ago
Of course, you do not need to oscillate the piezo to make beeps. It is a 
self-containing beeper. If PORTE[3]=1, then the beeper is turned on, emitting a 
non-stop "shreeeek" -- at a hardware fixed frequency --until PORTE[3]=0.

You can however "warble" the tone for different effects, but turning the beeper 
on and of at between 10 to 100Hz. But I see no point in doing that, given the 
other sound output options we also have now. Actually, for the stock board, 
this warble feature is probably still present, from the original er90x code.

I guess that's another option, too ... to have a choice of Speaker or Piezo, 
rather than both at the same time. But I would prefer both. :-D

Thanks again.

Original comment by gru...@gmail.com on 4 Aug 2012 at 7:32

GoogleCodeExporter commented 9 years ago
Should be flagged Enhancement, not Defect. (I don't recall getting the option. 
*shrug*)

Original comment by gru...@gmail.com on 4 Aug 2012 at 10:31

GoogleCodeExporter commented 9 years ago
Here's an enhancement for you :)

Original comment by bernet.a...@gmail.com on 4 Aug 2012 at 1:36

GoogleCodeExporter commented 9 years ago

Original comment by gru...@gmail.com on 21 Aug 2012 at 1:35

GoogleCodeExporter commented 9 years ago
Now possible to have AUDIO=YES and BEEPER=YES in the same time

Original comment by bson...@gmail.com on 3 Apr 2013 at 9:14

GoogleCodeExporter commented 9 years ago
So then, they both make sound together? Or is there a new menu item to allow us 
to assign event levels to the beeper, as we can for the haptic output?

Original comment by gru...@gmail.com on 4 Apr 2013 at 1:09

GoogleCodeExporter commented 9 years ago
Right, there is a new menu item. Only if you compile with AUDIO=YES and 
BEEPER=YES

Original comment by bson...@gmail.com on 4 Apr 2013 at 5:11

Attachments:

GoogleCodeExporter commented 9 years ago
AWESOME! :-D

Original comment by gru...@gmail.com on 4 Apr 2013 at 6:53

GoogleCodeExporter commented 9 years ago
It's not tested, would you do it?

Original comment by bson...@gmail.com on 4 Apr 2013 at 7:05

GoogleCodeExporter commented 9 years ago
Actually, I started that process some hours ago. But I recently upgraded my 
iMac computer and didn't realise I'd lost all the AVR developer tools! 

I have just now got everything working again (AVR-GCC 4.7.2 compiled and 
installed again, along with Fox Toolbox, Qt4 and Python with PyQt) and I can 
finally compile open9x (and simu) source again. :-D

But now I am too tired. I'll install the trunk firmware on my test radio 
tomorrow. Will let you know how it goes.

Original comment by gru...@gmail.com on 4 Apr 2013 at 9:18

GoogleCodeExporter commented 9 years ago
Bryan hmmm. It's opentx now, not open9x :)

Original comment by bson...@gmail.com on 4 Apr 2013 at 9:20

GoogleCodeExporter commented 9 years ago
Oh! I hadn't caught up with that fact. SVN still works at 
open9x.googlecode.com. So I didn't realise.

Does this mean I don't have the latest version? Am I supposed to check out 
opentx.googlecode.com/svn???

Original comment by gru...@gmail.com on 4 Apr 2013 at 9:26

GoogleCodeExporter commented 9 years ago
Yes, here is the commit:
https://code.google.com/p/opentx/source/detail?r=2204

Original comment by bson...@gmail.com on 4 Apr 2013 at 9:29

GoogleCodeExporter commented 9 years ago
OK, got it. (I could not sleep. It's 2:22am and I just got up to check emails, 
so I don't go too crazy. :-P)

For what it's worth, opentx-r2207 just compiled 100% OK (no errors/warnings) on 
my OS X 10.8.3 system, using avr-gcc v4.7.2, Python 2.7.3 etc.

I dare not fire up the test radio to try the beeper at this hour, so will wait 
until I wake later, probably around 00:30 UTC. Looking forward to it.

Original comment by gru...@gmail.com on 4 Apr 2013 at 1:26

GoogleCodeExporter commented 9 years ago
Have a good night then! And don't forget to use the AUTOSOURCE option ;)

Original comment by bson...@gmail.com on 4 Apr 2013 at 1:28

GoogleCodeExporter commented 9 years ago
What does AUTOSOURCE do? 

(Not going back to bed until I feel like I can sleep.)

Original comment by gru...@gmail.com on 4 Apr 2013 at 1:31

GoogleCodeExporter commented 9 years ago
Select the input automatically by moving the control instead of having to 
scroll through the source list :)

Original comment by bernet.a...@gmail.com on 4 Apr 2013 at 2:05

GoogleCodeExporter commented 9 years ago
I thought that was AUTOSWITCH. Oh -- sticks as well now. OK.

Anyway, I tested BEEPER=YES just now. The code compiles OK and the new option 
appears on screen. But when I select "Alarm", I am unable to hear any beeps. 
Actually, I do not know any alarm conditions except low battery. I used only 
that to test. Got the speaker alarm sounds, but no beeps.

In any case, the beeper needs also to have, "NoKey" and "All" options, not just 
"Quiet" and "Alarm" -- because the main reason to have the beeper present and 
working on the gruvin9x board in the first place is for folks who have not got 
a speaker (or cannot find one loud enough.) Those people want to hear key beeps 
etc, in a similar way to how people with a speaker can.

Thanks again.

Original comment by gru...@gmail.com on 5 Apr 2013 at 1:48