Program/Run M2 series on 3.3v?

GrahamGo

Senior Member
I was hoping to be able to program and run a 14M2 on 3.3v Should this be possible? The reason I ask is because the graphics LCD I want to use is made to run on this voltage.

I have made a small circuit running off a USB to Serial converter set to 3.3vdc. I have successfully programmed and ran a 14M2. Literally using 5 lines of code, but it worked.

Then today, I was starting up again and I get "hardware not found on com2", I tried replaced the IC - same results. The COM port checks out fine.

So a couple of questions.

1. Am I running below spec?
2. In general, how robust are the chips? I don't mean voltage wise. I mean can the boot-loader or flash code area get corrupted, making a chip un-operable? If so, is there a good way to resurrect a failure?
3. When a chip is programmed to run a program. What happens at power on - how does the chip check to see if it going to be programmed?

new to this and learning......
 

GrahamGo

Senior Member
Thanks, it doesn't specifically say, but I assume the M2 series can be operated and programmed at 1.8v and above. I knew about the 1.8v, but wasn't so sure about a minimum requirement for programming voltage.

from Page5. Low Voltage Operation
The M2 parts have an internal 3.3V silicon die, but also contain an internal Low Drop Out Regulator, which is
automatically enabled when required. This means all M2 parts can be used across the entire 1.8 to 5V voltage.

A bit off subject, so the silicon die works from 1.8v - 3.3v, and above 3.3v the regulator kicks in?
 

srnet

Senior Member
2. In general, how robust are the chips? I mean can the boot-loader or flash code area get corrupted, making a chip un-operable? If so, is there a good way to resurrect a failure?
Very robust really.

The word from Rev-Ed is that the firmware (which is a great deal more than just a bootloader) cannot get overwritten.

You could I guess erase the PICAXE with a PIC programmer (not possible with the standard PICAXE programming leads) and then the only way of resurrecting it is to return it to Rev Ed.
 

nick12ab

Senior Member
the only way of resurrecting it is to return it to Rev Ed.
According to the FAQ, that won't happen
If you have deliberately or accidentally erased the bootstrap program from a PICAXE by using a conventional PIC programmer we cannot reprogram it.

We do not accept microcontrollers from unknown sources due to the correct storage/handling procedures required by these devices. We use gang programmers costing several thousand pounds to program the bootstrap code into the blank microcontrollers, and so must protect this expensive equipment from damage. It is also likely that if we did offer this service the handling cost would end up more expensive than new PICAXE microcontrollers anyway!
 

GrahamGo

Senior Member
Well somehow I have managed to brick a 14M2 with a few lines of code using 3.3v - trashed that one.

I have a few new ones and thought that they were all bad. I was fooled because the factory fresh chip transmits a 2400 baud text string repeating every 500ms. the killer is that the first string is transmitted a full 5 seconds after the power is applied. That caught me out!

http://dl.dropbox.com/u/2986203/Factory%20fresh%20Picaxe%20startup.PNG

I purchased an AXE117 14M project board. But I did not assemble it. I instead used the components on a breadboard. But I found that all my new chips would sometimes not startup. I was able to fix this by adding a 4.7uf tant cap across the provided 100n cap. This might be a 3.3v induced problem, but the AXE117 might benefit from the additional component if it gives similar problems.

I then tried to find out what triggers the 14M2 into programming mode. It appears that its a 2ms period stream, followed by a few characters and then the data. But I wasn't able to determine the baudrate used. This isn't important, but I still wonder what to avoid if connecting two PICaxe's serially. Maybe someone will convince me that going into accidental programming mode isnt a possibility.

http://dl.dropbox.com/u/2986203/Pixaxe%20Programming.JPG

Can someone tell me why the following code fragment runs at double speed? Note I changed the terminal from 2400 to 4800 halfway through.

http://dl.dropbox.com/u/2986203/Double%20speed%20serial.JPG

On the AXE117 Serial input there is a 10k to 0vdc and 22k in series to pin2 Rxd. I guess this is to give the 14M2 a 5volt tolerant input? So on an all 3.3v schematic I don't need the resistors - right?
 
Last edited:

GrahamGo

Senior Member
Very robust really.

The word from Rev-Ed is that the firmware (which is a great deal more than just a bootloader) cannot get overwritten.

You could I guess erase the PICAXE with a PIC programmer (not possible with the standard PICAXE programming leads) and then the only way of resurrecting it is to return it to Rev Ed.
Yes sorry, I was thinking of my C compiler and its tiny bootloader. In the PICaxe, I suppose that its also the low level - I assume in assembler code of all the built in functions. I still have not got past writing half a dozen lines of code, and have no idea (yet) of how to use the debug feature....
 

hippy

Technical Support
Staff member
On the AXE117 Serial input there is a 10k to 0vdc and 22k in series to pin2 Rxd. I guess this is to give the 14M2 a 5volt tolerant input? So on an all 3.3v schematic I don't need the resistors - right?
Actually it's the other way round; if the serial voltage is outside the PICAXE 0V to power supply voltage you do need the resistors or you damage the PICAXE.

Physical serial ports can put out -15V/+15V and the AXE027 puts out 0V/+5V so it's recommended to always use the 10K and 22K.
 

GrahamGo

Senior Member
Actually it's the other way round; if the serial voltage is outside the PICAXE 0V to power supply voltage you do need the resistors or you damage the PICAXE.

Physical serial ports can put out -15V/+15V and the AXE027 puts out 0V/+5V so it's recommended to always use the 10K and 22K.
So if I understand you. The AXE117 AXE027 Txd,Rxd with the resistors can be connected directly to a standard +/-15vdc RS232? Not that I plan to, but its good info... Which also explains why the data polarity is inverted....hmm
 

GrahamGo

Senior Member
Thanks, but it doesn't really provide any info, I assume the signals are 5v TTL on the 3.5mm stereo plug? But I have found a full explanation here :- http://www.picaxe.com/docs/picaxe_manual3.pdf Page 44 section 3. In summary it seems that the 10k pulldown is recommended to prevent erroneous operation (ie. floating input), the 22k serial resistor provides +/- 5 to 15v operation. So with my all 3.3v driver I can omit the resistors.
 

srnet

Senior Member
Thanks, but it doesn't really provide any info, I assume the signals are 5v TTL on the 3.5mm stereo plug?
No, the signals on the end of the plug will be whatever the serial port that the lead is plugged int provides, and could be 15V, depending on the actual serial port.

If the serial in to the PICAXE is at the same logic level as the PICAXE (i.e. 3v3) then you could omit the 22K resistor.

However, you then run the significant risk of blowing the PICAXE when say a conventional programming lead is connected. For the sake of a single 22K resistor why take the risk ?
 

Armp

Senior Member
When running 20M2s at 3.3v and using a 'real' serial port (+/-12v) I add an 18k and schottky to the serial cable to minimize over drive on the input pin. Gives -0.2v and +4.2v approx.

Also works at 5v of course, but some will argue its not necessary.

View attachment 10200
 

GrahamGo

Senior Member
When running 20M2s at 3.3v and using a 'real' serial port (+/-12v) I add an 18k and schottky to the serial cable to minimize over drive on the input pin. Gives -0.2v and +4.2v approx.

Also works at 5v of course, but some will argue its not necessary.
Found this which supports, your case. Slightly different schematic though.

RS232.JPG
 

srnet

Senior Member
And you would only need to minimise overdrive, if there was a chance that the specified input clamp current were to be exceeded.

With +-15V serial port and a 3V3 (or lower) PICAXE supply, is that possible with the 22k resistor ?
 
Last edited:

hippy

Technical Support
Staff member
The input clamp current is usually rated at 20mA maximum for modern PICmicro, 700uA for +/-15V is well below that so almost certainly be okay.
 

Armp

Senior Member
[geek]It's not a clamp current issue - it's a 'latch-up' issue. When the input pin goes outside the range -0.3v to Vdd+0.3v the ESD protect diodes start to conduct and latch-up may result. Not a good thing as the pin will be stuck until the power is cycled off/on. The newer, smaller process geometry 'M2' chips are more susceptible to this effect than the older chips - some of which at least had a 0.6v spec.
View attachment 10214
[/geek]

The enhanced download circuit has a schottky as a down level clamp where latch up is more likely to occur since the pin current is 50% higher than the up level. I consider it good practice to limit the up current to a few uA as well. Users choice, as always.
 
Last edited:

Armp

Senior Member
On the AXE117 Serial input there is a 10k to 0vdc and 22k in series to pin2 Rxd. I guess this is to give the 14M2 a 5volt tolerant input? So on an all 3.3v schematic I don't need the resistors - right?
There are no '5v tolerant inputs' on the 14M2, 20M2 (and probably the other M2 parts) when using a 3.3v supply. Only some PICs have them - as stated in the Microchip PIC FAQ:

I’ve heard the PIC device can handle high voltage inputs if you put a series resistor to limit the current, is that true? What if one were to input a 5V signal into a PIC device running with a 3.3V supply?

Some might argue you can put higher voltages than Vdd onto the part if you use a series resistor, but there are a few problems when dealing with a PIC running at 3.3V and you have a 5V bus. First, lets cover inputs. If you put a voltage exceeding Vdd onto an I/O pin, you will notice that the signal is shunted to Vdd though a protection diode. This current can be limited to a low level (a few microamps) by using a large resistor and is even mentioned in an older Microchip application note. The issue is though, that doing this will keep you within Absolute Maximum Ratings, but not within specifications.

Being within Absolute Maximum Ratings means the part should not be damaged by your input, but being outside of specifications means there is no guarantee how the part would behave.

Depending on the current put into the diodes, there could be damage over the long term, increased current consumption, failure to meet other specifications such as Idd and Ipd and any number of other issues. So, while this may seem to "work", it can cause a number of issues.

Some devices accept higher input voltages on a pin – up to 5V on a pin when running with a 3.3V Vdd, such as the "J" series of devices (eg PIC18F46J10), but most devices do not accept any input over Vdd. See the Electrical Specifications for the device, for the Vih specification.
 

srnet

Senior Member
I have seen that comment from Microchip, it discusses logic level conversion between 5V and 3V3 systems, its ambiguous, which is interesting, no mention as to what 'specifications' that would be exceeded for instance. No mention of input pin latchup. No specifics on 'long term damage' either.

Of course Microchip do sell a range of additional logic level converters for use between 5V and 3V3 systems,
 

westaust55

Moderator
Some of my own favorites for logic level interfaces between 5V and3/3.3V are:
1. Where only a couple of signals involved use a 2N7000 FET transistor
2. Where more eg say 4 to 8 signals involved use a 74LVC245A

Both will handle bi-direction data if necessary (eg for I2C comms).
For those interested and willing to search the forum, I started a thread on this topic which included these solutions in the past.
 

Dippy

Moderator
Whilst genuine level-shifting is the ideal approach I have yet to find an issue with a suitably attenuated input and clamping. I have never experienced latch-up issues on a PIC though I'm not going to deny a possibility.

You must remember that people like Microchip have to issue all-encompassing and bum-covering statements as they will be quoted in every Forum from here gto Mars. And these Forums are read by people with experience ranging from Zero to Designer.
They don't know the skill level of the readers.

The fact that excess input current passes through the clamp should be obvious. How much actually goes through and how much it affects things is down to the designer - but it must be kept in mind. And extra cerebellum activity is required if you expect transients/noise like automotive. People should consider clamp diode currents as well as supply rigidity.
If you expect transients to be clamped this is yet another justification for a couple of Cs on the PIC supply.
Think how the system works and it will become clearer...
For pukka operation and 'peace of mind' use a proper level shifting circuit , often an isolator.
Horses for courses.

In low-budget (cost and space) circuits I have used resistors on >5V inputs a thousand times without issue. Sometimes I've added extra clamping but I have never had a problem.
My tests with a 'scope show that if you need fast clamping response and recovery then use an extra fast/schottky diode.
 

hippy

Technical Support
Staff member
The Microchip statement can perhaps be best viewed in terms of a supplier of aircraft trying to answer the question; is it safe to jump out of one of your planes ? The answer simplistically is "no, you'll fall to you death".

But what if I have a parachute ? That's better, but one cannot say "yes" as there's a whole load of caveats. You have to have it with you, have to be wearing it, wearing it correctly, have to activate it ( and at the right height ), it has to have been packed correctly, has to deploy correctly, and even then something may happen which brings an adverse conclusion.

So, in a simple answer, it's not "no" but it's not "yes" either. "Should be okay" isn't very useful so the best one can perhaps say is it's not recommended.

Of course it's also impossible not to acknowledge that parachutists do jump out out of planes all the time and rarely suffer adverse effects, just as Microchip has to acknowledge that they do have an application note which details how to connect mains voltage, 120 VAC, directly to an input pin using current limiting explaining why and how that works which in this answer they aren't prepared to outright say is okay.

So what Microchip are saying is; "We don't recommend jumping out of a plane. You could use a parachute to mitigate dong that, but there can be problems associated with that".
 

srnet

Senior Member
The situation is slightly different for PIXAXEs where the serin pin has analogue capability in the silicon (such as 18M2) versus PICAXEs with no analogue capability on serin (08M2,20X2,28X2,40X2).

The enhanced download circuit is mentioned with referance to ADC issues, and that I presume is a known issue with an 'excess' voltage in the serin pin getting through to the ADC where the PICAXE has analogue circuitry on the serin pin.
 

Armp

Senior Member
I would hope that RevEd is discussing these issues with Microchip, or that there's a Microchip 'lurker' here to provide some definitive answers regarding the impact of violating this spec:
"Voltage on all other pins with respect to VSS : -0.3V to (VDD + 0.3V)".

When in doubt I would heed the learned member's earlier advice:

In our Quantum World, everything has a statistical probability of happening in a certain amount of time. And that includes failure in an electronic device.

Manufacturers provide data after they have tested (in most cases anyway haha).
It is there to tell you that if you go beyond the Maximum ratings you are 'pushing your luck' and/or that the device may be out of spec.
In certain cases a PIC can be partly damaged but not be a complete melt-down failure.

It is ALWAYS recommended that you read the relevant Microchip PIC Data Sheet for your chosen PICAXE.
Play safe - keep within the specifications given.
 
Last edited:
Top