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 support@ccsinfo.com

MCLR_FROM_RUN why?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Hans Wedemeyer



Joined: 15 Sep 2003
Posts: 226

View user's profile Send private message

MCLR_FROM_RUN why?
PostPosted: Mon Nov 07, 2005 6:01 pm     Reply with quote

One out of many units is rebooting sometimes.
n = restart_cause(); is returning 15 which means MCLR_FROM_RUN

Some thought on why one of many units does this, and the others never do it ?

The chip is a PIC18LF6720 (Silicon Rev A4) running at 3.3V. Supply is clean, MCLR is pulled up using a 22K. Units are tested at -40C up to +85C .

I'm starting to think this may be a bad chip, I'd appreciate some thoughts/opinions before I replace the chip..

Thanks
Hans Wedemeyer



Joined: 15 Sep 2003
Posts: 226

View user's profile Send private message

Re: MCLR_FROM_RUN. How to insert a NOP at 0000
PostPosted: Mon Nov 07, 2005 10:28 pm     Reply with quote

Hans Wedemeyer wrote:
One out of many units is rebooting sometimes.
n = restart_cause(); is returning 15 which means MCLR_FROM_RUN

Some thought on why one of many units does this, and the others never do it ?

The chip is a PIC18LF6720 (Silicon Rev A4) running at 3.3V. Supply is clean, MCLR is pulled up using a 22K. Units are tested at -40C up to +85C .

I'm starting to think this may be a bad chip, I'd appreciate some thoughts/opinions before I replace the chip..

Thanks


I checked the Errata sheet for rev. A4 and it appears the chip has a reset problem.

Changed the chip and the problem appears to be gone.

If this really is the issue, and it looks like it is, then Microchip has a work around:

Quote:
Work around
Insert a NOP instruction at address 0x0000.
end Quote.

First two lines of code from my LST

0000: GOTO E482
0008: MOVFF FE8,05

Looks like CCS did not cater for the workaround!

So how do I insert a nop at location 0000 ?
hansw
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Nov 07, 2005 10:54 pm     Reply with quote

Quote:
So how do I insert a nop at location 0000 ?

Code:
#include <18F6720.H>
#fuses XT,NOWDT,NOPROTECT,BROWNOUT,PUT,NOLVP
#use delay (clock=4000000)

// Tell compiler to put reset code at address 0x0002,
// instead of at 0x0000, as is normally done.
#build(reset=0x0002) 
#ROM 0 = {0xFFFF}     // Insert NOP at address 0


// Put interrupt service routines here.

//==============================
void main()
{

while(1);
}
Hans Wedemeyer



Joined: 15 Sep 2003
Posts: 226

View user's profile Send private message

PostPosted: Tue Nov 08, 2005 8:19 am     Reply with quote

PCM programmer wrote:
Quote:
So how do I insert a nop at location 0000 ?

Code:
#include <18F6720.H>
#fuses XT,NOWDT,NOPROTECT,BROWNOUT,PUT,NOLVP
#use delay (clock=4000000)

// Tell compiler to put reset code at address 0x0002,
// instead of at 0x0000, as is normally done.
#build(reset=0x0002) 
#ROM 0 = {0xFFFF}     // Insert NOP at address 0


// Put interrupt service routines here.

//==============================
void main()
{

while(1);
}


OK.... I think that did the trick.
Now the first line of the LST reads 0002: GOTO D5F8

Do I just assume an erased chip is full of NOP's ? or is there a way to "see" what's at location 0000 ?

Thanks for the help.
Best rgeards
Hans W
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Tue Nov 08, 2005 8:59 am     Reply with quote

Yes, the erased chip would have nop's. Also, from MPLAB, you can view the program memory to verify that something not expected is sitting at location 0.
Hans Wedemeyer



Joined: 15 Sep 2003
Posts: 226

View user's profile Send private message

PostPosted: Tue Nov 08, 2005 10:54 am     Reply with quote

Mark wrote:
Yes, the erased chip would have nop's. Also, from MPLAB, you can view the program memory to verify that something not expected is sitting at location 0.


Thanks....
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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