CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Help with 16x2 LCD
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun May 21, 2017 6:37 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sun May 21, 2017 11:29 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon May 22, 2017 11:48 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon May 22, 2017 1:15 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue May 23, 2017 3:47 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue May 23, 2017 4:44 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue May 23, 2017 11:02 am     Reply with quote

@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

View user's profile Send private message

PostPosted: Tue May 23, 2017 12:12 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group