Chip non-responsive and nowhere to go!

BruceT

New Member
Hi, I have been running two simple circuits with O8M2 chips and all has been working quite well. Then I decided to change the script and upload it - a very simple change. I then uploaded and the circuits are now dead. I have no idea why! A quick explanation of what I have done -

reinstalled Picaxe Editor (6.0.9.2); checked to see that MS Net 3.5.1. is working (this is on Windows 7).

I am using the standard 08-Proto-Board to download with USB cable (and never anything else). All in order - has previously worked perfectly and has not been changed.

Picaxe Editor - I go to "clear" (since the other buttons in that group don't appear to work), the system tells me that it has found the chip on COM3 and it then downloads the program and tells me that it was successful.

But no go! The actual circuit that the chip controls is very bullet proof and I have two of them - the same thing is happening on both with the new download. I did go back to a much older script that has previously worked and I downloaded that. Result - that is no longer working either (i.e. it's not the script and not the picaxe controlled circuit!).

So I am at a dead end. I have no idea where to look or what to test. I have three chips and they have all done the same thing. I know one end from another, so they have not been put in back the front etc.

Any ideas please? Is there any process for systematically isolating this type of problem?
 

lbenson

Senior Member
And put into your code some sertxd debugging statements to see where the program is going.

In particular, at the beginning (after a "PAUSE 1000" to let things settle on startup), SERTXD("Start",cr,lf)

If you see "Start" printed over and over, something is causing your program to reset repeatedly.

Oh, and welcome to the forum.
 

erco

Senior Member
Welcome to the forum. When something goes wrong like this, there is either an AHA or DOH moment in the offing. There's a 40% chance that it's low batteries or power supply. Always try BRAND NEW BATTERIES FIRST.

Otherwise, something changed and you're not aware of it. Sounds like the Picaxe is alive & well since it's being recognized and is downloaded to properly. Remove it from your circuit (or disconnect every connection to every pin) so you can test it separately from your hardware (which may be the problem). Write tiny programs that test every pin individually. Output pins: run a program to toggle it every second so you can test it with a meter. Input pin, run a test loop that continuously displays (debug or sertxd) pin status onscreen while you alternately connect it to ground and Vcc. You'll zero in pretty quickly when something tests weird.

lbenson already mentioned the classic test output to see if it's resetting.
 
Last edited:

BruceT

New Member
Thanks everyone. I do have a further development - I just had someone else upload the script to their pixaxe controlled circuit (same as mine) and it works!!!

So it seems that my problem is in the download process. I have checked the voltage on the 08 Proto-Board and it was 3.7v. It is now 5.3v but no change to the result. Should I still do the debug or sertxd procedure now? Sorry, I am very new to all this! In relation to this, Ibenson, you mention that if I see "start" printed over and over.... where would I see that? My circuit is a simple passive infrared sensor that fires a camera. I have nowhere for any feedback to 'print'. Am I missing a very basic bit of info here?
 

cravenhaven

Senior Member
Ibenson suggested that you should add an extra line into the beginning of your program that sends a message out to the serial terminal. That way you can at least confirm that the picaxe is running and if you keep getting the message it may indicate that the picaxe is continually rebooting.
First thing though is to upload your program to the forum so that other members can verify that there is nothing seriously wrong with the program you are attempting to upload.
Just create a new response to this thread and copy and paste the code from the editor.
If you put statements like these before and after your program text, it will be easier for everyone to read. (Without the quote marks)
"["CODE"]

["/CODE]"
 

BruceT

New Member
Hi, here is the code. Before you say anything...think amateur... I only wrote the lowpower: section. I don't fully understand all the declarations and assignments made at the outset!! :) You will see that I commented everything so I could be sure of the timing intervals (primarily).

The first option holds the camera shutter open for 65 secs when on a B setting. The second takes two images in reasonably close succession (approx 2 seconds).

Code:
symbol ShutterPin=0
symbol CameraPowerPin=1
symbol TrailFeederSwitchPin=pin4
symbol MotionSensorInputPin=pin3
symbol LEDpin=2
'symbol PAXE=5
symbol ActivityMode=bit0 ;0=off and 1=on
symbol StartWithWalkTestONorOff=bit1
symbol CameraIsONorOFF=bit2 ;keep track of camera being on or off for activity mode
symbol TimeToTurnCamOnToRefreshFlash=w3
symbol TmeWaitAfterCamOnToPresShuter=w4
symbol DelayBetweenPictures=w5
symbol TimeForWalkTestToEnd=w6 ;delay for walktest
symbol i=b1
disablebod
Low ShutterPin
Low CameraPowerPin
Low LEDpin
input 4
CameraIsONorOFF = 0
Pause 5000			
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++    
  
TimeToTurnCamOnToRefreshFlash=975	;975 = 2.34 minutes, 25,000 = 1 hour, 50,000 = 2 hours with NAP3 (.144)
TmeWaitAfterCamOnToPresShuter=100;"0.1 Seconds"
StartWithWalkTestONorOff = 1  ;on = 1 off = 0
DelayBetweenPictures=1 ;26 = 60 seconds between pics in feeder    mode     
TimeForWalkTestToEnd = 208 ;Time for  walktest   0.144 secondss for nap3(208x0.144 = 30 seconds)
;Pause is in millseconds - value 0-65536ms.  
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++    

Walktst:
IF StartWithWalkTestONorOff = 1 Then
	w1=w1+1 
	NAP 3
	IF MotionSensorInputPin = 1 Then
		High LEDpin
		Pause 1000
		Low LEDpin
		Pause 3000 ;for sensor to settle
		w1=0
	EndIF
	IF w1 >=TimeForWalkTestToEnd Then
		StartWithWalkTestONorOff = 0
		For i = 1 to 10
			High LEDpin
			Pause 200
			Low LEDpin
			Pause 100
		next i
		Pause 1000
		GoTo lowpower
	EndIF
EndIF
GoTo Walktst
lowpower:
IF MotionSensorInputPin=1 Then
		Pause 10
	IF TrailFeederSwitchPin = 1 Then	
		High CameraPowerPin		; Turn Metering ON
		Pause 1000 				; Wait 1 sec
		High ShutterPin			; Take a Picture
		Pause 65000				; Wait 65 secs
		Low ShutterPin			; Close shutter
		Pause 2000				; Wait 2 sec
		Low CameraPowerPin		; Power Off
		Sleep DelayBetweenPictures	; Wait 2.3 sec	
	Else
		Pause 10
		High CameraPowerPin		; Turn Metering ON
		Pause 1000				; wait 1 sec
		High ShutterPin			; Take a Picture
		Pause 500				; Wait .5 sec
		Low ShutterPin			; Shutter closes
		Pause 2000				; Wait 2 sec
		High ShutterPin			; Take a Picture
		Pause 500				; Wait .5 sec
		Low ShutterPin			; close shutter
		Pause 500				; Wait .5 sec
		Low CameraPowerPin		; Turn Metering OFF
		Pause 1000				; wait 1 second
	EndIF	Nap 4				; sleep for 288ms
ENDIF
NAP 3	
GoTo lowpower				;Do it forever
End
 
Last edited:

BESQUEUT

Senior Member
TSo it seems that my problem is in the download process...Should I still do the debug or sertxd procedure now?
YES
In relation to this, Ibenson, you mention that if I see "start" printed over and over.... where would I see that?
If you add a
sertxd("start",13,10)
at the start of your code (before first loop), you will see at least one "start" in the terminal emulator window. (Thumbnail Picaxe/Terminal, if it is not automaticaly open)
 

cravenhaven

Senior Member
BTW:
What change did you make.
Is this the board you are using: http://www.picaxe.com/Hardware/Project-Boards/PICAXE-08-Proto-Board
Is the jumper in the correct position?
How are you powering that board, is it with batteries or an external power supply
Try this:
-remove power from the board
-Start the programming download
-supply power to the board

It could be that the picaxe is unresponsive to the programming commands because of all the pauses in the program. By following this procedure the Programming editor wil take control as soon as the picaxe has powered up and before the program has started to run.
 
Last edited:

The bear

Senior Member
@ BruceT,
Are you running your program in the simulator? If so, you will see the results of 'sertxd' on your PC screen.

Good luck, Bear..
 

hippy

Technical Support
Staff member
So it seems that my problem is in the download process. I have checked the voltage on the 08 Proto-Board and it was 3.7v. It is now 5.3v but no change to the result. Should I still do the debug or sertxd procedure now? Sorry, I am very new to all this!
Make sure you have saved the project you are working on, then start a (temporary) new project to check what is happening. Make that program -

Code:
#Picaxe 08M2
#Terminal 4800
Do
  SerTxd( #w0, " - I am alive!", CR, LF )
  w0 = w0 + 1
  Pause 1000
Loop
After you download that, does a Terminal window open, and do you see the "I am alive!" message prefixed with an incrementing number ?
 

BruceT

New Member
Hi Besqueut, please forgive my ignorance, but I have no idea where to find the "terminal emulator window". I am using Picaxe Editor 6.0.9.2 and I see nothing that resembles that. Should I be using a different program? I have added the code.
 

BruceT

New Member
Hi again,

I think I have worked a few basics out, and the terminal emulator window is under the PICAXE tab and is called terminal ... :) I have created a new script with the code that Hippy has provided and uploaded it. Nothing appears in the terminal window. Also, I have added a few sertxd lines to the original code and uploaded - again, same result; nothing in the terminal window.
 

BruceT

New Member
BTW:
What change did you make.
Is this the board you are using: http://www.picaxe.com/Hardware/Project-Boards/PICAXE-08-Proto-Board
Is the jumper in the correct position?
How are you powering that board, is it with batteries or an external power supply
Try this:
-remove power from the board
-Start the programming download
-supply power to the board

It could be that the picaxe is unresponsive to the programming commands because of all the pauses in the program. By following this procedure the Programming editor wil take control as soon as the picaxe has powered up and before the program has started to run.
Hi Cravenhaven, your questions - yes, that is the proto board that I am using. Yes, jumper is ok.
Power is via three AA's. If I try to start the download with the power disconnected, the chip can't be found and I get an instant error message.

I have had someone else upload the program to the exact same type of circuit as mine and it works. so I think the problem is in the compilation or download process, although all messages indicate a successful download.
 

BruceT

New Member
Make sure you have saved the project you are working on, then start a (temporary) new project to check what is happening. Make that program -

Code:
#Picaxe 08M2
#Terminal 4800
Do
  SerTxd( #w0, " - I am alive!", CR, LF )
  w0 = w0 + 1
  Pause 1000
Loop
After you download that, does a Terminal window open, and do you see the "I am alive!" message prefixed with an incrementing number ?
No! Nothing appears at all.
 

cravenhaven

Senior Member
What cable are you using, the RevEd AXE027 cable or some other type?. Have you done a cable 'configure and test' from the picaxe editor?.
Does the editor still recognise that it is an 08m2 chip when you click on 'Check PICAXE type connected'?.
 

cravenhaven

Senior Member
Whew!!, this is a toughy :)
Maybe post a picture of your actual setup,both sides of board with chip inserted.
Seems odd to me that you cant start the programming before powering on the board. This is a standard method for recovering from an otherwise non-responsive chip.
Dont suppose you're located nearby anyone here?.
 

BruceT

New Member
I can post a picture, but it will look very much like the classic image of the proto-board on the website. I have gone over all the solders with a 10x hand lens to look for any flaws - nothing. In any case the upload to the chip says "successful" so if I had a poor connection, it probably wouldn't say that(?) The jumper is on "prog"... "Start the programming without powering on the board" - maybe I am doing the wrong thing? I have a set of three AA's providing power, so I prised off one of the connectors and then hit the upload on the picaxe program.... is that what you mean?
 

inglewoodpete

Senior Member
I can post a picture, but it will look very much like the classic image of the proto-board on the website.....
Yes, post a well-focussed photo of the front and back view of your proto-board. There is some obscure problem that forum members can probably help you with. Since we can't look at your board in person(s), we'll need to see photos of how it's assembled to be able to eliminate there being a hardware problem. Also, what part of OZ are you in?
 

BruceT

New Member
Hi Inglewoodpete, I am just north of Toowoomba in Queensland. I will take some pics soon, but just at the moment I am going over all the solders and connections to see what I can find. I just started up an old computer and ran the download on a very old and very different version of Picaxe, and that upload shows the same problem. So I am with you...it's the proto-board. It has to be.
 

Jeremy Harris

Senior Member
This may seem a daft thing to raise, but in the first post in this thread you wrote:

Picaxe Editor - I go to "clear" (since the other buttons in that group don't appear to work), the system tells me that it has found the chip on COM3 and it then downloads the program and tells me that it was successful.
That option writes zeroes (I think) to every programme memory location to clear any programme that may be there, and reports back when it's been successful. The option above in that menu, Program, writes the programme text in the PE window to the chip, via the compiler.

I may be way off the mark here, but thought it worth chucking into the debate.
 

hippy

Technical Support
Staff member
I may be way off the mark here, but thought it worth chucking into the debate.
It's the most likely thing I can see which explains it. Well spotted.

If the download is successful it means serial send and receive are working, the firmware is communicating as expected during the download, and the hardware is configured correctly for download.

And if that is so a looping SERTXD should report something back after download.

However, a single SERTXD might not show anything if there is no PAUSE at the start of the program. Its output can be been and gone before the Terminal window opens.
 

erco

Senior Member
Sure sounds like a hardware or power problem if you have 3 picaxe chips all doing the same thing. Remove the chips from your wayward boards and test them in a known good board. Or breadboard, it takes 5 minutes to breadboard the download circuit and bypass caps.

You ARE using bypass caps, right?
 

erco

Senior Member
If I try to start the download with the power disconnected, the chip can't be found and I get an instant error message.
It's also curious that you get an instant error message. Without any Picaxe nor download cable connected to the PC, PE5 gives me a 6-second delay from clicking "Program" to an error message. Are you using PE5 or PE6?
 

Jeremy Harris

Senior Member
It's also curious that you get an instant error message. Without any Picaxe nor download cable connected to the PC, PE5 gives me a 6-second delay from clicking "Program" to an error message. Are you using PE5 or PE6?
My experience is the same; I'm sure there is a built-in delay of a few seconds, to allow you to do a "power on reset" after clicking the programme button, before the error message pops up.
 

BruceT

New Member
Hi Jeremy and Erco, are we not talking about two different things here? A download cable not connected is not the same as cutting the power from the proto-board (?) When I say I get an error message, that's when I disconnect the 5v power to the proto-board, not when I disconnect the cable from the computer. Maybe I need to understand better, what you want me to do.

Ok, I did just disconnect the power (5v) and I hit "clear", then waited about three seconds and reconnected. While not connected it said 'searching for device' and then when connected, it did the download. It didn't make a difference to the outcome - still not working. I notice that you say that you hit "program". On my version of picaxe, the only button that works in that set is the "clear" button (v. 6.0.9.2). Is there a better version?

Also, a further update - I just added the caps. Result = nil.
 
Last edited:

Rick100

Senior Member
Hello Bruce,

On my version of picaxe, the only button that works in that set is the "clear" button (v. 6.0.9.2). Is there a better version?
You can go here and download the Picaxe Editor ver 5 .
http://www.picaxe.com/Software/Obsolete/PICAXE-Programming-Editor/
A lot of people still use it. You don't have to uninstall ver 6. When you start up ver 5 , a window will pop up allowing you to set the com port and chip type. You can also get to this window by clicking View , Options from the menu. I would try loading Hippy's test code from post 13 and then hitting F8 to bring up the terminal window. When you say 'only button that works' to you mean the button is greyed out?

Good luck,
Rick
 

BruceT

New Member
Hi Rick100, yes. The other buttons in the set are program and then below, these two (clear and program) are grouped in the download sub-menu, if I can call it that. The actual Program button does nothing.
That's ok, I am setting up Ver 5 now. Will let you know what happens.
 

BruceT

New Member
Rick100, I am running ver 5 now and at least it feels as if I can access the settings more easily. I download (either way, button or f5) and all appears to work well. I have the terminal window opening, but nothing to show. I need to add a sertxd again to see if I can get a showing. It still comes back to the proto-board but I have added some caps as suggested, I have gone over the whole thing with a multi-meter to look for dud connections...the only thing that remains is that little cap - the "1K63". Maybe it's dead. I will have go shopping to get a new one of those. May be a while.
 

Rick100

Senior Member
Hello Bruce,

I would use Hippy's code since it repeatedly sends text. Until that works something is wrong. If you can post some pictures it would be helpful.

Good luck,
Rick
 

BruceT

New Member
Yes!!! I was thinking the same thing and so I just did that and it worked perfectly! So in Ver 5, there is an option to clear the hardware memory. I did that and then uploaded my script...and guess what!!!?? It works!

Yes!!! I am a convert for ver 5 now! But still not sure if that was the whole story! In any case, I don't need to look any further and I have learned a good deal more about the Picaxe process!

A big THANKYOU to all those who provided suggestions!!! Much appreciated. Hopefully if I keep learning, I might be able to help others one day! Cheers, Bruce
 
Last edited:

hippy

Technical Support
Staff member
Okay; so the problem comes down to why the Program button is not active within PE6. Once it is active everything will probably work as expected, as it does for everyone else.

Could it be that your source code is in a .txt file or somethingrather than a .bas file ?

Perhaps post a screenshot of PE6 running.
 

hippy

Technical Support
Staff member
Yes! I did wonder about that. How do I create the programs as .bas? My files are all txt's.
Exact means will depend on which version of Windows you are using, but if you click on PE6's File menu, then Save File As, you should get a file dialog. At the bottom there should be a drop down, which probably says "Text files (*.txt)".

Change that to "BASIC Files (*.bas)", remove any ".txt" in the file name part, then click Save.
 
Top