i am a noob and learning 8051 coding. i want to know how can i use PWM to write a speaker which can emit diff sound (do,re,mi,etc.) by using 2 pins only. thanks.
thanks all very much. i can now handle the software part of my purpose, but for the hardware, i've got some difficulty. i dont know how to amplify the sound of the 8ohm speaker. should i use any op-amp? or it can be done by varying the voltage?
This has nothing to do with the 8051 or Keil tools.
You need some books on basic electronics!
eg, www.kpsec.freeuk.com/trancirc.htm
HI.
the page from master neil is good.
look at the para "Choosing a suitable NPN transistor"
u can simly have the speeker for the load.
Always yo're freind.
Zeusti.