Loosing PicAxe chips

I am having an issue that I can't get a handle on. I am programming PicAxe 18A chips
and was having some success for a few days.

Now I can't get the chips to work. I will be programming the chip and suddenly the chip
will go missing. The editor refuses to recognize that the chip is there. I try a hard reset,
but the chip is just gone. I have had this happen with three chips is the course of an hour.
The chip shows up, I program it a few times and it goes missing. A new chip works for a
few times and then goes dark.

I have checked the programming cable several times and it shows as good.

The power supply is a good H/P regulated unit. I even changed to another supply but the
same thing happened again.

What can I look for?
 

premelec

Senior Member
Sounds like a hardware problem - loose or broken wires in the programming leads etc... check with ohmeter - check visual - good luck...
 

AllyCat

Senior Member
Hi,

I'd still suspect an incorrectly applied "Hard Reset" procedure. Perhaps the output voltage from the PSU is holding up for longer than you realise. You could post your program and we can try to see if anything looks "suspicious". Also check the interface levels directly on the Serial Programming Input and Output pins, if you can. To start programming, the Serial Input should rise from 0 volts to Vdd (and then the Serial Out "validate" this).

I only once encountered a problem similar to what you describe (apart from numerous occasions when the PICaxe supply voltage has proved to be not what I thought is was), and that was eventually fixed by a total power-down and reboot of the PC running the PE.

Cheers, Alan.
 

kfjl

Member
You could try using Axepad instead of the PE to make sure it's not a software problem.
 
Last edited:

erco

Senior Member
Chip getting hot?
Which cable are you using?

Lower the voltage to 3 or 4 volts and see if they last longer. Maybe use 2 or 3 AA cells instead of that PSU.
 

kranenborg

Senior Member
... Maybe use 2 or 3 AA cells instead of that PSU.
I second that, maybe the PSU is not so stable after all (nasty spikes exceeding 5V maybe at switchon/off?) ... . I nearly always use batteries, and the picaxe programming behavior has always been rock solid for me at least.

/Jurjen
 
Allycat,

I will try what you suggested.

I strongly suspect that the chips are broken. Is there any tests you can run on a PicAxe to determine basic integrity of the device?

At this point I can't rule out anything for rock solid sure. But to have two vintage H/P power supplies that I have used for years to both go into device killing mode is nutso unlikely.

When the chips go AWOL I am not flipping the supply on and off or jiggling the programming cable. I just go from being able to program the chip to not being able to program the chip. In the process of going bad the program loaded onto the chip (which was running fine) goes away. I put this (bad) chips into another circuit board and they are still unable to function.

As a side note I was doing a fair amount of PicAxe work using these boards on the same computer (using the serial programming cable) with no problems several years ago. I misplaced the cable and am using a newer USB cable. I was successfully programming 18A chips using this board for a few weeks until this problem came up. So I have had a history of success until today when I lost three chips.

Cheers.
 

erco

Senior Member
"... with no problems several years ago. I misplaced the cable and am using a newer USB cable. "

Smoking gun?
 

premelec

Senior Member
Better post picture of set up AND program you are running. And if you are actually killing chips do use a 3 AA battery pack that perhaps won't supply killer currents.... Have you done basic chip ID read with only Voltage + and - pin and serin out pins connected to anything?
 
erco,

If a smoking gun means that I used the cable for two weeks without any problem...then suddenly it went crazy and sometimes kills chips and other times does not. Nothing is impossible but that seems unlikely.

premlac,

A battery will supply much more current than any supply that I am using. The supply is a premium H/P supply with current limiting. And I have used two different supplies.

However, the basic chip ID read is something new.

"Have you done basic chip ID read with only Voltage + and - pin and serin out pins connected to anything?"

There is a command in the programmer that tells if a chip is hooked up. Is that what you are talking about? The "Check Picaxe type connected" command tells me that a chip is connected until the chip "dies" then it says that no chip is connected.

Once again I change nothing physical (ie power on power off, programming cable etc) . All I do is try to load a edited piece of software and the chip is lost to me...

Cheers.
 

premelec

Senior Member
If you are killing chips the way to find out more is not to do the same thing over and over... your don't say if your PS is current regulated and you can set it to very low current - even if so many such supplies have large capacitors that discharge into the load before current regulation kicks in which can kill many semiconductors. I suggest you put a resistor in series with V+ and watch the voltage [as in E=IR current] across that with a multi meter. Without schematic and program it's not possible to know what currents you are trying to control. What current do you measure going into the chip when it is operating? Is it anywhere near chip limits?
 

AllyCat

Senior Member
Hi,

Of course it is possible to kill PICaxe chips, but it's very unusual. The issue is nearly always due to downloading a program which contains one of the commands that can disable the Bootloader ; The correct Hard Reset procedure is not easy to apply, particularly (IMHO) with PE6. and/or non-battery PSUs. "Phantom Powering" via one of the I/O pins is also a common issue, so it may be necessary to short-circuit Vdd to Vss (when the supply is off, of course).

How much current does a "killed" chip drain from the power supply (and how does that compare with the drain when it "worked") ? A "raw" PICaxe drains just under 1 mA from the supply and I would only consider it (possibly) "killed" if it drained less than 100 uA or more than 10 mA from the supply (via its Vdd pin).

Cheers, Alan.
 

inglewoodpete

Senior Member
No one has mentioned the #freq directive. It is possible that the 18A is not responding to the download due the its clock running at a different frequency to that expected.

Refer to PICAXE Manual #1, "Getting Started", Appendix B
 

erco

Senior Member
Alan, can you share the code and a pic of the hardware that possibly crashed your chips?
 
erco,

I will look into that. I very seldom post pictures and have never posted software on forums and will have to figure out how to do this.

Cheers.
 

premelec

Senior Member
@IP - I had never noticed that caveat in Appendix B - could easily be the problem that in the program the freq is changed...

@Alan Sailer - you can do a highlight copy in your program text which goes to "clipboard" and then paste that in your forum post. It would be prudent to see if your code changes the frequency while it runs - as changing that would be an easy fix for disappearing chip... See "Attach files" below your post for attaching pictures...
 
premelec,

I will look into that. I'm sure it's simple to do but so am I.

I have done a hard reset several times. Since my supply is current limited it is no problem to physically short out the supply.
I used a set of tweezers. The PC board that hold my chip has a small electrolytic bypass capacitor. It is in parallel with the power supply so it is shorted out also. No effect from hard reset.

There is a little ambiguity about hard reset. Some text says to wait "after the download is initiated". Other text says to wait until the progress bar appears. It's a moot point since I cannot get beyond the "Searching for hardware on COM9" announcement.

The "bad" chips are at about 7-800uA, which is the same as the good chips. So apparently the chips are not electrically dead.

I looked at the #freq stuff. According to appendix B the chip is hard set to 4Mhz. My code does not have "setfreq" command so it should stay at the default 4MHz clock.

This is the text from the manual;

To change the frequency on old (obsolete) parts:With the -08, -18 the internal resonator is fixed at 4MHz and cannot be altered.With the -08M, -14M, -18A, -18M, -18X the internal resonator has a default value of 4MHz. However it can be increased by the user to 8MHz via use of the ‘setfreqm8’ command.When downloading new programs on old obsolete parts, you must ensure the correct frequency (#freq directive) is used to match the last program running in the PICAXE chip. If in doubt perform a ‘hard-reset’ at 4Hz.

I do not understand the statement, "perform a 'hard reset' at 4Hz."

Cheers.

DSC01669.jpg
 

erco

Senior Member
Excellent pic of a nice-looking board. I'm assuming you made the PCB and soldered it together correctly? A pic of the back would help confirm.

You have numerous wires running to external parts. The possibility exists that you have a short circuit somewhere which is slowly damaging your chips. I would suggest removing all those wires and trying a fresh Picaxe. It should last "forever".
 
erco,

The board is etched at home. It is a single sided board and soldered on the back side. I have used this batch of PCBs on at least ten projects with no problem. The last one was about two months ago. Using the "new" USB programming cable.

Shorts? Nothing is impossible. However the chip is just driving an LED display and everything is works just fine until the chip goes away. The display works, the ADC input works. I'm just typing new code to add a few finishing touches and bango...the chip goes away.

If I was modifying the hardware I'd suspect that was the problem. But I'm just typing and clicking a mouse...

The project is so simple that I'm frustrated with all the issues that have come up. It's just a kitchen timer that will play a nice sound rather than the stupid emergency beeper that all timers have. I have never understood why all the "task done" timers in a house have to sound like the stupid piezo buzzers that were invented in the 70's. It's an irritating noise that should only be used when someones heart lung machine is having an issue.

I'm using the 18A to read a 10k pot. Scaling the 0-255 output to two BCD digits that drive two LED numerals. I start the countdown with a push-button switch and want to sound the nice noise when I reach zero. I want to have frogs croaking in my kitchen when the eggs are done.

Cheers.
 

AllyCat

Senior Member
Hi,

There are a number of commands that could block the downloading of a new program, which is why it's best to post the actual (last installed) code (it shouldn't be too large with just 256 bytes of an 18A). The most common is DISCONNECT, and it's often overlooked that SERRXD "invisibly" generates that, but there are other potential "blocking" commands.

Also, we don't know where those white wires are going: There appears to be one to SerOut which could be short-circuiting the Programming Download Handshake. Or any of the others might be "phantom powering" the chip when the supply is removed. However, nothing you've said so far appears to give a specific clue to the problem.

But I still strongly suspect a faulty Hard-Reset procedure, the instructions vary a little between the Program Editors (PE5, PE6, AxePad, etc.). You basically have a window of about 5 seconds: The supply rail MUST be at zero volts until the download starts (when SerIn goes High) and then obviously the supply rail must be fully active before the error message is reported.

Cheers, Alan.
 
So here is the code, warts and all. I was actively working on modifying the code to make a high/low/high pulse that will turn on a MP3 player
to make my frog noises. I apologize if the formatting is screwy or any other coding faux-pas have been committed. The basic code was lifted from a previous forum post;


Cheers.
Code:
; Kitchen Timer with Frog Sound

; Input: Potentiometer: adjust time from 0 to 59 minutes.
symbol P470 = C.2

; Output:  BUZZER: Buzzer piezo-electric indicating the end of the time.
; symbol BUZZER = C.1

; Input: START_BP: non-latching button to start the timer.
; Output: STOP_BP: non-latching button to stop time while in progress.
symbol START_BP = pinC.0
symbol STOP_BP = pinC.7

;Output: CD4511 allowing the display of the tens digit.

symbol CD4511_A_a = B.0
symbol CD4511_B_a = B.1
symbol CD4511_C_a = B.2
symbol CD4511_D_a = B.3

; Output: CD4511 allowing the display of the units digit.

symbol CD4511_A_b = B.7
symbol CD4511_B_b = B.6
symbol CD4511_C_b = B.5
symbol CD4511_D_b = B.4


main:    
    ;debug
    readadc P470, w0        ;Reading the 10kohm pot voltage. +5V to Gnd. Wiper to ADC input.
    w0 = w0 * 60                ; Convert to minute format.
    w0 = w0 / 255
    ;debug w0
        b2 = w0 / 10             ; tens digit.
        ;debug w1
        b3 = w0//10              ; units digit.
        ;debug w3
        b4 = b2*16 + b3       ; convert to BCD.
        ;debug b4
        let pins = b4            ; send BCD to two digit display.
        if START_BP =  1 then goto start_timer
    goto main

    
start_timer:
    pause 100
    w3 = w0
    
    for w4 = 1 to w3        ;One second time loop. * Time setting.
            if STOP_BP = 1 then
                pause 100
                goto main
            endif
        
        w0 = w0 - 1           ; decrement time.
        b2 = w0 / 10          ; tens digit.
        b3 = w0//10           ; units digit.
        b4 = b2*16 + b3    ; convert to BCD.
        let pins = b4          ; send BCD to two digit display.
        debug b4
        pause 1000            ; One second for test, avoid waiting while developing program.
    next w4
    
    w0 = 0
    ; sound BUZZER,(100,10)
    high CD4511_A_b                ; use tens MSB as frog sound enable bit.
    pause 1000 
    low CD4511_A_b
    goto main


    w1 =   w0 / 10


    
    w1 = w1 * 10
    w2 = w0  - w1
 
Last edited by a moderator:

kfjl

Member
I've changed posts #4 and #11.
C.6 may not be the reset pin. I'm not even sure there is a pin C.6. It doesn't look like it.

Manual 1, page 8 says:

The reset pin (if present) must never be left floating. This will give unreliable
operation. Always tie high (ie to the positive supply) via a 4k7 or 10k resistor.

2423318A-pinout.png
 
kfjl,

Sorry that I ignored your earlier post since it didn't make sense to me. The new post does.

However, the board I made years ago (and that I am using now) has a 4.7kohm pull-up resistor
attached to pin 4. The reset button grounds pin 4. Just like the manual specifies.

Cheers.
 

inglewoodpete

Senior Member
I do not understand the statement, "perform a 'hard reset' at 4Hz."
The 4Hz is a mis-type that appears to gone uncorrected for several years. It should read "4MHz".

A "hard reset" reload is where you turn the power to your PICAXE board OFF and then start the download by pressing the "Download" button in the PE. The PE then starts searching for the PICAXE. Apply power within the first couple of seconds and, if all is well, the download should start.

In your circuit you can also perform a "hard reset" reload, where you hold the reset button while you commence the download. Then, once the PE is trying to contact the PICAXE, release the reset button.

If these do not work, I would be looking at the download circuit. The "serial in" pin is normally pulled low by the 22k + 10k resistors. With a multimeter, check that the voltage on the Serial In pin is close to zero when the PICAXE is powered up. Then, with the multimeter still connected, start a download. You should see the voltage move towards 5v (or Vcc - whatever you are powering the circuit with). If this does not happen, follow the download cable test process as provided within PE6.

If the Serial In pin does swing high on a download attempt, check the voltage on the Serial Out pin. This is best done with a LED and current limiting resistor. Normally low, when you start a download, the Serial Out pin should pulse high.

Finally, it has possibly been mentioned in an earlier post but can you get the PICAXE to identify itself when you click on the "Check PICAXE type connected" link in the Workspace Explorer box?

Also, as an aside, your last 3 lines of the code you posted can't be accessed or executed as shown.
 
inglewoodpete,

I kind of figured 4Hz was a typo.

I have been performing hard re-sets. I cannot think of a harder reset than physically shorting the power supply and then opening it after the download process has started.

I am tired of doing this. I am officially insane at this point, by one definition of insanity;

"doing the same thing over and over again, but expecting different results."

I will try monitoring the serial pins as you suggest. I will use the ideal observer, a Rigol scope

I have reset the comm ports (many many times) and tried to get the chip to identify identify itself (many many times).

Chip not found, over and over again. No go. Nada. Zip. Nil. Negative. Nothing. The chips are dead to me :)

I did mention that the code was a snapshot of a moving process. As such. lines of code that have no function remain in the program.
I was asked to show the code as it was when this problem happened. I resisted the temptation to pretty it up.

Cheers.
 

inglewoodpete

Senior Member
Sorry to be so pedantic. I understand your frustration but does the download cable work? Ie in loopback using a serial terminal like the PE terminal to send and receive. Many a forum member has been diagnosed as insane, only to find a broken wire in the download plug.
 

kfjl

Member
kfjl,
Sorry that I ignored your earlier post since it didn't make sense to me.
My bad. It didn't make sense to anyone.

It seems the only thing that's changed between a circuit that works and one that doesn't, is the download cable. I vaguely remember a problem concerning the dimensions of the plug where they didn't quite match with the internal dimensions of the socket, due to Rev Ed changing suppliers.

Maybe someone can confirm this.
 

AllyCat

Senior Member
Hi,

There's nothing in your sample progam which suggests that a Hard Reset would be needed, but there's always the possibility that a corrupt download of the program has occurred. Also the Hard Reset should be easy with the additional hardware facility of the 18A. The supply drain is absolutely correct for a "good" PICaxe, but it's just conceivable that the "wear out" mode of (part of) the EEPROM has been encountered. Again there's nothing in the Program which could do that (and it should be well above 100k re-writes), but maybe an issue with the Program Editor?

So I do wonder if this is related specifically to the "obsolete" 18A, which few, if any, of us will have any practical experience. Are you using PE5 or PE6? PE6 is normally recommended as having less "bugs", but if it has an "issue" with the 18A, then it may never have been found. So I would try PE5 (or vice versa), it's still available at the foot of the software (obsolete) section and can be loaded in parallel with PE6, so you can easily swap between them (but only one can access the serial interface at the same time).

I don't normally recommend "re-installing" any software, but in desperation, do try fully rebooting the PC, or try a different one if available.

Cheers, Alan.
 

premelec

Senior Member
FWIW reheat all your solder joints and if you have an M2 chip see if that is recognized and will program... [note 18 chip
has mid IC connections whereas 08 14 20 chips have end connections].
 
inglewoodpete,

So I got the scope out and ran the tests that you describe.

With a good chip in the board, the following happens,

SerIn Low initially, goes HIGH when the download button is pressed.
SerOut Low initially then a series of pulses as the programming bar progresses.

With a bad chip in the board, the following happens,

SerIn Low initially, goes HIGH when the download button is pressed.
SerOut Low initially, no change when download button is pressed.

So this test show that I am having problems programming certain PicAxe 18A chips.

I have also run the diagnostic on the programming cable. Both the loopback and voltage tests passed (again and again and again).

Nothing new here. Every diagnostic test I have run so far is verifying my initial problem. I can program chips very well until at some point I can't.

Cheers.
 

inglewoodpete

Senior Member
Sounds like you're on top of the diagnostics. We have to account for all levels of diagnostic skill in forum members.

If you can take the SerIn pin high and get no response from the SerOut pin then the chip(s) is/are dead.

If this has happened more than once, then I would be concerned that the cause could still be present. To my mind, it is most likely to be power related (and that includes ground problems). The only time I have ever had a PIC or PICAXE chip fail was related to power supply. I've had a voltage regulator in a switch mode power supply fail. The chip permanently stops working at about 8 volts! I've also inserted chips into their socket the wrong way around - some survive, some fail. Have you tried to program the PICAXE using a laptop computer plugged into its charger that has an unearthed (two mains wires) power supply? While I have not personally experienced it, a power spike from a dodgy laptop power supply has caused the death of more than a few microcontrollers.

If you are still at loss as to why or what has happened to your chips, it might be a good time to update to 18M2 chips. 18As are very old and support/knowledge is limited.
 

papaof2

Senior Member
While you have the scope out, watch the 5 volt line when you short across the capacitor to do an Edison reset. Those tweezers are not the instant good connection of a snap-action switch and could be causing noise/spikes on the 5 volt line.
 
inglewoodpete,

Thanks. You seem to have supplied the acid test. I was looking for a black and white go/no-go.

The fact that the chips are drawing the expected current leads me to believe that somehow the firmware was corrupted? Or is it more
complicated than that?

I did a non-definitive test today by loading up the PE6 and drivers on a different laptop, a much more modern machine. I spent a dozen or so
edits and downloads on another 18A with no problems. uing yet another power supply. So the fault could be a) the old laptop b) one or the other of the two other power supplies or c) different location (my office vs the lab). As usual I take the anti-science route and change many variables.

Thanks for all the help.

Cheers.
 

Technical

Technical Support
Staff member
Out of a, b and c only b could be the culprit! Many power supplies do not regulate as they advertise, and yes they can spike and kill the chip. Go back to the original setup and test with 3xAA cells instead to give 4.5V, we suspect you will then never have an issue.

Mechanically check the solder joints on the pins on the download socket too, as in the photo it is not correctly lying flat on the pcb (the circular bit is meant to overhang the end of the pcb to lie flat). We've seen joints soldered like this crack when the cable is repeatedly inserted.

Also, on the old 18A, you can also use the reset switch for a hard reset. Hold the switch down, click download on screen, release switch.
 

premelec

Senior Member
I would like to know what killed them - you mention HP current limited supply - do you mean a fancy bench unit? One time I used a supply testing an expensive unit - it had a 6 or 60 volt max switch.... wrong switch... :mad: killed it... I've never killed a PICAXE though occasional overheat... usually use 3 AA batteries to start off... good luck with your future projects...
 
I would like to know what killed them also but short of trying to kill more is isn't going to happen. Since the chips still draw the rated current they are not dead from over-current.

All the supplies are quality bench top style units that I have use for many projects.

Cheers.
 
Top