Advanced Breadboard With Automatic Hard Reset

Goeytex

Senior Member
While working on another Picaxe related Project, I got annoyed because of having to do a "hard reset" when downloading a program to the Picaxe. A hard reset is necessary if there is a "disconnect" command in the code, or when certain blocking command are used, or if there happens to be a long "pause".


The Solution:

A Picaxe 08M2 (or 08M) was added to the breadboard along with a 74HC hex inverter and a PNP transistor. The 08M2 monitors the signal to the Picaxe serin Pin and determines if it is a break" for programming or if it serial data. If it is serial data no action is taken. However, if it is a break, it kills the +V power to the breadboard for 1/2 second causing the Picaxe (and any other devices on the breadboard) to reset. The 08M2 then waits for programming to complete and then starts over waiting for the next programing break or serial data. The same code works fine on either an 08M or 08M2, just change the Picaxe directive accordingly.

Note: The code on the Picaxe being programed must have a "Disconnect" command issued at the beginning of code. This assures proper operation of the automatic hard reset.


I did this on a rather large breadboard, so I call this my Advanced Breadboard. Now, no more manual hard resets .... ever.

The this breadboard uses a cheap CP2102 USB/TTL adapter, but any USB/TTL adapter can be used. If using an AXE027 or Picaxe serial cable, some slight changes need to be made. These are shown in the second schematic. If using an AXE027 or serial cable, do not be tempted to eliminate the 74HC Inverter. The inverter is necessary because killing power to the inverter also stops the AXE027 or serial cable from powering the Picaxe through the serin Pin. As some of you know, a Picaxe can be powered from a high level on an I/O pin, even when +V is disconnected. This can sometimes cause problems. So, use the 74HC14 inverter as shown in the schematic.


A 2N2907 PNP transistor was used to switch the power because this is what I had on hand. However, a logic level P-FET with a low RDSON might be a better choice. When using a PNP transistor, the value of the base resistor is important. If the value is too high, there will not be enough current supplied to the breadboard. A 680 ohm base resistor works well, allowing ample current. Current will not be an issue using a PFET since it is voltage rather than current controlled. I did not show it on the schematics, but it may be a good idea to put a 200ma fuse in the +V line.


Attached are schematics, code, and a Pebble based breadboard layout. The code is well commented to hopefully answer any questions about how it works.

Note: The "Disconnect" command



Enjoy
 

Attachments

Last edited:

hippy

Technical Support
Staff member
For the AXE027 / RS232 version you should be able to remove the 74HC14 from the circuit and take the power controlling 08M2 C.3 input direct from the target PICAXE Serial In pin.
 

Goeytex

Senior Member
For the AXE027 / RS232 version you should be able to remove the 74HC14 from the circuit and take the power controlling 08M2 C.3 input direct from the target PICAXE Serial In pin.
When I tested this, the high "break" signal from the AXE027 powered up the target Picaxe through its serin Pin preventing a hard reset via the transistor switch.

Killing power to both the 74HC14 and the Picaxe eliminates the possibility of the Picaxe being powered via the serin pin.
 

hippy

Technical Support
Staff member
The joys of 'phantom powering'. And my apologies for having completely missed the paragraph in your first post where you had already explained it all.
 

john2051

New Member
Many thanks for this idea, which may also be adaptable to the picaxe netserver when changing setup. I've found I
need three hands. This approach would mean I could hold the mode and reset pins until ready with the software.
regards john
 
Top