download failures

GreatWhiteNorth

New Member
I've been happily coding and downloading for the past few months but as of last night, I started getting "Hardware not found" errors when I try to download.
So I
a) switched to my "AXE Stack 28" development board in case my custom board was the problem - didn't help (board from www.hvwtech.com)
b) switched to another Picaxe 28X1 chip in case I had somehow damaged it - didn't help
c) rebooted computer (WinXP using serial com cable) - this allowed me to download the program once - before it locked up again - could be the wait with the picaxe powered down.
d) tested the serial cable by connecting tx-rx and using terminal window to send characters back to screen - no problem
e) change the COM port - didn't help
f) reduced the program size - currently at 1724 bytes out of 4096 so I reduced it using #rem/#endrem directives to 1429 bytes out of 4096 - I was able to download the reduced size
g) using msconfig, disabled all services to prevent any possible COM port conflicts. - didn't help - still had failure to download with the larger loads.

Am I approaching the code limit for the 28X1? Anyone know why I'm getting the failure to download? Does loading a larger file require a larger power supply?


Right now I'm trying to isolate any code I have that could be causing this
Here is a snippet of code that I was working on when all this started.

Code:
 symbol battery_level_ptr = 40
 symbol battery_check = 50

ptr = battery_check
if @ptr = 0 then
  ptr = battery_level_ptr
  readadc battery_level, @ptrinc
 `sertxd ("battery level:: ",#@ptr,13,10)
  calibadc @ptrdec
 `sertxd ("voltage ref level:: ",#@ptr,13,10)
  
    if @ptr > 120 then ' batteries low, switch
     high portc low_pwr
     ptr = battery_check
    `@ptr = 100
    elseif @ptr < 30 then
     low portc low_pwr
     ptr = battery_check
     @ptr = 100
    endif
 else
  @ptr = @ptr - 1
 endif
My full code size of 25KB exceeds maximum of 19KB to upload to this site.

Thanks
 

westaust55

Moderator
The error message suggests a download does not start as opposed to failing part way through the download.

Do you have any long pauses in the program code?
Were these effectively removed when you used the #rem/#endrem directives?

Have you tired a hard reset just as you start downloading. This is done by either power down or holding the reset button down while commencing the download. Once the download pop-up window is displayed then power up the PICAXE chip or release the reet as appropriate.

No, there is no need for a higher capacity power supply. I think that the PICAXE will consume less than 5 mA when you are downloading a program.
If using batteries, are they good and producing a total of 4.5 volts ?
 

GreatWhiteNorth

New Member
I do have a "sleep 10" command which my rem/endrem's may taken out. I tried holding the reset button, but I may have been holding it for too long. I'll check out the sleep and try the hard reset again tonight.

Thanks.
 

GreatWhiteNorth

New Member
Also, I'm not using batteries, the development board I'm using has it's own voltage regulator which I'm feeding with a 12volt/1amp supply. I checked the voltage on the picaxe chip supply pin while attemping a download (both good and bad) and they looked fine (5v).
 

gengis

New Member
Same problem

Pulling my hair out too. The flavor of the chip doesn't matter, the power source ditto. Passes all the communications tests fine just won't load a program or clear a program from memory.

My problem seems to have started coincidently with adding a usb driver for an external back up drive. I did get it working for a time by telling the prolific usb driver to "repair itself." But the next time I booted it was out to lunch again, and now nothing seems able to resurrect it, including removing the driver and letting Windows reload it.

I suspect a Windows software conflict between usb drivers.
 

GreatWhiteNorth

New Member
I'm using the serial port, so I don't have to worry about any usb stuff. If the sleep command can prevent the download, then I strongly suspect that is my problem. But I'll have to wait till tonight to test it out.
 

gengis

New Member
I did try a recently acquired chip and that didn't work either.

I wouldn't think the sleep command would interfere unless it was sleeping when you were trying to download - and a power up reset/load should take care of that possibility.
 

gengis

New Member
And thanks, you gave me another idea. I have a serial port that is connected to my modem and it would be worth the effort to switch cables.
 

John West

Senior Member
That's indeed a good idea, Flooby. Sometimes it's easier to just do things differently than to try to figure out why a certain com system isn't working.

I'm perfectly content to keep an old laptop and serial cable handy just to program my PICAXE chips, because I don't change anything on it and I know it always works.
 

gengis

New Member
I've been considering a $200 used corporate lease laptop just for the axe. My desktop is ancient with drives that have migrated from 1990's into newer cast-off systems, so a rudimentary laptop would probably blow my desktop away (not that I need anything too fancy for what I use it for)
 

John West

Senior Member
A simple laptop PC is handy for doing picaxe work while on the go. With the circuits themselves so small, and multimeters and PC based digital accessory scopes so small, a laptop can provide a complete working environment for picaxe projects just about anywhere. I consider it a fundamental part of the kit.

I've worked on my picaxe projects while on an 18 hour AMTRAK train ride across the USA. It's more fun that just reading or looking out the window.
 

GreatWhiteNorth

New Member
Solved, it was the sleep command causing the problem . That and my ineptitude in performing a hard reset. I was expecting the download to begin while I was holding down the reset. But by releasing the reset as soon as the popup window appears, it works fine.

Thanks to Westaust55 and everyone else who replied.
 
Top