Picaxe 20m2 is freezing up

Gapak

Senior Member
I have a project driven by a 20m2 with the main program (start) plus one sub program (start 1). I use Logicator for programming. From time to time the 20m2 freezes up (or locks up?), the main program is totally unresponsive to inputs although the sub program continues to respond and seems unaffected. I have carefully checked that my program does not have any loop from which I cannot escape.
Which condition could cause the 20m2 to behave like this? I have use an other 20m2 to make sure the original was not defective. Thanks for help.
 

BeanieBots

Moderator
The only two things that can cause a PICAXE to "lockup" are a faulty circuit or a duff program. (excluding a local EM pulse bomb!)
Please post your code and/or your circuit so that we can see which it is.
The fact that your sub program is running suggests there is an issue with your code. (i.e. never exiting the sub)
 

Gapak

Senior Member
Thanks for your reply,I have attached my schematic and plf file.
The system consists of a pond with a small waterfall. Pump 2 can be activated by a push button or by an RF remote or by a motion detector. During daylight only a small pump (pump1) runs on an automatic cycle to keep the water circulating. A water level detector (electrodes) activates a low level alarm ( sub program 1 to make a led blink) or a pump shutoff.
 

Attachments

Technical

Technical Support
Staff member
You cannot use procedures as 'connectors' like this. A procedure must end with a return and the cell that calls the procedure must also have a line out.

There are 'dot' connector blocks in PE6 instead. However in general it is better to make one flowchart that has lines in and out of every cell.

Logicator.PNG
 

Gapak

Senior Member
Thank you for your comment. I was confused between "go sub" and "go to" in my older version of Logicator as I did not understand well the difference. I notice that in Editor 6 there is no "go to", I guess it was replaced by "connectors"?
I will redraw my flowsheet using the procedure and return commands as you suggest, then try it.
By the way, if you do not want to repeat a procedure is there a difference with using connectors instead of procedure/return?
 

nick12ab

Senior Member
Thank you for your comment. I was confused between "go sub" and "go to" in my older version of Logicator as I did not understand well the difference. I notice that in Editor 6 there is no "go to", I guess it was replaced by "connectors"?
Yes.

By the way, if you do not want to repeat a procedure is there a difference with using connectors instead of procedure/return?
Return always returns to the point where the procedure was called, so you can easily reuse sections of code in different places in your program.
 

Gapak

Senior Member
Thank you All, I will now observe how my project behave with the revised program. I will be back if the 20m2 locks up again.
 

Gapak

Senior Member
A month ago I started a thread because the Picaxe 20M2 in my project was locking up. You found that in my Logicator flowsheet I was improperly using the sub program command, "go to" instead of "go sub" followed by "return". After making the changes I can now report that I have not observed any lock up! Thank you to all of you who keep this forum alive.
 
Top