DIRECTLY connecting PICAXE inputs and outputs...

Grogster

Senior Member
Hi all.
:)

You know when connecting buttons and switches etc, you generally use the 10k/1k resistors on the input pin - do you need these resistors, if you are connecting a PICAXE output to another PICAXE's input, when both are running from the same supply?

My thought is NO YOU DON'T NEED THEM, as the input voltage cannot be higher then the PICAXE output pin, which is 5v.

I would just like to clarify if I need the resistors even with this kind of PICAXE-TO-PICAXE connection.

Thanks.
:)
 

yurif74

New Member
resistor are used to limit current, on inputs i use them only as pull-down resistors and the switch is directly connected, on outputs i use them only if are needed, example i use an lcd display in 8 bit mode and i've connected the entire bus and the 2 control pins without any resistors and it work great.
 

Rickharris

Senior Member
If you NEVER make mistakes then you don't need them. However some Picaxe chips have dual inputs / outputs here the resistor protects the output should the corrisponding input ever get turned on in error.

You pay your money and take your risk.
 
In case one of the picaxes gets no or less power for some reason, the other picaxe is sending out 5 V to one of the inputs on the lower powered down picaxe.
In this situation the voltage on this input may be well above Vcc and can damage the input circuit of the picaxe that has less or no power.

Just a simple resistor can prevent this damage.
 
Last edited:

cactusface

Senior Member
Hi,
Rick you know what they say!! The man who never made a mistake never made anything? We go thro' life making mistakes and hopefully learning from them. Happy building. If the PIC can't give more then 20-25ma out and only take the same in?? a 1k should be OK, just as a safely measure. but I don't know if I would bother. Like yurif74 I use 10K pullups or tie inputs LOW with the same.

Regards
Cactusface
 

manie

Senior Member
A 1K resistor costs what ?, a few cents... a Picaxe chip costs what ?, a few $$ or Pounds ? Do the maths, I'll put the resistors in-line as current limiters, could save you an Axe...
 

Dippy

Moderator
"We go thro' life making mistakes and hopefully learning from them."
- yes, absolutely, but it's a darn sight cheaper to learn from other people's mistakes.
And it's a darn sight cheaper to learn from other people's experience and knowledge and their experience in reading Data Sheets and App Notes.

"If the PIC can't give more then 20-25ma out and only take the same in??"
- Oooh. You think there is current limiting?
The only limiting is the resistance of the PIC gubbins, nothing 'special'.

The point Rick was making is that some PICAXEs pins can be outputs as well as inputs.
If you had 2 PICAXE pins connected directly together and accidentally set as Outputs and one was set High in code and the other set Low then you might kiss goodbye to one or two PICAXEs.
A PICAXE might survive under this condition if it was very brief, but a penny resistor could prevent an expensive cock up.

As said before; if you are absolutely confident then connect directly. But if there is any doubt ESPECIALLY if prototyping then use a penny resistor.
And also, as said before, accidental lack of power to one PICAXE may result in an early bath. This is quite possible with breadboarding or dodgy home-made PCBs.
Then when you are 100% confident you can remove the penny resistor if you feel the urge.

The equation: A penny resistor and a couple of square mms of board space versus (possible) extraction of credit card and a tantrum.

I prefer the 'better safe than sorry' train of thought. But it's totally up to you.
 

hippy

Technical Support
Staff member
Series / current limiting resistors can best be thought of as insurance. Not absolutely necessary, but you'll be glad you had them if something does go wrong. No one aims to make a mistake or have an accident; some haven't had accidents, but for most it's just a matter of time.

In terms of cost, it's a small expense to pay, and more so when one realises that a dead PICAXE isn't just an annoying small expense when the cost of having to get it shipped and time spent twiddling thumbs and kicking oneself is taken into account.

Of course, I don't always practice what I preach. Then there comes those times when I wish I had ;-)
 

cactusface

Senior Member
Ins and Outs...

Hi All,
I hav'ent got to the point where I need 2 or more Picaxe chips in one project, that's because I'm not really trying... But I'm sure the day will come.

So I see what you mean, if the PIC power levels were different, or if as Dippy says I/O pins are reconfigured?, when the time comes I hope I remember it.
I was just thinking of buttons and other input devices and sensors. I know someone with 3 Pics in his buggy thing! so I might progress further, hope so.:):)
Regards
Cactusface
 

BeanieBots

Moderator
The same issue can apply even with just one PICAXE.
If you only have a simple pushbutton/switch but the pin it is connected to can be configured as an output, then disaster can still strike.
 

Dippy

Moderator
I suppose we'll drivel onto LEDs and resistors next... yawn.

I love that ancient phrase "A little learning/knowledge is a dangerous thing".
or is it "A little pair of swimming trunks is a dangerous thong".
 

Grogster

Senior Member
OK, I take the point.
Will add them.

It's not the cost of the resistors, or even the board space, as both are negligable really, the PCB space is practically nothing, and the resistor cost is also - normally I put the 10k/1k on every input on any project by default.

The problem is that they are not accounted for on the PCB, as this is an afterthought, and I was thinking I could perhaps just directly connect for simplicity, otheriwse I have to build a point-to-point resistor arrangement across the input pin to deck, which won't look that neat.

I have already re-designed the PCB to acomodate the resistors on the input pin, but I'm not re-etching/re-building the PCB for the sake of two freakin' resistors. :p

Chips are 40x's using standard output on one chip, to porta on the 2nd chip.

I will install the resistors anyway - somehow. ;)
 

hippy

Technical Support
Staff member
Analyse the risk associated with not using the resistors, and of retrospectively fitting them. It may be the best option to leave the PCB as it is, leave the resistors off.
 

premelec

Senior Member
SMD R

On just about any PICAXE PCB you could cut a trace and solder a surface mount resistor across the cut gap... I've used Exacto knives and Dremel tools to do this at times...
 

JSDL

Senior Member
In case one of the picaxes gets no or less power for some reason, the other picaxe is sending out 5 V to one of the inputs on the lower powered down picaxe.
In this situation the voltage on this input may be well above Vcc and can damage the input circuit of the picaxe that has less or no power.
Why would sending 5V to the Picaxe with lesser power damage the input circuit of the other Picaxe if it has clamping diodes?
 

hippy

Technical Support
Staff member
Why would sending 5V to the Picaxe with lesser power damage the input circuit of the other Picaxe if it has clamping diodes?
If there is V on the cathode side of the clamping diode, V+K on the anode side the diode has to drop K volts, and it isn't current limited. The current through the diode in those circumstances can be higher than the diode is rated for.
 

JSDL

Senior Member
excuse my asking is K the voltage drop across the diode? So if Picaxe 1 were powered by 3 x AA and Picaxe 2 powered by 2 x AA, a high on the output from Picaxe 1 (at 4.5V) to input of Picaxe 2 would damage the chip?
 

westaust55

Moderator
Yes, K is the voltage across the internal diode.

Yes, by the datasheets the input voltage should not exceed 0.7 volts above the supply voltage.
By adding a resistor between the two PICAXE chips you will limit the current and protect both chips.

As mentioned you your other thread, an input is high impedance and draws very little current so using a10 kOhm resistor between the two PICAXE chips will protect them.
 

hippy

Technical Support
Staff member
excuse my asking is K the voltage drop across the diode?
Yes, that is correct, 4.5V input with a clamping diode to a 3V power rail would be -

Code:
Input 4.5V ---|>|--- 3.0V power rail
That puts 1.5V across the diode. Probably 0.9V (1.5V-0.6V) because the diode doesn't start conducting until at 0.6V drop.

V = I x R, I = V / R

Idiode = 0.9 / Rdiode

The higher the voltage dropped and, as Rdiode reduces towards zero, then Idiode increases towards infinity. It can easily get above the 25mA the diode is rated for and destroy the diode.
 

techElder

Well-known member
:D JSDL, just think of it as saving energy. Do you want the direct connection to consume 25mA of current or some microAmps of current?

The precautionary resistor between the two devices will limit the current and save your energy!
 

JSDL

Senior Member
That puts 1.5V across the diode. Probably 0.9V (1.5V-0.6V) because the diode doesn't start conducting until at 0.6V drop.
isn't the forward voltage drop across a diode fairly constant even with increase in forward current?
 

techElder

Well-known member
... fairly constant ...
You will find as you get down into the weeds of electronic components, that very little of anything is "constant", but most things can be described as "fairly constant." :D

JSDL, you should pick up a book on basic electronics where you will see a graph on the forward voltage characteristics of diodes. It will show that it is "fairly constant", but then that depends on a lot of things!
 

JSDL

Senior Member
yes, I have seen many of those diagrams and understand that it is not a linear relationship between forward voltage and current of the diode, nor is any diode ideal or produce a constant voltage drop, but does the clamping diode not "clamp" the voltage to approx. VDD + diode voltage drop (in the case of a schottky diode, 0.2V) so approximately 3.2V (assuming VDD = 3V as is the case in my previous example)? In such a case, the diode would only be dropping approx 0.2V. Sorry just trying to wrap my head around this but I am learning a lot from you guys :) Please correct me if I am wrong.
 
Last edited:

hippy

Technical Support
Staff member
does the clamping diode not "clamp" the voltage to approx. VDD + diode voltage drop
I'm not an electronics engineer, don't understand analogue silicon, but I would say; if there is 4.5V placed on the diode anode, and the diode is clamping that anode to 3.2V; where does the 1.3V go ?

Code:
 4.5V  3.2V    3.0V
   |    |       |
------ ----|>|------
If the 3.2V could pull the 4.5V down to 3.2V there would be considerable current in doing that at some point.

Alternatively the 4.5V must be pulling the diode anode up to 4.5V, giving a drop of 1.5V across the diode.

Now, if you put a resistor between the 4.5V and the 3.2V clamped diode anode ...
 
Top