Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
And perhaps MrDEB may add a diode or RC across the speaker coil to protect the transistor.The 20ma RB3 can source is not enough to drive a speaker, you need to add the simple resistor and transistor driver as shown by be80be.
What you're going to find out is with programming there are almost unlimited ways of doing something. It's confusing at first but stick with it and you'll get the hang of it.
You may be correct if the driving transistor is working in linear mode and handling a sine wave. but an unbiased transistor driving a square wave into a speaker at its collector, I feel, definitely produces back emf and should be protected. I saw many such schematics where such protection is provided. Shortly, i shall be able to provide links to confirm my thought.He don't need one. It's a speaker not a motor. Use a diode on a motor or relay not a speaker.
back-emf to make sound
its not going to hurt his little npn because it never going to send back more then his little npn can handle.Now if it was a 12volt motor then for sure put a diode on it.The subject of "back-EMF" from speaker drivers is one that has surfaced from time to time across many decades of audio engineering, and it always seems to get much discussion, much disagreement, and not a lot of conclusions reached. Atmasphere brought this up in the related thread of "why amps sound different", and it inspired me to do a couple of experiments.
1.It lowered the output of the speaker with it and the sound wasn't right. Diode in thereand it inspired me to do a couple of experiments
Device = 18F1320
Clock = 8 // tells the compiler the FOSC speed
Config OSC = INTIO2, WDT = OFF, LVP = OFF
Include "Utils.bas"
Dim out As PORTB.3
OSCCON = %01111111
SetAllDigital
Low (PORTB.3)
While true
High (out)
DelayUS (1400) // justs change this to change sound
Low (out)
DelayUS (700) // and this to
Wend
Subroutines and Functions
function Reverse (pValue as TType, pAmount as byte) as TType
function Digit (pValue as TType, pIndex as byte) as byte
function Min (pValueA, pValueB as TType) as TType
function Max (pValueA, pValueB as TType) as TType
sub Swap (byref pValueA, pValueB as TType)
function HighNibble (pValue as byte) as byte
function LowNibble (pValue as byte) as byte
sub SetAllDigital ()
I had all three and a lot more What's hard is swordfish is not the same as the basic you used then so I have to do a lot of readingVIC 20, C64 and the C128