18m2 "minimum" circuit

dmaxben

Member
Quick question about the minimum required OPERATING (not programming) circuit for running a program on an 18m2.

Ive searched all around and read all the datasheets but could never really discern a clear answer about the new m2 parts. Hopefully im not being stupid and missed something obvious. :eek:

Basically, I built a little 'chip burner' PCB setup that permanently stays attached to my computer on my work bench. Im building several little remote control car modules where circuit board space is limited, so rather than take up space with a program-download header/plug, I just 'flash' the PICAXE with my chip-burner on my work bench, then transfer the PICAXE/plug it into the DIP socket on the car controllers circuit board.

Obviously on the older pre-m2 PICAXE chips the serial-in pin had to be tied low with a 10k and 22k resistor, otherwise the program would not run properly.

SO whats the deal with the new 18m2? I know the serial-in port can now be used as an input when the program is running and the PICAXE isnt being reflashed.......so does that mean that the 18m2 does NOT need any 10k/22k resistors on that serial-in pin to make the program run correctly? Can the pin be left floating? I know that you arent "SUPPOSED" to leave any pins floating, but on the hundreds of other (non-m2) PICAXE circuits ive made, as long as the serial-in pin is tied low with the resistors, ive never had a problem leaving other in/out pins floating.

Anyway...cliffnotes: does the PICAXE 18m2 need pin 3 tied to ground with resistors in order to function properly, or what is the deal with otherwise telling the PICAXE 18m2 to use that pin as a general purpose input???

thanks
Ben
 

jtcurneal

Senior Member
From the info that I have seen, I have always tied leg 3 of the 18M2 to vss with a 30k to 40k resistor.

Joel
 

Technical

Technical Support
Staff member
Welcome to the forum.

You need exactly the same 10k/22k system, or else the chip will not start/reset correctly.

However in your program you can then add a 'disconnect' command, after which you can use the pin as an input in your program (by connecting a switch between the 5V rail and the pin, the 10k + 22k = 33k then acts a pull down resistor for the switch).

This has two restrictions:
1) you will need to do a 'hard reset' to start a new download
2) the switch must not be pressed during a download
 

Technical

Technical Support
Staff member
If not using the download circuit on board, then a straight 10k pull down from the pin to 0V will work, but is still *essential*
 

nick12ab

Senior Member
However in your program you can then add a 'disconnect' command, after which you can use the pin as an input in your program (by connecting a switch between the 5V rail and the pin, the 10k + 22k = 33k then acts a pull down resistor for the switch).

This has two restrictions:
1) you will need to do a 'hard reset' to start a new download
2) the switch must not be pressed during a download
Also note you can do the same on the Serial Out pin despite the fact that the diagram doesn't show Serial Out as having input capability but it does work. Again, the button mustn't be pressed during a download.
 

dmaxben

Member
Alright great thanks for the help everyone!

Ill just tie the serial input pin (3) to Vss with a ~30k resistor and leave it be and not use pin3 for anything else...that way there are no complications, and I can be absolutely sure the program will run correctly.

thanks again
Ben
 

hippy

Ex-Staff (retired)
Also note you can do the same on the Serial Out pin despite the fact that the diagram doesn't show Serial Out as having input capability but it does work. Again, the button mustn't be pressed during a download.
I'm not sure how you would have such a circuit configured but the firmware keeps the download Serial Out as an output only pin at all times so it's hard to see how you are using it as an input pin.

You can short the output to +V and perhaps have the PICAXE read what should be an output low as something which is pulled high ( or vice-versa ), but you are electrically compromising the PICAXE if you do that and may destroy it.
 

nick12ab

Senior Member
I'm not sure how you would have such a circuit configured but the firmware keeps the download Serial Out as an output only pin at all times so it's hard to see how you are using it as an input pin.

You can short the output to +V and perhaps have the PICAXE read what should be an output low as something which is pulled high ( or vice-versa ), but you are electrically compromising the PICAXE if you do that and may destroy it.
That could be only in the latest firmware or it could be the same as the 'read write modify' thing or whatever it was called. If the firmware keeps it as an output but it has input capability, why not add the ability to use it as an input as it wouldn't interfere with downloading anymore than allowing an input on the Serial In pin.

Related to this, is the Serial In pin fixed as an input by the firmware so that it doesn't confuse younger users by being open drain?
 

Technical

Technical Support
Staff member
You cannot ever have (reliable) input capability on an output pin.

The firmware does not allow you to make the serin pin an output as that would be a very bad design idea for a large number of reasons, mainly as it *must* be an input for download purposes. There are plenty of other pins on all chip sizes that can be used as outputs.
 

nick12ab

Senior Member
The firmware does not allow you to make the serin pin an output as that would be a very bad design idea for a large number of reasons, mainly as it *must* be an input for download purposes.
It's not like once a pin becomes an output it can never become an input again. Also the datasheet mentions that poking the pins SFR will just cause the interpreter to set it back again but if it was done repeatedly, would it cause an LED to glow dimly or signals to appear on a 'scope?
 
Top