View previous topic :: View next topic |
Author |
Message |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun May 21, 2017 6:37 pm |
|
|
IamUche wrote: | @temtronic,
I want to know if there is a function that can make it reset whenever it
experiences partial contact instead of freezing or pausing.
|
It's called Brownout reset. There is a fuse setting for it. Look in the
#fuses section near the top of the .h file for your PIC.
However, I just ran a test compilation of your code posted in your 1st
post, and it already sets the BROWNOUT fuse. So I guess it's not enough. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19541
|
|
Posted: Sun May 21, 2017 11:29 pm |
|
|
This may well change with different compiler versions. I don't remember seeing what version he is using?. It's possible that he has a version that doesn't have this on by default.
The current compilers (recent V5), leave the fuses in their 'erased' state, unless you set the fuses, but earlier compilers did in some cases set values to 'default' settings. |
|
|
IamUche
Joined: 10 Aug 2016 Posts: 17
|
|
Posted: Mon May 22, 2017 11:48 am |
|
|
On the software version i saw
PCWHD Compiler
IDE Version 5.010
PCB Version 5.010
PCM Version 5.010
PCH Version 5.010
PCD Version 5.010 |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19541
|
|
Posted: Mon May 22, 2017 1:15 pm |
|
|
The place to look for the compiler version is in the listing file. Just the compiler version matters.
However if it is 5.010, then this has some known issues. Particularly the global interrupt will get disabled in printf routines. This could freeze the code depending on what is being done. |
|
|
IamUche
Joined: 10 Aug 2016 Posts: 17
|
|
Posted: Tue May 23, 2017 3:47 am |
|
|
Please what should I do now coz I'm kinda stuck with this issue?
Thanks in anticipation. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9244 Location: Greensville,Ontario
|
|
Posted: Tue May 23, 2017 4:44 am |
|
|
OK.. step one is to get the '1 Hz LED program ' running correctly. Please show us your program and what happens.
Since you're using an 877, do you have both caps on the xtal pins?
If it's really slow.....If using MPLAB, have you compiled in 'debug' mode? If yes, change the build option to 'release', recompile (F10), download PIC and test.
Small steps will ensure success.
Jay |
|
|
IamUche
Joined: 10 Aug 2016 Posts: 17
|
|
Posted: Tue May 23, 2017 11:02 am |
|
|
@temtronic, i have done a successful run of LED oscillating circuit which I posted the code in the previous page. My code runs just fine but I notice that spikes, partial contact or noises at the power terminals (VSS and VDD) is affects the Microcontroller (PIC16f877a) thereby causing it to go into a kind of freeze or latch.
Anyways I came across this post https://www.ccsinfo.com/forum/viewtopic.php?p=165581
Can a watch dog timer, brownout reset solve my case? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19541
|
|
Posted: Tue May 23, 2017 12:12 pm |
|
|
Seriously what suppression have you got on the chip?.
The microprocessor needs really good HF response (typically ceramic) capacitors immediately adjacent to it's power pins.
The brownout reset will reset the chip if you get significant droops, not little spikes. Your design needs to be generating a clean environment for the chip to start with. Only after this consider code solutions.
All pins should either be connected to circuitry, or driven as outputs (no pins left floating as undriven inputs).
Circuitry round the chip needs it's own suppression.
I often say to look at something like a PC motherboard. The supply on the board, will typically have dozens of large and small capacitors, but then across the board, every other chip will also have suppression capacitors.
Visible spikes are a sign of a design problem. |
|
|
|