Bypass Caps on powersupply / BOD

BUSHBANDIT

New Member
We are using the 40X1 @ 16MHZ in a project that has been working successfully.
we have exchanged the chip for the 40X2 with the software syntax changes.
we have changed the resonator for an 8MHZ and now running this chip at 32 Mhz.
I am finding that the BOD when enabled is resetting the controller.
if i issue the Disable the BOD this resolves the situation.
I have 0.1 uf caps on both power rails (vcc and vdd pins) of the X2 and very close to the DIL pins.
i have a 500ma 5V reg feeding the supply to the chip. And here should be very little current draw.
i have a LCD in the circuit which intensity is set amd the power to draw 120ma max
The circuit is powered by either an AC/DC power supply or internal battery. this has high speed switching opto with a dc to dc converter and dual power coupled through summing shocky diodes.
Examination with a dso we get a 100us pulse up to 6V and down to 4V on supply rail on change over.
The micro uses one of the digital i/o lines to enable the DC to DC. This i/o pin is reset to zero on BOD. As expected the unit switchs off.

What powersupply Bypass/filtering caps should i be using? IF differeent?
What is the best way to reslove this? - want to leave browout enabled
What is the brown out triggure level set too when issueing this command.
In the PIC 18F4520 manual there are two bits that can be set with differing thresholds?

Thanks
Greg
 

Andrew Cowan

Senior Member
Hsve a look at your power suppply with scope (if you have acess to one). Try adding 0.1uF caps next to the PICAXE, and some 10uF and 100uF caps across the supply.

A
 

Dippy

Moderator
If I read this correctly, you already have 0.1uF (100nF) right next to PICAXE ?

Your description is nice, but as you can see already a little ambiguity has crept in... see Andrew's response.
A circuit schematic (circuit diagram) would really help.


Have you used capacitors around your 500mA 5V regulator?
Are they of the value and type recommended by the regulator manufacturer?
Or are they dusty old caps found down the back of the sofa? ;)

Throwing capacitors at a circuit isn't the best solution. 'Good' values and types in the 'right' place will save time and money.
Have you tried scoping the V+ right on the chip pin?

I would be tempted to try 100uF right by the PIC power pins in parallel with your 100nF ceramics.


I can't tell you the BOD threashold - you could probably work this out with a bench power supply.
The VBOD threshold is usually set in the initial hardware programme and cannot be adjusted under software.
You will obv have seen BORV0 and BORV1.



I must ask: is your wiring on a hairy old breadboard or decent PCB?
I ask this as I have seen so many problems introduced by messy wiring, dodgy connections and poor (weedy) ground lines.
Try and keep capacitors close to devices, as opposed to halfway along tracks.
Ground lines should be robust.
Data Sheets should be read and used for reference.

This is highly unlikely to be a PICAXE problem and will almost certainly be down to an oversight, bad power control, bad connection or unsuitable component choice/placement.
With patience you'll get it fixed, ne panic pas :)
 

BUSHBANDIT

New Member
Hi Dippy
Thanks for you input.
As stated, we have used a Digital Sampling scope (dso) to look at the V+ and the digital control lines and controls and signalling timing.
I its on a professionally double side constructed PCB (Protel and sent for pcb manufacture to futurelec). This cirrcuit is mostly SMD.
Rememberr that we have made this unit before with the 40X1 DIP and run it successfully with the 16 mhz resonator.
My problem seems to have arisen with the moving to the X2 chip. The hope was to expand on the coding to improve the functionality and the user messaging. (and prvide a diagnostic mode).

Cheers Greg
 

syntony

Member
you use a SMPS (switch mode power supply) ???

do you test with a "classical " power supply ? Transfo, bridge, capa,regulators....
 

BUSHBANDIT

New Member
Syntony

The 5v supply is a proper industrial module

The system works perfectly in the 40x1 chip with software
the system works with the 40X2 with the DisableBOD command
the system fails on the 40X2 with enabled BOD command?

Checking with an scope we get a supply rail spike that drops to 4.5V and up to 5.5V for <100us (typically 30us) at switching between battery and SMPS.
We have got 0.1uf bypass caps additional 47uf caps near the DIP package.

Has anyone else had problems with the chip resetting?
What is the BOD level when you enable it in the softwarre?
 

hippy

Ex-Staff (retired)
Examination with a dso we get a 100us pulse up to 6V and down to 4V on supply rail on change over ... What is the brown out triggure level set too when issueing this command.
The PICmicro manual indicates BOD at 2.22V, 2.79V, 4.33V or 4.59V nominally so I'd have guessed it is one of the two later values or there'd be no problem, but ... I connected a 28X2 to a Lab PSU and it worked down to (EnableBod) 2.1V and (DisableBod) 1.7V, possibly lower but couldn't tell if the LED was flashing.

I'm not very familiar with BOD operation but maybe there's a shorter pulse to a lower voltage or perhaps the surge then drop is affecting how BOD works.

Perhaps adding a reasonably sized reservoir cap ( rather than a decoupling cap ) on the supply rail or near the PICAXE will take out or limit the spike / dip ?
 

hippy

Ex-Staff (retired)
Identical results on 40X2, worked down to (EnabledBod) 2.1V and (DisableBod) 1.7V
 

syntony

Member
Syntony

The 5v supply is a proper industrial module
yes, I understand....but....

it's just to give another approach
for me, I think, it's better to try to isolate the problem...
problem of PIC ? or problem in SMPS ?
you need to replacement parts

I'm not familiar with 40X but you say than problem appears when power supply switch,

drop arrive when you switch from A/C to battery or battery to A/C ?

sometime, pic appears when there is a little overload on the power supply
can be solve with capacitors

your system is powered either A/C or either battery, with switch...
or battery give power and is charged with the SMPS


sometime, people meet problem with interference of SMPS
even with industrial SMPS !

I'm not sure than I'm on the right way
but differents point of view can solve your problem
 

Dippy

Moderator
Have you actually 100% proved that this is a BOR event?
Some weird things can upset PICs - and I mean PIC in general.

Just to make sure one way or t'other check the bits set in the RCON register after reset.
Have a look in the PIC Data Sheet. By checking the values imediately after reset it may help you nail the reset status.
If it is 100% BOR then you can zoom in on the power supply or changeover effects.


Switching between suitable power sources with enough reservoir capacity should not cause a problem - but then you knew that already :)

I can't quite understand what hippy is saying in post #8... the "two lat(t)er values" he gave are 4.33V and 4.59V, yet he said it dipped out when V+ below 2.1V. Does that mean it did a reset below 2.1V? I don't get that, doesn't tie up... also when V is increasing when did it restart?


Now we know it's a SMPS, have you tried turning your 'scope up really fast, you can get some real nasty HF spikes and oscillations.
I don't care whether it's called industrial or not, you can still get some nasties. No such thing as magic.
I don't know the semiconductor 'guts' of 16F versus 18F, maybe the latter is more sensitive.

I use variants on that 18F a lot (4520,4620,2520,2620) and don't have any nasty experiences. My designs have SMPS and mains in proximity, no probs at all.

In my PCB designs I have a couple of starting points.
1. I always have a 100nF ceramic at PIC power pins and optionally a tant or low-Z 22uF to 100uF.
2. I 99% use the recommended Microchip-recommended MCLR RC circuit.


As no-one has the same setup to you, this may mean several more hours with 'scopes and fiddling.
Can be very tedious so Good Luck.
 

hippy

Ex-Staff (retired)
I can't quite understand what hippy is saying in post #8... the "two lat(t)er values" he gave are 4.33V and 4.59V, yet he said it dipped out when V+ below 2.1V. Does that mean it did a reset below 2.1V? I don't get that, doesn't tie up... also when V is increasing when did it restart?
I didn't know what BORV was actually set to and the PICmicro datasheet quotes four possible value. For a fall to 4V causing BOR I would logically assume BORV had been set to one of the voltages above 4V.

Experiments show BORV is (appears) actually set to the lowest value 2.1V, so I cannot explain why BOR would occur if the voltage only dipped to 4V. You could be right; it could be something else.

The PICAXE appears to stop when the voltage goes below 2.1V and restarts again as soon as the voltage rises above 2.1V. That's on the basis of just twiddling PSU knob and watching a LED flash under program control ( or not flashing when BOR has occured ).
 

212

Senior Member
Different chip (20M) different everything, but I'm seeing reset issues when using sleep and nap. If those are in your code, you might try it with pause, just to see if it makes a difference???

edit:

Thanks to the forum, to the search, and to the good members here, I found my problem! I fixed it too :) I hope you fix yours as well.

My issue was tied to the servo control, but it was hidden. Here was what helped me...thanks!

http://www.picaxeforum.co.uk/showthread.php?t=13074&highlight=servo
 
Last edited:

hippy

Ex-Staff (retired)
Just to make sure one way or t'other check the bits set in the RCON register after reset.
Unfortunately it appears the RCON bits are swallowed by the firmware initialisation, so no information available that way.
 

Dippy

Moderator
Oh dear. Funny thing to do. I won't ask why ;)
Oh well, bang on with he 'try it and see' aproach with noise/spike testing.
Good luck.
 
Top