Sleep or Euthanasia?

TerryFricker

New Member
I'm using a Picaxe to trigger a digital camera once an hour. I'm using a DS1307 rtc for the timing reference, and have connected an LCD (non-serial) to display Time and Date, number of shots taken and battery voltage. (the LCD is only for debugging and will be removed in the final project) I'm new to the Picaxe and was quite chuffed to get everything working.

However, problems started when I introduced a 'SLEEP' command. The idea being that the pic wakes up every 50 sec to check if the rtc has changed its hour (minutes=0, in fact). I used SLEEP 50000 - thinking the parameters were u.secs. When I tried to download a correction, I got the 'Hardware not found on COM1' error message. After several more failed attempts, including powering down and up the picaxe board and pc, and trying to send a 'blank' program, I gave up on this 28X, and loaded a 18X. I tested the program successfully - with a SLEEP 20 command. However, when I came to download a modification, I ran into the same download error as before.

To confirm the problem (my stupidity?), I've now killed off a 18A, using a short LED blinking program. Again, download worked until a SLEEP 2 command was introduced.

Any ideas gratefully received. (I'm using the rev-ed picaxe experimenter board)
 

BeanieBots

Moderator
Try using the reset button.
While holding down reset, start the download process. Do not release the reset until the download screen looks as if it is about to actually start the download.
 

Kiwi Bruv

Member
I have the same problem.

I have an 18x and I have to try to download at least 3 times before it'll work. It works consistently on the 3rd or 4th time. I have never had probs before and have no probs with other projects. In fact I concluded it was something to do with the sleep command because I have two boards doing the same thing. The only common factor is they both have the picaxe sleeping for about 50s every minute.
 

Technical

Technical Support
Staff member
During a sleep the PICAXE is in low power mode for multiples of 2.3s, and so during each 2.3s period does not (actually cannot) check the serial line for a new download signal from the computer. Therfore it may 'miss' the first download signal.

This can always be resolved by the hard-reset procedure (releasing the reset switch or connecting power WHEN the download progress bar is on the screen (not before)). When a PICAXE resets the first thing it checks is for a new download, and so resetiing the chip when the progress bar is on screen will be overcome the slepp issue.
 

Technical

Technical Support
Staff member
As a footnote, it is not possible to download any program that cannot be corrected by the hard reset procedure - on powerup the PICAXE chip checks for a new download before accessing any of the program currently in memory.
 

TerryFricker

New Member
BeanieBots/Technical,
Thanks for your help. I've now resurrected the devices by using the hardware reset button. My mistake was waiting for the BLUE PROGRESS BAR to appear, rather than just the Download pop-up itself, before releasing the reset button. Obvious (now!)
 
Top