14M2 - "SOUND" no working

vk6bgn

New Member
Hello All,

I haven't posted in a long time and usually don't unless I'm having a PICAXE problem... and so I'm here today. :-(
(searched the forums last night and this morning, couldn't find anything helpful)

Making yet another very simple Morse code project with some 14M2's that were laying around rather than the usual 08M2. It's pretty simple, 9V battery, 7805CT regulator with no bypass caps, two 10k pots for Morse speed and Morse tone, 2N7000 output on B.1 and SOUND out on speaker C.1. Random or practice Words, Letters or Punctuation etc. etc. all controlled by the numerous positions of four DIP switches.

I etched out the board yesterday and wrote a few lines to test code.
Digital out on pin B.1 for the 2N7000, all good.
Both the ADC's for Morse speed and Morse tone on pinC.0 and pinC.4 are reporting back between 0 and 255, all good.
The 4 segment DIP switches (with external 10K pull downs) on B.2, B.3, B.4 and B.5 report back the numbers 4, 8, 16 or 32 when individually closed, all good.

The problem is... I can not get SOUND to work! I've even downloaded a simple test... (below) but no sound out of the speaker. Speaker is a 2" speaker in series through a 10uf tantalum cap to pin C.1. I've even tried the SOUND on B.2, B.3, B.4 and B.5 with the DIP switches 10K pull down resistors removed and still no Sound out on any of the B pins.

Code:
Start:
High b.1
Sound c.1, (100, 100)
Low b.1 
Sound c.1, (0, 100)
Goto start
*** Tested Sound 2, (100,100) on a spare 14M and it works. .... also Sound 3 (100,100), Sound 4... and Sound 5... on an old 14M and Sound works properly. ***

Manual says 14M2 Pin C.1 can be used for... kb data, hpwm B/ Out/ In (doesn't that include SOUND too?)
My three 14M2 chips all say they have firmware Ver. 6A
speaker proved good
capacitor proved good
Disconnected the programming lead after download, still no sound on C.1
Removed 10K pull down resistors on B pins, still no sound on C.1
Cannot find any issues with my circuit board artwork.
Using Win7 and Programming Editor 6.

NOTE: Another weird anomaly is when the above code is downloaded, the 2N7000 turns on and off on B.1 until I connect the speaker on C.1, then the output on B.1 stops going high. (proved with a resistor and LED on B.1) Only until I lift the neg- speaker wire from ground or lift the pos+ speaker wire from the capacitor, (other side of capacitor goes to pin C.1) will the 2N7000 on B.1 turn back on and off again. (almost like the B.1 output is being dragged down by the speaker circuit on C.1... same phenomena happens on all three 14M2 chips)

Comments, ideas and suggestions most appreciated.
Can't think of much more, help. LoL. (I know it's something simple)

Regards,
HamRadioAddict
 

premelec

Senior Member
Try a seperate power source for the speaker... i use piezo sounders for various morse output direct to PICAXE but 8 ohm speaker is too much current for a lot of power supplies...
 

hippy

Technical Support
Staff member
NOTE: Another weird anomaly is when the above code is downloaded, the 2N7000 turns on and off on B.1 until I connect the speaker on C.1, then the output on B.1 stops going high. (proved with a resistor and LED on B.1) Only until I lift the neg- speaker wire from ground or lift the pos+ speaker wire from the capacitor, (other side of capacitor goes to pin C.1) will the 2N7000 on B.1 turn back on and off again. (almost like the B.1 output is being dragged down by the speaker circuit on C.1... same phenomena happens on all three 14M2 chips)
It sounds like you have a hardware issue, perhaps have wired the 2N7000 wrongly. Perhaps post your hardware circuit. As best I can see it's -

Code:
                        _____
                        \___/
SOUND  C.1 --||----. .---|_|---.
                  _|_|_       _|_ 0V
                    |
EMABLE B.1 ---------'
Sound output from C.1 works for me when I tried it with my 14M2 and a piezo ...

Code:
#Picaxe 14M2
Do
  Sound C.1, ( 100, 100 )
  Pause 1000
Loop
 

AllyCat

Senior Member
Hi,

...regulator with no bypass caps .... , 2N7000 output on B.1 and SOUND out on speaker C.1
Yes, I think we really need to see a circuit diagram and I don't think hippy's interpretation would work (properly) because dc can't pass through a capacitor. Generally, the PICaxe pins cannot deliver enough current to drive an 8 ohm speaker directly (hence the use of a current amplifier such as the 2N7000), so why is the FET "output" (whichever lead that means) and speaker connected to PICaxe pins ?

Also, you could/should check for unexpected "Restarts" and/or try driving the "sound" output more simply, for example with :

Code:
#terminal 4800
#no_data
sertxd(" starting ")

do
  high c.1
  low c.1
loop
Cheers, Alan.
 
Last edited:

vk6bgn

New Member
Well guys,

After searching for this simple fault for many hours, the answer was in my original post above. I'll have to admit it was self inflicted and I'll have to eat a bit of humble pie. It appears that when there was a call to SOUND C.1, (100.100), the 5V 1amp regulator near the PICAXE would start to oscillate or something thereof. Burning the midnight oil and as a last resort, I soldered in a 1uf capacitor on the input and output pins of the 5V 1amp voltage regulator and ...presto, problem solved! So, moral to the story, follow standard construction practice and no shortcuts. I knew better, I've always bypassed voltage regulator pins with a .1uf and a 10uf on both the input and output pins, but ran out of real estate in this area of my project circuit board, and so, they were left out. (bad decision!)

In regards to the small 1 or 2 inch speaker in series with a 10uf capacitor connected to the 14M2 C.1 pin, I'm sure I got this simple speaker circuit from an old PDF (PICAXE manual) years ago. It may not be standard practice anymore, but I've always used it over the years without failure. It's not loud, but is audible.

Many thanks for the replies,
HamRadioAddict
 

Buzby

Senior Member
You have just learned the same lesson I learnt many years ago - NEVER USE A 7805 WITHOUT DECOUPLING CAPACITORS !!!

My teacher was a board I built with lots of CMOS chips, a 7805, but no decoupling on the 7805. The board wouldn't work, even though my testmeter showed a solid 5V rail.
After many hours of checking the wiring I put the scope on it. ( The scope was the size of a suitcase, weighed a ton, and took ages to warm up. I didn't use it much.)

The scope showed my 'solid' 5v was oscillating at about 1MHz.

I've never used a regulator without 0.1uF either side of it since !.
 

AllyCat

Senior Member
Hi,

In regards to the small 1 or 2 inch speaker in series with a 10uf capacitor connected to the 14M2 C.1 pin, I'm sure I got this simple speaker circuit from an old PDF (PICAXE manual) years ago. It may not be standard practice anymore, but I've always used it over the years without failure. It's not loud, but is audible.
It would be interesting to know exactly what output configuration you're using.

Normally a loudspeaker (particularly if in series with a capacitor) needs a "Push-Pull" driver, but a FET can only "Pull" (current into its Drain pin). If you're connecting it also to a PICaxe pin (driven high), perhaps that is using the output as a "constant current" source (classically called "Class A" amplification). That's an "interesting" approach but not very power-efficient and potentially exceeding the ratings of the "base" PIC.

However, if the current available from a single PICaxe pin gives sufficient sound level, then you probably don't need the 2N7000 at all. But if the speaker is only low impedance (say < 35 ohms) then you probably should add a series resistor, because the PIC's NMOS (pull-down) output FETs can pull more current (through a low impedance) than the data sheet permits.

Cheers, Alan.
 
Top