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

Code changed by itself?

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



Joined: 22 Nov 2003
Posts: 32

View user's profile Send private message

Code changed by itself?
PostPosted: Mon Apr 19, 2004 2:34 pm     Reply with quote

I'm having a wierd problem with an 18F452. It seems to have changed it's code to run the wrong sub-routine at startup. How is it possible for the code to have changed like that without the chip in a programming state? The unit is in the field so I will have to wait a few days to get at it to check it out.

Any suggestions/tips would be very appreciated.

Bob
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Apr 19, 2004 4:07 pm     Reply with quote

What version of the compiler do you have ?

Is it possible that you're seeing the hardware bug described in
Bruce R. Knox's post in this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=360&highlight=18f452+bug+nop
bcs99



Joined: 22 Nov 2003
Posts: 32

View user's profile Send private message

PostPosted: Mon Apr 19, 2004 11:59 pm     Reply with quote

Thanks.

I'm using 3.182.
I'll look a little closer at the bug.

Bob
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Apr 20, 2004 12:29 am     Reply with quote

Quote:
I'm using 3.182

CCS fixed that bug way before vs. 3.182, so I don't
think that's the problem.

If the code that's running appears to be different from
the code that you just compiled, I would make sure that
your programmer is really pointed at the correct directory
when you load the .HEX file. Check the date and time
of the .HEX file before you load it into your programmer.
Put a printf statement at the start of your program that
displays the current version.

Also look here:
http://www.ccsinfo.com/versions.shtml
See if your problem could be caused by any of the things
they fixed in the versions that came right after 3.182.

Other things to check:
1. Watchdog timer running at a shorter time period
than expected, due to chip variation or temperature.
2. Forgetting to put NOLVP in the #fuses statement.
3. Using a programmer that ignores the #fuses statement
and uses its own settings, which you overlooked.
4. Running a chip at low voltage, when it's not specified for it.
5. Running a chip at an oscillator frequency that is not
recommended for the oscillator #fuse setting that you're using.
6. Leaving the MCLR pin floating, or doing something weird with
the MCLR circuit (ie., a circuit other than a simple pull-up to VDD).
bcs99



Joined: 22 Nov 2003
Posts: 32

View user's profile Send private message

Problem solved
PostPosted: Tue Apr 20, 2004 11:20 am     Reply with quote

This was a little bit of forsight and a little bit of personal memory loss on my part. Too many late nights, I guess.

There was a problem in that the external eeprom memory got damaged/erased and the initial setup was lost. This data is only supposed to be calculated once, the first time it is used, so I never thought about it being the source of the problem. The forsight was that the program was again looking to do the setup which it was supposed to do when the eeprom settings were not present. Many of the tips you suggested have already been done and the unit had been working in the field for some time now. So I knew the code was working correctly.

I guess my next question would be why did the eeprom get erased? I'm using a 2402 with the supplied device driver "2402.c" and have had no problems until now.

Bob
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