Why would 14M2 "high" pins be showing only 1.5v or less?

abenn

Senior Member
A couple of weeks ago I asked for help with a circuit using a 14M2 in this thread. Taking the advice offered, I moved my switch inputs, and my servo outputs, so they no longer shared the serial-in and serial-out pins with the programming circuit; and my prototype worked exactly as expected. Attached is the circuit as it stands.

ScanImage001.jpg

There are four possible position options for the Sw1 and Sw2 (open/open, closed/closed, open/closed, and closed/open) which send the two servos to corresponding positions. Before moving the servos to a new position the program sets B.3, B.4, B.5, C.0, C.1, and C.2 LOW, to extinguish the four LEDs and solid-state relays (installed, but not shown in my diagram). Once the servos have moved to a new position a HIGH is sent to the appropriate 14M2 pin to switch on an LED to indicate which of the four positions the servos are at, and to switch on the appropriate relay.

So far, so good. The prototype is working correctly on my model railway.

So then I built an exact copy, using the same PCB design and the same components (except the solid-state relays are not yet installed), and same program, but it's behaving oddly. The 14M2 programs okay, and the servos move correctly in response to the switch inputs so, presumably, all the resistors are correct value and installed correctly. But the LEDs work in the opposite manner, and more dimly, than they should -- i.e. instead of one being lit at a time, three are lit and one is out. I've visually checked the circuit board under a magnifier and can find no defects. I then measured the voltage at the 14M2 output pins B.3 to B.5 and C.0 to C.2 and found that, for each different switch combo, the pin which should be HIGH measured somewhere between 1.4 and 1.5v, while the other five pins, which should be LOW, measured somewhere between 0.0v and 0.12v. Should a HIGH pin not be at, or around, the supply voltage, which is 5.0v?

What could be causing this behaviour, please? I've already swapped the 14M2, with the same result. Could it be a faulty ULN2803? Or could a solder bridge which I haven't detected yet cause half the 14M2 pins to behave like this -- remember, the inputs on C.3 and C.4 and the servos on B.1 and B.2 seem to be working correctly.
 

Buzby

Senior Member
First I would put a 0.1uF decoupling cap across pins 1 and 14.

Then I'd check the ULN is in the right way round.

Then I'd check that the 5v to pin 10 of the ULN is OK.

After that, I'm stumped, so I'd check everything !.
 

abenn

Senior Member
I thought I had checked everything, but you've hit the nail on the head! The ULN is the wrong way round -- I was fooled by the fact that the + and - pins are at the opposite end from the little notch in the casing, opposite to the 14M2's layout. Complacency bites again. Bother!!

I do have a capacitor across the 5v supply by the way -- 1uF as recommended by the LM323 regulator supplier.

Thanks for your response.
 

rq3

Senior Member
A couple of weeks ago I asked for help with a circuit using a 14M2 in this thread. Taking the advice offered, I moved my switch inputs, and my servo outputs, so they no longer shared the serial-in and serial-out pins with the programming circuit; and my prototype worked exactly as expected. Attached is the circuit as it stands.

View attachment 20568

There are four possible position options for the Sw1 and Sw2 (open/open, closed/closed, open/closed, and closed/open) which send the two servos to corresponding positions. Before moving the servos to a new position the program sets B.3, B.4, B.5, C.0, C.1, and C.2 LOW, to extinguish the four LEDs and solid-state relays (installed, but not shown in my diagram). Once the servos have moved to a new position a HIGH is sent to the appropriate 14M2 pin to switch on an LED to indicate which of the four positions the servos are at, and to switch on the appropriate relay.

So far, so good. The prototype is working correctly on my model railway.

So then I built an exact copy, using the same PCB design and the same components (except the solid-state relays are not yet installed), and same program, but it's behaving oddly. The 14M2 programs okay, and the servos move correctly in response to the switch inputs so, presumably, all the resistors are correct value and installed correctly. But the LEDs work in the opposite manner, and more dimly, than they should -- i.e. instead of one being lit at a time, three are lit and one is out. I've visually checked the circuit board under a magnifier and can find no defects. I then measured the voltage at the 14M2 output pins B.3 to B.5 and C.0 to C.2 and found that, for each different switch combo, the pin which should be HIGH measured somewhere between 1.4 and 1.5v, while the other five pins, which should be LOW, measured somewhere between 0.0v and 0.12v. Should a HIGH pin not be at, or around, the supply voltage, which is 5.0v?

What could be causing this behaviour, please? I've already swapped the 14M2, with the same result. Could it be a faulty ULN2803? Or could a solder bridge which I haven't detected yet cause half the 14M2 pins to behave like this -- remember, the inputs on C.3 and C.4 and the servos on B.1 and B.2 seem to be working correctly.
Not relevant to your immediate question, but you could probably get rid of the four resistors on your two switch inputs by using the "pullup" command to apply a soft, internal pull-up resistor to your intended input pins. You may have to switch things around a bit, since not all pins have internal pull-ups available.
Also, the picaxe is more than capable of recognizing a series of HI-LO-HI-LO inputs from a mechanical switch as it vibrates to its final state (closed or open). A small (0.001 uF) capacitor from the input pin to ground may avoid this, depending on the switch. The way you are now is probably OK, since the 10K pull-ups are pretty "stiff", but it's your choice. Four resistors, 2 caps, neither, both, different switch? Just one of those pesky engineering decisions! The decision is usually based upon the consequence of failure, and the price of implementation. Just a thought.
 

inglewoodpete

Senior Member
Some current-limiting resistors in series with each of the LEDs would be a good idea, unless you are using LEDs with internal resistors.
 

abenn

Senior Member
Thanks rq3, I'll look into the PULLUP command, as I'm not familiar with it. My electronics lack-of-knowledge is such that I use the standard interfaces from the manual until someone shows me a better/different way to do things!

I've just read the PULLUP section of the manual and, if I'm understanding it correctly, I first enable PULLUP in the init: part of my program on whichever pins I want to use as switch inputs, and then I simply connect my switch between that pin and ground instead of using the resistor network.

inglewoodpete, thanks for the comment, but what I didn't show in my diagram is I'm using 10mA LED driver devices in my LED outputs.
 
Top