Picaxe 8M2

Visser

Well-known member
Good day
I need 4 outputs and 2 inputs on a 8M2. Will it be possible and where must I insert the "disconnect’ command" and how do I do the ‘hard-reset’ as described below
This is what I found in the manual:

Using the Serial In pin as a general input pin
On M2 and X2 parts the ‘serial in’ pin may be used as a general purpose input,
connected to a switch as shown.
However there are certain special conditions to this use:
1) The program must contain a ‘disconnect’ command. This command prevents
the PICAXE chip from scanning the serial in pin for new program downloads.
If you do not add this command the PICAXE will reset when the switch is
pressed.
2) After a ‘disconnect’ command is used it will be necessary to perform a power on
‘hard-reset’ to download a new program
3) The switch must be open during a new program download.

Output pin 0 (leg 7) is used during the program download, but can also be used as a general purpose output once the download is complete"

Regards
Vissie
 

steliosm

Senior Member
You will need to use the disconnect command before you can use the Serial In pin in your program. A good place to put it is at the top of your program. A hard reset is a reset that is done by removing and putting back the power to the Picaxe. So, in order to re-program the Picaxe you will need to remove the power, start programming on the PicAxe Editor and then apply the power back to the Picaxe. You need to be fast putting the power back to the PicAxe or else the Editor will timeout.
 

Visser

Well-known member
You will need to use the disconnect command before you can use the Serial In pin in your program. A good place to put it is at the top of your program. A hard reset is a reset that is done by removing and putting back the power to the Picaxe. So, in order to re-program the Picaxe you will need to remove the power, start programming on the PicAxe Editor and then apply the power back to the Picaxe. You need to be fast putting the power back to the PicAxe or else the Editor will timeout.
Can I remove the chip and program it on my program board ?
 

AllyCat

Senior Member
Hi,

Yes , in principle you can move the PICaxe to another "programmer", but it may still need the Hard Reset Procedure.
On M2 and X2 parts the ‘serial in’ pin may be used as a general purpose input, connected to a switch as shown.
Note the User Manual condition highlighted above, and all the further restrictions.

A method to avoid the (regular) use of the Hard Reset procedure is to put a RECONNECT at the "End" of the Program (that doesn't mean the last line in the listing). In principle, you would need to determine an "Exit condition" (e.g. holding in a button for a long time) which then jumps to the RECONNECT command. Or when testing (M2) programs, I often put an: IF time > 60 then : RECONNECT : ENDIF inside the active loop, to permit reprogramming after one minute (or as required).

Cheers, Alan.
 

PhilHornby

Senior Member
This is what I found in the manual:

Using the Serial In pin as a general input pin...
Bear in mind that the Picaxe won't boot, if the Serin pin is HIGH (or floating) at power-on. (It needs to be pulled LOW, by some minimum resistance - 100K?). So how general an input pin it is, is debatable...
 

Visser

Well-known member
Thank you all for the help
I have 10k to ground on both inputs and they will only go high after bootup. Will that be ok?
 
Top