cancel
Showing results for 
Search instead for 
Did you mean: 

Generating Beep sound using PWM

pranathi1091
Associate II
Posted on November 02, 2012 at 07:01

Hi all

I am using stm32f2XX. I want to write a source code to generate beep sound by providing PWM input . Could anyone pls suggest me in how to proceed with this.

Thanks

#think! #beep #about-pwm-input
9 REPLIES 9
Posted on November 02, 2012 at 11:42

I am using stm32f2XX. I want to write a source code to generate beep sound by providing PWM input . Could anyone pls suggest me in how to proceed with this.

Input? I'm confused. What Input/Output are you looking for, what frequency/pwm do you want to generate?

There should be a whole heap of PWM examples within the firmware libraries (STM32 various) and I've posted a bunch to the forum.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Andrew Neil
Evangelist III
Posted on November 02, 2012 at 18:37

''Input? I'm confused!''

Me too!

''Could anyone pls suggest me in how to proceed with this''

 

You need to start with a clear specification of your requirement - independent of implementation details (such as STM32 and PWM); ie, you need to define what you are trying to achieve.

Once you have a clear definition of define what you are trying to achieve, you can then - and only then - move on to think about how you might achieve that end...

It is a common mistake to get bogged-down in the ''how''  before properly defining the ''what''.

http://www.catb.org/~esr/faqs/smart-questions.html#goal

sameh_ayari_ge
Associate
Posted on March 26, 2014 at 16:37

HELLO

how can I generate beep sound  with stm32 ,please help

thanks,,

Posted on March 26, 2014 at 16:44

HELLO  how can I generate beep sound  with stm32 ,please help thanks,,

Does it take a lot of effort and practice to be this clueless?

It would surely depend on the type of STM32, the pins being used, and the device being used to emit the sound.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Andrew Neil
Evangelist III
Posted on March 26, 2014 at 23:52

''how can I generate beep sound  with stm32''

In much the same way that you'd do it with any other device!

A beep is just a signal which goes up & down - or turns on & off - at a suitable audible rate.

Study the STM32 documentation;

think

  about how you could use the facilities described therein to generate such a signal...

chen
Associate II
Posted on March 27, 2014 at 16:20

Please bear in mind that the STM32 IO port bit does not have the capability to drive a speaker directly.

It is capable of generating the signal but a transistor or op-amp must be used to driver the speaker. There has been at least one other thread discussing this.

Andrew Neil
Evangelist III
Posted on March 27, 2014 at 21:08

''STM32 IO port bit does not have the capability to drive a speaker directly''

Depends how loud you want the beep to be!

Could certainly drive a piezo sounder...

jj2
Associate II
Posted on March 28, 2014 at 00:28

Clive1: ''Does it take a lot of effort and practice to be this clueless?''   Classic...

Does quickly smoldering/carbonized - board/component - qualify as a ''beep?''

Posted on March 28, 2014 at 01:42

Yeah, sorry that was a bit mean, I got frustrated with the lack of any thought.

The poster didn't read the thread, or the asking questions page.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..