28X2 Does not run program upon powering up.....

The program on my 28X2 does not boot when I turn on the power to the chip. When powered up all outputs are set high and the program does not run. The only way I can get the program to run is by pressing the reset button. How can I get this to auto boot without designing a one shot circuit and hooking it to the reset? Is there some code I'm missing to set this up?
 

inglewoodpete

Senior Member
Welcome to the PICAXE forum.

The first question that comes to mind is: Do you have the two download resistors permanently wired into your circuit?
 

hippy

Technical Support
Staff member
Welcome to the PICAXE forum.

It sounds like you might not have your PICAXE circuit entirely correct; Reset needs a pull-up resistor, and the Serial In needs either the download interface fitting or a pull-down resistor to 0V for reliable operation.
 

hbl2013

Senior Member
I have the same problem with the 18M2 and the 20M2. They both are used in a clock circuit and will sometimes display nothing, or garbage after a short power (Mains) outage. The cure seems to disconnect them from the Mains for several hours. They will then start up normally when they are connected again. (Repeated resetting the chip by removing power for a shorter time does not always seem to help.)
Incidentally, is there a way to ignore short power interruptions by using a very large capacitor (!000 uF or more) in the DC power rail? I seem to recall reading that somewhere, but can not remember the details.
 
Last edited:

AllyCat

Senior Member
Hi,

The M2s have a "brownout" detector, so the PICaxe should re-start cleanly if the supply rail dips below the defined threshold voltage (~1.8v). Needing several hours to recover sounds like a hardware (or poor programming) issue.

A PICaxe at the default clock frequency requires less than 1 mA, so 1000 uF should give at least 1 second of operation without any external supply. BUT that assumes there are no other components/modules running on the same supply rail which drag the supply voltage down faster. So you might need a few strategically placed diodes (with decoupling capacitors) in the supply rail. And of course the software may need to "know" that another module (e.g. an OLED or backlit LCD) has briefly "lost" its supply (and is now showing garbage).

Cheers, Alan.
 

hippy

Technical Support
Staff member
@ hbl2013 : It sounds more like your display is not being properly re-initialised after power has been interrupted. LCD displays can sometimes be prone to being afflicted by that.
 

hbl2013

Senior Member
@hippy - The LCD used is the Sparkfun 232LCD, which has a piggy-back serial driver on the LCD. (Now a Retired Part). I allow a pause of a few seconds in the beginning of the program to get it initialized. I did not want to go into the details in my posting, and I did not mentioned that this garbage does not occur every time, it seemingly happens randomly But when it happened, the procedure described was used to get it going again.

@AllyCat - What "poor programming" do you think can cause this problem? Seriously, it would help to know it so that I can avoid it. - Modules/components used - I think that the LCD will draw quite a bit of current in comparison with the chip itself. I have to look into that. ---- BTW Since I am only interested in protecting the chip itself, I can use a cap. in its power supply line only.
 

inglewoodpete

Senior Member
@ hbl2013 : It sounds more like your display is not being properly re-initialised after power has been interrupted. LCD displays can sometimes be prone to being afflicted by that.
I've had OLED displays that actually have to be power cycled* to get them to reinitialise properly. *Switched off for a minimum of a couple of seconds.
 

AllyCat

Senior Member
hI,

@AllyCat - What "poor programming" do you think can cause this problem? Seriously, it would help to know it so that I can avoid it.
By "poor programming" I basically meant "Not taking into account the known (or maybe unknown) chracteristics of the hardware".

As you say, the display may take much more current than the PICaxe, so you may need a "strategy" to handle a power dropout situation. That probably means that you need to enure that the PICaxe "sees" any voltage drop that may corrupt/reset the display and initialises the display again:

You might be able to rely on the PIC's brownout detection, maybe dividing down the Vdd from the LCD so that it acts at a higher voltage than when (i.e. before) the LCD "dies". Or perhaps you try to keep the PICaxe running from its own supply (with a large decoupling capacitor and diode to prevent the LCD "stealing" current from it) and separate detection circuit/code (maybe Interrupt and/or Latch driven) if the LCD voltage falls too low.

Cheers, Alan.
 
Top