BOR resets on pic18f25k20

(instructions, reset, WDT, specifications...) PIC17Cxx, PIC18Fxxx

BOR resets on pic18f25k20

Postby Manx » Thu May 29, 2014 12:39 am

This board looks quiet. Hello?

I'm a pic beginner. I've used z80 before.

I had trouble with pic18f25k20 and found out it works if I turn BOR off. How important is BOR? On the z80 I never used that. Do most people use it?

I'll be back tomorrow. Thanks for any tips.
Manx
 
Posts: 5
Joined: Thu May 29, 2014 12:25 am

Re: BOR resets on pic18f25k20

Postby jtemples » Thu May 29, 2014 7:22 am

If it doesn't work with BOR enabled, then it most likely means you're browning out. If that's the case, it means your power supply is below the brownout voltage set in the configuration fuses (which is 1.8V by default). Look at the voltage/frequency graph in the electrical characteristics to determine whether you're running at a legal voltage.
jtemples
Verified identity
 
Posts: 195
Joined: Sun May 25, 2014 2:23 am
Location: The 805
PIC experience: Professional 5+ years with MCHP products

Re: BOR resets on pic18f25k20

Postby BobAGI » Thu May 29, 2014 10:35 am

Manx wrote:This board looks quiet. Hello?

This board was started a few days ago in response to the complete disaster Microchip has created when changing their own forum engine making their forum completely unreliable. It was done in March and it is still not working properly....
So this is an attempt at creating an alternate peer-2-peer forum.
How did you find this forum?
--
Bo B
Sweden & Texas
User avatar
BobAGI
Verified identity
 
Posts: 49
Joined: Sun May 25, 2014 2:28 pm
Location: Sweden and Texas
PIC experience: Professional 5+ years with MCHP products

Re: BOR resets on pic18f25k20

Postby Manx » Thu May 29, 2014 12:25 pm

jtemples wrote:If it doesn't work with BOR enabled, then it most likely means you're browning out. If that's the case, it means your power supply is below the brownout voltage set in the configuration fuses (which is 1.8V by default). Look at the voltage/frequency graph in the electrical characteristics to determine whether you're running at a legal voltage.


I found that out by accident. I copy and pasted some code I found and it blinked an LED. Then I tried six LEDs and it would reset. I read the data sheet and found this BOR feature. I turned it off. I must be drawing too much current.

This is just a bread board prototype and I am using two batteries for V+. I will have a better power supply in the real design.

It has been many years since I have done this. With the z80 I used commercial power supplies and seldom had a problem like this. These pics have so many features that it is confusing to set it up. Z80 was simple because it has no features :lol: .

Should I turn BOR back on when I get the right power supply? If I have a good power supply, what good is the BOR?

I am reading about PWRT. Is that required? The reset of this chip seems pretty complex.
Manx
 
Posts: 5
Joined: Thu May 29, 2014 12:25 am

Re: BOR resets on pic18f25k20

Postby Manx » Thu May 29, 2014 12:27 pm

BobAGI wrote:
Manx wrote:This board looks quiet. Hello?

This board was started a few days ago in response to the complete disaster Microchip has created when changing their own forum engine making their forum completely unreliable. It was done in March and it is still not working properly....
So this is an attempt at creating an alternate peer-2-peer forum.
How did you find this forum?


I went to the Microchip forum and was reading the "Welcome" forum. I read the FORUM UPGRADE thread and decided to try this one first. I got "access denied" message at Microchip and maybe I need membership.
Manx
 
Posts: 5
Joined: Thu May 29, 2014 12:25 am

Re: BOR resets on pic18f25k20

Postby Tom Maier » Thu May 29, 2014 1:07 pm

Manx wrote:Should I turn BOR back on when I get the right power supply? If I have a good power supply, what good is the BOR?


Hi Manx,

It depends on what type of application you have. I bet when you were using the z80 it was in a "good environment" and if the processor locked up, it wasn't an issue for the user to reset it. A lot of these pics are used in remote or hard-to-access locations where reseting them would be a real pain in the butt. All the reset features you see are to kick the pics butt to get him back to working in a sporatic power event happens. Think about it, would you like to climb a 30 foot pole to hit the reset button on an embedded device just because there was one little power brown out on the line?

The PWRT feature is to tolerant power supplies that have very long rise time.

And the WDT is another fail-safe device to catch lock-up if all else fails. So BOR, PWRT, and WDT are really handy features for making high reliability devices.

In the olden days we had to design and build those circuits ourselves. I'm glad to see they are finally being integrated as a standard feature on these new processors.

Power brownout while running code can make a processor "hop code" and trash the internal ram, causing the processor to run amuck and do bizarre things. If the processor is being used to control motors and dangerous actuators, then that creates a real saftey hazard. All those reset features helps to recover from that disaster without operator intervention.
User avatar
Tom Maier
Verified identity
 
Posts: 179
Joined: Mon May 26, 2014 2:37 pm
PIC experience: Professional 5+ years with MCHP products

Re: BOR resets on pic18f25k20

Postby ric » Thu May 29, 2014 1:34 pm

Tom Maier wrote:...
Power brownout while running code can make a processor "hop code" and trash the internal ram, causing the processor to run amuck and do bizarre things. If the processor is being used to control motors and dangerous actuators, then that creates a real saftey hazard. All those reset features helps to recover from that disaster without operator intervention.

It has also been used deliberately by people attempting to hack in to systems.
I first heard about it in the late 1970's, when curious programmers discovered they could break in to their programmable HP calculators by inducing sudden jumps in the battery voltage.
This was done with a variable resistor and bypass switch wired in series with the battery, and enabled them to discover all sorts of hidden secrets in the calculators. ;)
See: http://www.hpmuseum.org/cgi-sys/cgiwrap ... ead=196444
Latest test project, an LED matrix display made from one reel of addressable LEDs. here
User avatar
ric
Verified identity
 
Posts: 659
Joined: Sat May 24, 2014 2:35 pm
Location: Melbourne, Australia
PIC experience: Professional 5+ years with MCHP products

Re: BOR resets on pic18f25k20

Postby Manx » Thu May 29, 2014 1:51 pm

Thanks for the explaination. I was beginning to think that these "features" were because the chips were not reliable. The data sheet tells me they are there, but not why I should use them.

Yes, the designs I did previously were not in bad environments. It was just on a desktop and had a reset button if it got stuck. I never thought about why it would get stuck. Maybe sometimes it was from power problems. I marked it down as coding errors.

Now that I think about it, my car computer doesn't have a reset button. :lol:
Manx
 
Posts: 5
Joined: Thu May 29, 2014 12:25 am

Re: BOR resets on pic18f25k20

Postby ric » Thu May 29, 2014 2:08 pm

Manx wrote:...
Now that I think about it, my car computer doesn't have a reset button. :lol:

On car forums these days, if EFI cars are behaving strangely, they tell you to:
"Disconnect the earth wire from the battery, then press the brake pedal for 30 seconds before reconnecting the earth. This will fully reset the Engine Management Computer." :D
Latest test project, an LED matrix display made from one reel of addressable LEDs. here
User avatar
ric
Verified identity
 
Posts: 659
Joined: Sat May 24, 2014 2:35 pm
Location: Melbourne, Australia
PIC experience: Professional 5+ years with MCHP products

Re: BOR resets on pic18f25k20

Postby Tom Maier » Thu May 29, 2014 2:38 pm

Pressing the brake must activate something that drains the power buffer caps, to bring Vdd back down for proper reboot.

Well, at least they don't have you disassemble the control computer's cover and press a reset button.

That is really bad. Who thought that one up? If the EFI is a slave processor off the main car computer, then the knock sensor should give indication that the EFI processor is run amuck and the main cpu could reboot it.

I'm not real familiar with auto electronics, but I've had to design multiprocessor automated systems a lot. Every failure mode needs to be considered, simulated and have a plan to overcome it. These things often slip through the craks on designs because the prototype behaves itself properly and the failure mode exposes itself in the field. What an embarrassment.

For example, if you do get a failure-mode reset (WDT, BOR), you need to consider what will you do? sometimes just rebooting and continuing as if it was a power up is the proper thing, but sometimes you need to know that has happened and take other measures and don't want to go through normal boot code.

Funny story...
I worked for a company that made car diagnostic equipment years ago, and I worked on a cruise control tester. We tested the prototype by plugging it under the dash and taking the car for a drive. One guy steered and I controled the gas pedal input with a hand-held joystick from the passenger seat. I tell you it is challenging when two people are driving the same car. :o
User avatar
Tom Maier
Verified identity
 
Posts: 179
Joined: Mon May 26, 2014 2:37 pm
PIC experience: Professional 5+ years with MCHP products

Next

Return to 16-Bit Core

Who is online

Users browsing this forum: No registered users and 19 guests

cron