Pin input and Picaxe V+ Voltage Level Question

srnet

Senior Member
From it, I conclude that if you power the any of the Picaxes with 5V then you can use either 3.3V or 5V peripherals without problems
You conclude incorrectly.

You cannot (directly) mix 3.3V and 5V devices.

In somes case a 3.3v device can accept a 5.0V logic level input, but that requires some form of additional current limiting.

A 3.3V logic level device will not be able to drive a 5.0V level devise without additional circuitry.
 

nick12ab

Senior Member
You can savely control a 3.3V device with a 5V picaxe by using a potential divider. A 4.7K + 10K potential divider will do.

For a 3.3V device, the absolute maximum Vdd-Vss voltage tends to be between 5 and 6 volts but you need to check individual datasheets for this. However, the clamping diodes in these devices can only handle a limited current and current flow through these is likely to damage the 3.3V device and possibly the PICAXE too which is why the potential divider is needed. Or if you want to be really cheap just use a 22k resistor in series with no potential divider to limit this current like the way the PICAXE download circuit works.

From the thread that you linked, it appears that you can also control a 5V PICAXE with a 3.3V device as for Vdd>4.5V, VIH=>2V.
 

hippy

Ex-Staff (retired)
In general a 3V3 device output can connect directly a 5V device input and will work as expected.

A 5V device output should not be directly connected to a 3V3 device input unless that input is specifically 5V tolerant ( the current PICAXE device inputs are not ).

The 5V output can be reduced using a potential divider as described by nick12ab.

An alternative is to connect the 5V output to a 3V3 input by including a suitable value current limiting resistor. Electronic engineers have been doing this for years without reported issues but it is not officially sanctioned by Microchip.
 

Dippy

Moderator
For 5V --> 3V3 there are several options.

1. High resistance and rely on PIC clamping diode. (I read Armps note on that recent thread, but I and millions of others have done it many times and, as pointed out by Nick, the PICAXE download circuit has happily used a similar approach for a hundred years without complaint. It just requires thought.).
2. High resistance + your own clamp diode.
Both the above are , by the way, a better approach for a simple limiting for ADC input too.
In any event you shouldn't have much current going up clamp as this gets into the V+ line with obvious consequences (in addition to heating damage and stories of latching).

3. Potential/Voltage divider.
4. Appropriate Resistor + appopriate zener.
5. Transistor/logic/opto coupling.
The above three are, generally considered, as safer options and should be considered first. I would use these in preference to 1 and 2.
 

beb101

Senior Member
Thanks to all for the explicit replies. My gut feel was that it was better to just stick with 3.3V to power the Picaxe.
Baxter
 

westaust55

Moderator
When driving 3.0 or 3.3 V devices from a 5 V PICAXE, having had problems in the past with the single resistor current limiting method ( to a fraction of a mA into a non-PIC chip) , my approach is:
1. if there are only 1 or 2 signals involved and single direction a couple of resistor dividers can suffice,
2. For i2c comms or other bi-directional apps, I use two 2N7000 FETs for bidirectional level shifting as per the NXP/Philips i2c spec/app sheet on level shifting,’
3. When there are say 4 to 8 such signals I opt for a 74LVC245A 8-channel transceiver chip. These can operate (by powered) at 3.0 Volts or 3.3 Volts and specifically have 5 Volt tolerant inputs. Additionally they are bi-directional so if you do need to change the direction of all the signals at once that can be done as well (maybe, for example to read the data back from an LCD type display in parallel mode).
 
Top