Need understanding of brown out detector in 28X2

Dave E

Senior Member
Hello all,
I started looking into connecting a GPS to a 28X2. As the GPS works better outside, I took my circuit outside and even powered it with a small solar panel. While I had it outside, on several occasions I would return to it and find the indicator LED on the GPS indicating that it was powered and tracking and the LCD display had a cursor blinking but no info being displayed so my Picaxe was not running. I also know this because I have the 28X2 toggle an LED after each pass through the program and it was not blinking. I can press the reset button and everything will start running fine.

I do know that the sun is shining through trees most of the time I have been testing this circuit so I added about 1 Farad of super capacitor storage to the circuit to help with voltage sags as the trees and clouds block the sun. I tested this by removing the solar power and watched the circuit continue running for a minute or so before the Picaxe lost enough power to stop running. With that capacitor in circuit, the voltage does not change very fast in either direction so I was wondering if the very slow rise in the voltage after the sun comes back out from behind a cloud could be affecting the brown out detector.

I would like to know if anyone has any info that might help. If needed, I will draw up a circuit diagram and post my code but as long as the power is steady, the circuit keeps running. I also use time outs in the code so the program does not hang while waiting for input from the GPS.

If anyone has any insight, it would be appreciated.

Dave E
 

srnet

Senior Member
I have read you post several times, and I really cannot work out what it is you have connected, I doubt anyone could, so a full circuit diagram is required.

You make no mention of a storage battery, so I would assume there is not one connected, that could certainly explain the problems you are getting.

To stop us guessing and speculating, what is the purpose of this device, can you give us a clue ?
 

srnet

Senior Member
And incidently;

"Need understanding of brown out detector in 28X2"

The Brown out detection (which you can disable) causes a reset, so the PICAXE should just reset and continue to run.
 

Dippy

Moderator
Slow power-up ramp can upset PICs. They need a clean start.
Brownout detection is really aimed at providing a clean start (or restart) within a certain range i.e. a lot better than nothing.

A technique used for intermediate speed power ramps is to add an RC on the reset pin. This ensures the supply voltage is higher than the reset pin and can help.

When it gets really slow and painful and nothing seems to work then this is where proper power supervisory chips come in to play.
These hold reset Low until there is sufficient oomph to supply the micro.
You could probably roll your own with an op-amp/comparator including home-made brownout.
Obviously this will increase power consumption a bit depending on your chip and design choices.

But without full details I can only give you this slightly vague advice.

There are articles and App Notes on Microchip website, maybe some kind person will find them.
It's a subject that doesn't crop up very often so most people don't know about it.
 

Dave E

Senior Member
Sorry if things are a bit unclear.

While reading info from a GPS with a 28X2 while being powered from a solar panel (no battery), I noticed that sometimes the Picaxe would stop running. I have not been there when it happens. I assume it was because the voltage dropped while the sun went behind a cloud and the brown out detection (BOD) in the chip did not reset the chip properly. I do have a 1 farad cap on the power to act as a temporary storage device. This large cap will cause the voltage to rise or fall very slowly since it is supplied with only a small solar panel.
My question is: (1) for the BOD to work properly, does the voltage rise from below the BOD (1.9 volts) limit to above the BOD limit need to be fast? (2) does anyone know about any BOD issues with the 28X2?

Dave E
 

srnet

Senior Member
Does anyone know about any BOD issues with the 28X2?
It seems to work within the limits of what it is capable of.

However if you want your PICAXE to be resiliant, or at least always reset itself when the power supplies are unreliable, as they will be from solar panles then you need to;

Use an exteranal voltage supervisor, TC54 etc.

And better, use also an external watchdog supervisor IC.
 

srnet

Senior Member
While reading info from a GPS with a 28X2 while being powered from a solar panel (no battery), I noticed that sometimes the Picaxe would stop running.
Here is why the detail matters, your PICAXE will be using 3mA or so when running, the GPS however will use from about 60mA to 100mA or more depending on the GPS.

So, with no battery to act as backup supply, I would expect your setup will fail.
 

AllyCat

Senior Member
Hi Dave,

If anyone has any insight, it would be appreciated.
I believe the primary purpose of the Brownout detector is to stop the processor "running amok" (corrupting RAM, etc.) when the Vdd falls. The "base" PIC data sheet does specify various parameters for the (re-) starting sequence, but I don't think the fundamental Vdd risetime requirement can be overlooked. I haven't checked the 28X2, but they're probably all much the same. For the 08M2 the first page of the "DC Characteristics: Supply Voltage" states:

D004 SVDD VDD Rise Rate to ensure internal Power-on Reset signal 0.05 (Min) — (Typ) — (Max) V/ms

That's a minimum of 50 volts/second, which I believe approximately correlates to 50 Amps charging a 1 Farad capacitor ! ;)

Cheers, Alan.
 

Dave E

Senior Member
Thanks everyone,
I assumed that was the issue but wasn't 100% sure. As always, the vast and varied Picaxe knowledge base was willing to help and to share a few possible solutions.

Dave E
 

srnet

Senior Member
There are no places on Earth where the sun shines 24 hours a day, its always going to get dark and hence no power. The problem is that as the sun fades, and or objects such as clouds block out the sun, the solar panel supply to the PICAXE can be moving around all over the place. I dont know what voltage threshold is used for BOR, but when I have played around adjusting a power supply manually at low volts (less than 3V) I have certainly seen a PICAXE go unresponsive.

The simple solution for a solar panel only system may be a volts supervisor IC that will guarantee the PICAXE is held in reset if the supply goes too low, say 2.9V. These are simple 3 pin devices, available in SOT23 or T092 packages.

With a GPS involved, and the consequent high current consumption, I would arrange to have the GPS powered off (by the circuit) and only powered on when the voltage from the solar panels is good.
 
Last edited:

Dippy

Moderator
Even though I mentioned a supervisory IC yesterday I wonder whether you ought to consider a bit more hardware smartness into this.
I can't see a watchdog supervisor will help.

When your voltage level is just above the turn-on threshold the extra power consumed will suck it down.
You can end up with a situation where things hunt around the on-off. Not good.

You need enough energy stored such that it can switch on, do its business and then switch off (or sleep).
If you know the consumption and the time required you can calculate the voltage droop in a reservoir capacitor.

Assuming I have understood it correctly you have some options.
You could set a supervisor to switch on at a higher voltage. Home-made swithing will need hysteresis.
You could have hardware which switches on after (say) 30 seconds above a certain voltage.
You could switch the PICAXE on first and ADC the supply so that, when sufficient oomph is available, switch on the peripheral.

Once you suss out the reason then the solution should follow.
But this is still guesswork without a schematic.
 

srnet

Senior Member
Even though I mentioned a supervisory IC yesterday I wonder whether you ought to consider a bit more hardware smartness into this.
I can't see a watchdog supervisor will help.
Unclear what you are saying here.

What are you refering to ?

A Voltage Supervisor, which holds down reset when the voltage drops below a specified value (i.e. the processor has crashed)

or

A watchdog supervisor which is a device that activates a reset pulse if the program does not toggle an input pin at a specified interval.
 

fernando_g

Senior Member
My personal philosophy with solar cells powering remote gadgets, is that they are not full battery replacements. Rather they are consumption reducers.

Which essentially means: the project should be primarily powered from a battery, with the solar cell taking over when there is enough sunlight, to reduce the total amount of milliamp-hours discharged from the battery.

Employing a pair of schottkys to wire-or the solar cell and the battery, the latter which I always use a non-rechargeable lithium one.

In addition, I sense the solar cell's voltage with the Picaxe's ADC, and if it is below certain threshold, I disable the most power hungry devices and even reduce The Picaxe's clock speed to further reduce consumption.
 

srnet

Senior Member
When your voltage level is just above the turn-on threshold the extra power consumed will suck it down.
You can end up with a situation where things hunt around the on-off. Not good.
The simple voltage supervisors I mentioned do already have built in hysteresis, for the obvious reasons.
 

Dippy

Moderator
I don't really want to go off-track here with a prolonged discussion, but just to calarify.
You previously said (Post#6):-
"Use an exteranal voltage supervisor, TC54 etc.
And better, use also an external watchdog supervisor IC"

You have clarified the difference for the other readers.
I have done enough supervised circuits to know what and how they work.
I mentioned hysteresis to plant the seed if rolling-your-own.
So, why would a watchdog version be "better" in a simple scenario like this?
I can't see any benefit.
But I really don't want to get the OP on to another subject here.
 

srnet

Senior Member
So, why would a watchdog version be "better" in a simple scenario like this?
I did say it would be better to "also" use a external watchdog supervisor IC.

We can argue about whether it is necessary, but would a external watchdog supervisor IC make the system more unrelaible ?
 

rq3

Senior Member
There are no places on Earth where the sun shines 24 hours a day, its always going to get dark and hence no power.
Just to be a completely pedantic ass, there are polar explorers who might disagree with that statement.

Rip
 
Top