PICaxe seems to be taking power from an input pin

Jack Hale

New Member
I'm working on a system with one PICaxe-18M2+ as master and several as slaves on a ring (data and ground).
The master is driving the ring directly from pin B.3 set as O/P and each slave is connected directly to it on pin C.1 set as I/P.
With master set with <high B.3>, I find that when I connect the slave to the ring without power, the slave is powered up and starts to run its program. This makes the B.3 voltage droop from 5.0V to 3.6V

I think it must be drawing power from pin C.1 because there is no other connection. Is this a known phenonenon?

Is it reasonable to connect pins directly like this or should I be using some sort of buffer? The length of the ring is currently about 2m, but I'd hope to get it up to about 10m with a dozen or more slaves if I get it working properly.
 

Buzby

Senior Member
Yes, you can power many ICs through their I/O pins, but it's definately not a good idea.

The effect is caused by the protection diodes in these ICs, which start conducting if the input pin level is higher than the power supply pin level.

If you must have unpowered slaves on the bus, then put a 1K resistor between the bus and the slave's input pin. This will limit the current, which should stop unwanted code execution.

Cheers,

Buzby
 

lbenson

Senior Member
I think it must be drawing power from pin C.1 because there is no other connection. Is this a known phenonenon?
Yes, as Buzby says--"parasitic power". I've seen it happen with serial connections, and it can cause quite perplexing behavior until you figure out what it is. Fixed in my case with, as Buzby says, a 1K or greater series resistor on the offending pin.
 

AllyCat

Senior Member
Hi,

Yes, it's an example of "Phantom Powering" as described by Buzby and lbenson. But I'm not sure that a 1k resistor would be a reliable solution (it depends what is connected/loading the Slaves). A PICaxe running at its default 4 MHz with little connected to it, drains only around 700uA and may keep running down to around 2 volts. So you might need a series resistor of nearer 10k, and/or put a load resistor across its supply rail to ground. Or, depending on the nature of the "Ring" communications, use a diode to prevent current flowing into the Slave (note that you can enable the Weak Pullup internal resistor(s) to bias a current through the diode).

Cheers, Alan.
 

inglewoodpete

Senior Member
Yes, it's an annoying "feature" of many digital chips. In the past, I've had to use an optoisolator to disconnect an external power source that was keeping my microcontroller from shutting down properly. It can prevent small to mid-size PICAXEs from rebooting when attempting a power-cycle-reset. (28X2 and 40X2 chips have a reset pin).
 

Goeytex

Senior Member
Ghost powering is caused by current flowing through an internal ESD diode to the chip's internal positive rail. These internal diodes are on all I/O pins except the Reset/MCLRE Pin. This is very common when a USB/TTL adapter is connected and where the TX signal from the adapter idles high. This high TX signal is applied to the Picaxe RX pin and feeds through the upper ESD diode to the internal power rail, powering the microcontroller when Vdd is removed.

A typical solution is to place a pull up resistor on the Picaxe input pin and a series diode in the signal line (anode facing the input pin). This way the high is supplied by the pull up and the Low is supplied by the external device. This will work with TTL/Serial but may not work with other communication methods/protocols. I keep a bin full of BAT85 diodes for just this purpose.

The simplest solution is to use a series resistor with a value that reduces current to a point where the Picaxe no longer powers up. However, this may cause comm issues with long distance runs (over a few feet).

An opto-isolater can also work very well but is more expensive and may use more board area.

What solution is chosen depends upon the comm protocol, distance, and budget.
 

Jack Hale

New Member
Thanks to you all for your very informative replies.

In the end I've fixed the problem by using a tri-state line driver on the master and only enabling it to send data. Ths was partly to forstall potential problems when I increase the length of the bus and the number of slaves on it. The 74NH367 costs about 40p, but hang the expense!

Thanks to Goeytex for the hint on the use of USB/serial addapter with PC. That is exactly what I'm doing to set up the master from a PC running Octave (Matlab clone). I had not noticed this phantom powering, probably because I have not watched what the master is doing when it's unpowered. I'll certainly make the mods you suggest.
 
Top