Quick question regarding bridging a I/O pin with Serial in pin

Lord Grezington

New Member
I am using a 20M2 chip, does it matter if the serial in pin goes high or low during pic operation? it only states in manual 1 that you can not leave it floating.

Essentially what i want to do is use less ports on a connector to save board space, so as the IO goes on and off i need to be sure it will not affect the operation on the chip.

thanks

Graham
 

hippy

Ex-Staff (retired)
I am using a 20M2 chip, does it matter if the serial in pin goes high or low during pic operation? it only states in manual 1 that you can not leave it floating.
Download Serial In going high will normally cause the PICAXE to enter its download mode ( and restart its program if there isn't a download ) so this will give erratic and unreliable operation. However you can use the DISCONNECT command to prevent that happening, meaning Download Serial In can change while running with no adverse effect.

The caveat is that, if the PICAXE starts up and the Download Serial In is or goes high, the program may never reach the DISCONNECT command nor run the rest of the program.

You could overcome the issue by using a Program/Run link on the board.
 

Lord Grezington

New Member
Thanks Hippy

So, to ensure i get this all straight:

I can use the disconnect command to get reliable working. In order to implement this it needs to be on the first line of the code (before checking any inputs). This would mean that I will only get once chance of downloading the program (unless a hard re-set is performed or formatting the chip)? - can i format the chip if the serial in is disconnected?

I am trying not to use a program/run link as i am trying to save as much space on the board as possible.

thakns
Graham
 

inglewoodpete

Senior Member
The 'Disconnect' command disables the Serial In from going into 'Program Download' mode when it receives a high state.

There are 2 ways of allowing a fresh program to be downloaded to a PICAXE in a 'disconnected' state:
1. Use a 'Connect' command in your code.
2. Start the PE's download before powering up your PICAXE (Ie a 'hard' reset)
 

Technical

Technical Support
Staff member
In order to implement this it needs to be on the first line of the code (before checking any inputs).
No, The PICAXE firmware checks the serial in *before* any code starts running (if it didn't the 'hard-reset' would not work).
So the serial in pin must be held low when the power resets. If it is floating or high the program may never start, so will never get to the disconnect line. So to do what you are trying to do you must be certain that the external input is always in the 'low' condition whenever the PICAXE resets (which may not be possible!).
 
Last edited:
Top