Discussion:
[nuttx] [PATCH] Add Audio Tone Generator for NuttX [1 Attachment]
Alan Carvalho de Assis acassis@gmail.com [nuttx]
2016-08-16 19:02:00 UTC
Permalink
Hi Greg,

Please find attached the patch to add the Audio Tone Generator for NuttX.

I put a small video here (quality is not good) demonstrating it working:


BR,

Alan
Gregory Nutt spudarnia@yahoo.com [nuttx]
2016-08-16 19:20:43 UTC
Permalink
Alan,

Very cool! Committed!

Greg
[Attachment(s) <#TopText> from Alan Carvalho de Assis included below]
Hi Greg,
Please find attached the patch to add the Audio Tone Generator for NuttX.
http://youtu.be/wvsWbqwyNqo
BR,
Alan
Alan Carvalho de Assis acassis@gmail.com [nuttx]
2016-08-16 19:27:39 UTC
Permalink
Thank you Greg,

I think we could to remove the need for lib MATH, just creating a
table with the frequencies for each note.

BR,

Alan
Post by Gregory Nutt ***@yahoo.com [nuttx]
Alan,
Very cool! Committed!
Greg
[Attachment(s) <#TopText> from Alan Carvalho de Assis included below]
Hi Greg,
Please find attached the patch to add the Audio Tone Generator for NuttX.
http://youtu.be/wvsWbqwyNqo
BR,
Alan
spudarnia@yahoo.com [nuttx]
2016-08-16 20:32:20 UTC
Permalink
I see the video: http://youtu.be/wvsWbqwyNqo

But no sound?
Ken Pettit pettitkd@gmail.com [nuttx]
2016-08-16 20:42:05 UTC
Permalink
Audio worked for me.

Ken
Post by ***@yahoo.com [nuttx]
I see the video: http://youtu.be/wvsWbqwyNqo
But no sound?
Gregory Nutt spudarnia@yahoo.com [nuttx]
2016-08-16 20:52:20 UTC
Permalink
Post by Ken Pettit ***@gmail.com [nuttx]
Audio worked for me.
I tried again.. still no audio. I see that Alan also posted this:
https://acassis.wordpress.com/2016/08/16/playing-gorilla-bas-tune-on-nuttx/

Alan... what kind of hardware would people need in order to use the tone
generator?

Greg
Alan Carvalho de Assis acassis@gmail.com [nuttx]
2016-08-16 21:07:51 UTC
Permalink
Hi Greg,

The audio in the youtube video is low. You need to put your computer
volume to 100% to hear it.

To use the tone generator people need to use a 3V buzzer connected to
PA1 (default config to STM32F103Minimum board), but it will be low. On
my board I have a transistor to amplify the signal. See attached image
for reference.

BR,

Alan
Post by Gregory Nutt ***@yahoo.com [nuttx]
Post by Ken Pettit ***@gmail.com [nuttx]
Audio worked for me.
https://acassis.wordpress.com/2016/08/16/playing-gorilla-bas-tune-on-nuttx/
Alan... what kind of hardware would people need in order to use the tone
generator?
Greg
Gregory Nutt spudarnia@yahoo.com [nuttx]
2016-08-16 21:45:26 UTC
Permalink
Hi, Alan,
Post by Alan Carvalho de Assis ***@gmail.com [nuttx]
The audio in the youtube video is low. You need to put your computer
volume to 100% to hear it.
Yes.. that was the problem. It really does need the transistor!
Post by Alan Carvalho de Assis ***@gmail.com [nuttx]
To use the tone generator people need to use a 3V buzzer connected to
PA1 (default config to STM32F103Minimum board), but it will be low. On
my board I have a transistor to amplify the signal. See attached image
for reference.
There are some buzzer boards with a transistor on eBay. I bought a
couple of these so that maybe I can tinker with the tone generator in
the future. http://www.ebay.com/itm/281782851548

Greg
phreakuencies@gmail.com [nuttx]
2017-05-14 20:39:11 UTC
Permalink
Hi, I'm looking at the tone driver and would like to use it. I understand this is for a passive buzzer right?


Is there an example of its use? I understand there is a "language" used to define the tone.


Best,
Matias
Alan Carvalho de Assis acassis@gmail.com [nuttx]
2017-05-14 21:15:25 UTC
Permalink
Hi Matias,

Yes, the tone generator follows the language used on QBasic. This code
was based on PX4 audio generator.

Do you remember Gorillas.bas? This was the first "game" I ever played
in a computer:


I recall I submitted a board config to get audio tone working on
stm32f4discover, but I didn't see it there, maybe it broke because
latest modifications in the timer subsystem and was removed. No idea.

Greg, do you know about it?

Matias, BTW you can test it using "git checkout" to an old commit.

BR,

Alan
Post by ***@gmail.com [nuttx]
Hi, I'm looking at the tone driver and would like to use it. I understand
this is for a passive buzzer right?
Is there an example of its use? I understand there is a "language" used to
define the tone.
Best,
Matias
spudarnia@yahoo.com [nuttx]
2017-05-14 21:38:48 UTC
Permalink
Are you sure that was not the STM32F103 Minimum board:

$ find . -name *tone*
./stm32f103-minimum/audio_tone
./stm32f103-minimum/src/stm32_tone.c
Alan Carvalho de Assis acassis@gmail.com [nuttx]
2017-05-15 00:46:18 UTC
Permalink
Oh yeah, it was stm32f103-minimum board!

Thank you for finding it! ;-)

BR,

Alan
Post by ***@yahoo.com [nuttx]
$ find . -name *tone*
./stm32f103-minimum/audio_tone
./stm32f103-minimum/src/stm32_tone.c
Loading...