08M2's - Pin 2 to 0V rail to work in an external circuit - is this correct????

Danbert

New Member
Hello everyone. I'm hoping someone out there can help me.

Having downloaded my programme to my picaxe chip and removed it from the project programmer board and placed into my finished circuit (In my case a breadboard) I have discovered that the picaxe will not function unless pin 2 is connected to the 0V rail of the power supply - is this correct? :confused:
 

srnet

Senior Member
Manual 1 page 27;

1) The 10k/22k resistors must be included for reliable operation.
DO NOT leave the serial in pin floating as THE PROGRAM WILL NOT RUN!


If you otherwise want to use pin 2 for an input then include the 'disconnect' command in your programme.
 

nick12ab

Senior Member
That is correct as pin 2 is the serial programming pin and if it goes high the PICAXE will try to start a program download. As the pin has no internal pull-down resistor (none of them do) the pin will float into either state causing unreliable operation without the serial in pin being connected to 0V.

ADDED:
If you otherwise want to use pin 2 for an input then include the 'disconnect' command in your programme.
This, however, is no substitute for including a pull-down resistor or a connection to 0V as the PICAXE checks the Serial In pin for a download before the first command gets executed (otherwise you'd never be able to reprogram a PICAXE that had had the disconnect command used at the start) so if the pin is floating high at power on then the program will not run.
 
Last edited:

joshzstuff

New Member
That is correct as pin 2 is the serial programming pin and if it goes high the PICAXE will try to start a program download. As the pin has no internal pull-down resistor (none of them do) the pin will float into either state causing unreliable operation without the serial in pin being connected to 0V.
ADDED:This, however, is no substitute for including a pull-down resistor or a connection to 0V as the PICAXE checks the Serial In pin for a download before the first command gets executed (otherwise you'd never be able to reprogram a PICAXE that had had the disconnect command used at the start) so if the pin is floating high at power on then the program will not run.
Thanks for your input.
So from your comments, this leads me to the concept that it should be a common practice then to use (let's say) a 10K resistor for pull down IN ADDITION to the 32K pulldown that is included when the programing circuit is attached [22k +10K in series]


(I assume this will not effect the programming in any way . . .?)

Except, of course, if you are using a weaker pull-down in your project (e.g. higher value pull-down for power savings)

Let me simplify:
Basically, the first thing you can do on any picaxe project board is slap a pull-down resistor on the Ser-IN leg and go about the rest of your design.
UNLESS you wish to use 32K or higher pull-downs, in which case you may simply rely on the programing circuit to take care of this for you.
(assuming the in-circuit programing circuit is permanently attached)

Is this correct?
Do you know of any disadvantages to designing circuits this way?
 

Technical

Technical Support
Staff member
No, this may stop it working all togther. It would work with a 'red' 100k....but...
99% of users add the download circuit, the 10k and 22k to every circuit. Then you can program the PICAXE in place.
If you don't want to add the download circuit, but do want to add the red 10k, then why? Its only one more resistor to do it properly!
 

Captain Haddock

Senior Member
It's easy to damage pins removing from a breadboard to re-program, why not use one of the programming adaptor boards that just plugs into the breadboard, it's only about £2 and makes life so easy, I have a bit of stripboard on headers with the 2 resistors and programming socket on mine (cost about 30p) and use jumpers to connect to whatever picaxe is on the board at the time.
I work on the idea that projects are never right first time and even if it is you'll think of somethine else to add later anyway.
 

Hendriks

Member
Basically, the first thing you can do on any picaxe project board is slap a pull-down resistor on the Ser-IN leg and go about the rest of your design.
UNLESS you wish to use 32K or higher pull-downs, in which case you may simply rely on the programing circuit to take care of this for you.
I think the easiest solution is to simply make a connection on the 3.5mm connector from 'b' to the inner pin 'c'. This way the pull-down on pin 2 will be 22K instead of 32K. (of course without making connection between the outer 'c' and the inner 'c')

Or even better, make a connection between PICAXE pin2 and the inner pin 'c' of the 3.5mm connector. Then pin2 is grounded when there is no plug connected.

My last [EDIT: latest] project was in a noisy environment that kept resetting the 08M2 until I grounded pin2 using this connection to the plug.
 
Last edited:

joshzstuff

New Member
10K . . . = arbitrary pull down value . . ??

The project that raised this question for me was a custom Proto-board for my picAxes (up to 14 pins)
So I plan on using this for a variety of applications, but I also wanted to get your view on the value and possible detractions of the practice for future circuit design.

My question is specific to a project that DOES have a DL circuit.

Sorry for the late reply, I thought I was subscribed to this thread.

Your adding a resistor that is not necessary ?
"not necessary" perhaps. . .
For a large percentage of projects this would not be necessary (if 32k works for the other inputs)
(I suppose application makes all the difference, but if you like 32k for your most vulnerable input, wouldn't you also use this value[or similar] for all inputs?)

I guess part of my question is: "how arbitrary is 10k valued pull downs for "typical" noise"
If it's common to have problems above this value then it would seem shrewd to automatically use this for all inputs (including / especially the Ser-In)

(so to not use the additional 10k would be the exception, instead of the rule)


No, this may stop it working all togther.
What do you mean Technical? The additional 10k shown could possibly "stop it" . . . as an input pin?

It would work with a 'red' 100k....but...
99% of users add the download circuit, the 10k and 22k to every circuit. Then you can program the PICAXE in place.
I've seen users raise the pull down resistors for power efficiency at the cost of noise protection.
My thinking is:
If I was going to pick one pin not to "skimp" on pull down stability, I would pick this pin since it has potential to wreck the entire function of the chip

If you don't want to add the download circuit, but do want to add the red 10k, then why? Its only one more resistor to do it properly!
That's my take, of course I would use a 10k if there was no in circuit programming circuitry, since my current project is a proto-board and I think it would be practical to add it permanently, even with the DL circuit.

It's easy to damage pins removing from a breadboard to re-program, why not use one of the programming adaptor boards that just plugs into the breadboard, it's only about £2 and makes life so easy, I have a bit of stripboard on headers with the 2 resistors and programming socket on mine (cost about 30p) and use jumpers to connect to whatever picaxe is on the board at the time.
I work on the idea that projects are never right first time and even if it is you'll think of somethine else to add later anyway.
I've got a couple of these, I like them for the breadboard, but I'm aiming to clean it up with my own proto-board design.

I think the easiest solution is to simply make a connection on the 3.5mm connector from 'b' to the inner pin 'c'. This way the pull-down on pin 2 will be 22K instead of 32K. (of course without making connection between the outer 'c' and the inner 'c')

Or even better, make a connection between PICAXE pin2 and the inner pin 'c' of the 3.5mm connector. Then pin2 is grounded when there is no plug connected.
This would eliminate all possible noise, but also the ability to program . . .
Since my current project is a proto-board I may have to make this temp connection when not programming.

My latest project was in a noisy environment that kept resetting the 08M2 until I grounded pin2 using this connection to the plug.
Interesting, obviously in this environment the 32k pull down provided by your programming circuit was not sufficient. (assuming there was one)
a question for you then:
Were you using other inputs on the 08M2? If so what value pull down did you use? ( < 10K?)

I'm sure it will depend on the application, but almost certainly couldn't it be said that 'the Ser-In port should generally be the lowest value pull down'?

So . . . if all of your other inputs have 10K resistors . . . why wouldn't you put one on the seemingly most vulnerable?
Right?

Thanks for your input!
 

Technical

Technical Support
Staff member
What do you mean Technical?
We mean you are altering thw download circuit and programs may no longer download, as the 10k is permanently pulling the input low.
However it will still run a previously downloaded cicruit.
The extra 10k is really not necessary.
 

srnet

Senior Member
We mean you are altering thw download circuit and programs may no longer download, as the 10k is permanently pulling the input low.
However it will still run a previously downloaded cicruit.
The extra 10k is really not necessary.
Yes indeed, the 'extra' 10K should stop the download circuit working, as well as not being necessary for an already programmed chip to work normally.
 

Hendriks

Member
. . . This would eliminate all possible noise, but also the ability to program . . .
Only with no 3.5mm plug inserted serial_in is grounded; with a cable connected you can upload and download as usual.
I think this is the most reliable configuration.

. . . Interesting, obviously in this environment the 32k pull down provided by your programming circuit was not sufficient. (assuming there was one)
a question for you then:
Were you using other inputs on the 08M2? If so what value pull down did you use? ( < 10K?). . .
Noise on pin2 was the cause of frequently resetting the 08M2. 32kOhm Obviously was too high in that environment (brushed DC-motor). On other pins 10K proved to be no problem.
 
Last edited:

mrburnette

Senior Member
@joshzstuff...
" So . . . if all of your other inputs have 10K resistors . . . why wouldn't you put one on the seemingly most vulnerable? Right? "

Wrong. Forget about the other inputs for a moment and concentrate on the original question... you were asking about grounding the input programming pin. The answers given about the 10K is a PICAXE BEST PRACTICE. There is a reason for the value as when used with the 22K the two form a voltage divider that can handle the RS232 voltage swings while presenting the input gate with valid logic levels.

Generally, most of us will entertain some deviation in design, but because this is a public forum that is utilized by many, we will not knowingly restate a documented Best Practice.

- Ray
 

srnet

Senior Member
Sort of a voltage divider, but within limits. Up to a certain input voltage it does indeed act as a voltage divider, but as soon as the voltage on the serial input pin goes about 0.7v higher than the PICAXE supply it will be clamped at that level by the PICAXE input pin protection diode. The 22K resistor now acts as a current limiter.
 

hippy

Technical Support
Staff member
I think there is some confusion creeping into understanding the download circuit.

Ignore the front 10K for now, and all we have is a 22K in-line with the serial input. This is a current limiting resistor, no more, no less. It allows the PICAXE to be used with RS232 signals and other voltages outside the PICAXE power supply range.

The PICAXE input pin does have some resistance but that is very high. In conjunction with the 22K it does from a potential divider, but has such little impact that it can be considered that it doesn't and can be ignored.

Adding a 10K on the PICAXE side of the 22K does create a potential divider, and quite a significant one. This is quite often enough to prevent downloads from working, hence why it is essential not to put a 10K there if you want download ability.

The 10K on the socket side of the 22K is simply there to stop the 22K and serial input from floating high when the download cable is unplugged as this will usually prevent the PICAXE from running its program reliably. When the download cable is unplugged the serial in is effectively pulled to 0V via a 22K+10K, 32K, resistor. This is good enough to allow the PICAXE to operate properly and usually good enough to provide noise immunity on the serial in pin.
 

hippy

Technical Support
Staff member
So hippy, why not do it better and ground the serial in pin through the 3.5mm connector switches?
I suppose that depends on how one defines "better". The great majority have no problem with the existing recommended download circuit and suffer no problems with electrical noise when using it so it would offer no advantage to them.

In electrically noisy environments there are many things which may be required to make electronic circuits immune from that and switching the 10K/22K point to 0V might be a possible help with that.

One has to be aware that inserting a jack plug into a modified socket, switched to 0V, could potentially see the serial out to the PICAXE serial in shorted to 0V at least momentarily and the consequences of that would have to be considered.
 

John West

Senior Member
I think the point regarding the programming circuit is that the circuit is only incidentally a voltage divider, not intended to be one for circuit design purposes. Many combinations of resistors in circuits will form dividers, although they are placed where they are and are the values they are, for entirely different reasons. Therefor, it's best to keep in mind the intended purposes of each of the PICAXE programming resistors and why they are the values they are, not the fact that they incidentally form a divider.
 

srnet

Senior Member
So from your comments, this leads me to the concept that it should be a common practice then to use (let's say) a 10K resistor for pull down IN ADDITION to the 32K pulldown that is included when the programing circuit is attached [22k +10K in series]
Can you clear something up, I am baffled, do you expect to be able to download programs to the PIC with this 'extra' resistor in place ?
 

SignalX

New Member
I recognise that leaving the serial input pin floating will cause problems. I am building a picaxe circuit that will not require to be re-programmed and as such there will be no input jack socket or the 10k & 22k resistors but I need to put a path to 0V in there so that the input pin doesn't float.

Can the serial input pin be wired directly to 0v or is it necessary to have a resistor in circuit, if so what value?
Is there a maximum value and a minimum value for this pull-down resistor?
 

hippy

Technical Support
Staff member
Can the serial input pin be wired directly to 0v or is it necessary to have a resistor in circuit, if so what value?
It is recommended to use a pull-down resistor but it is possible to wire directly to 0V.

With a direct connection there is a potential risk that an adverse event could turn the input pin into an output high and that would create a direct short to 0V which could damage the chip. The chance of such an adverse event is however likely very low.

Is there a maximum value and a minimum value for this pull-down resistor?
It would be recommended to choose a minimum value such that, if an adverse event as described above occurs, no damage would be done through current being limited to a safe level. In practice any resistance between 1K and 47K is likely to be acceptable, 10K being a reasonable middle of the road choice.
 

SignalX

New Member
Dear Hippy,
Many thanks for your concise reply. I think I will opt for something like 4k7 as I have a lot of them.
I think this may have been the question in the mind of the first post in this thread but just quoting the manual didn't clarify the situation.
Regards,
SignalX
 
Last edited:
Top