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

I need help with this unknown build problem

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







I need help with this unknown build problem
PostPosted: Sun Apr 01, 2007 10:34 am     Reply with quote

hi,
I have a build. It works fine when it in ICD debug mode. I can start/stop and run, but when i burn the code in the hardware using the ICD option in the CCS IDE, the hardware won't start up. Power down, then up again, the HW still show the same problem. In such case, if i use the volt metter to measure the 47K resistor to the MCLR, or using the stick to "poke" or touch that resister few times, then the HW starts come up and works fine.

If i insert few more lines of code in the build ( just some dummy array or harmless printf statements) and re-compile the build, then the problem goes away. I can burn it in the hardware and it can start up when powerup.

This problem comes and goes...I just wonder if anyone in the forrum experiences similar problem like mine.

Here is the compiler and the build usage:
CCS PCH C Compiler, Version 3.228, 28569 01-Apr-07 08:47

Filename: C:\Program Files\PICC\projects\newdesign\development\base\main.LST

ROM used: 50390 bytes (39%)
Largest free fragment is 64704
RAM used: 2183 (57%) at main() level
2392 (62%) worst case
Stack: 13 worst case (11 in main + 2 for interrupts)

Thank,
Jimmy
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Apr 01, 2007 2:38 pm     Reply with quote

Read this thread about trying different optimization levels (with #opt):
http://www.ccsinfo.com/forum/viewtopic.php?t=23991

This is a two-page thread. Read it and my post at the end
about "don't do anything weird":
http://www.ccsinfo.com/forum/viewtopic.php?t=24548

Read the links in this thread, which are about "random resets".
Some of the solutions may help with your problem.
http://www.ccsinfo.com/forum/viewtopic.php?t=27638&start=4

Another thread about trouble-shooting strange problems:
http://www.ccsinfo.com/forum/viewtopic.php?t=19721
JimmyNg
Guest







PostPosted: Mon Apr 02, 2007 4:31 pm     Reply with quote

PCM programmer,
Thank you so much for the links. I read them and tried some of the sugesstions, but the problem won't go away. I have not tried the #opt level yet, I will try it soon. By the way, I use the 18F8720 PIC

The problem is so unexpected, just adding in some more dummy codes or printf statements, might make the problem disappeared.

Even with the problem, runing in debug mode seems OK. In the Non debugger mode, It seems that the build can be loaded on the target, but during the power resets, it can't start unless I hold the MCLR pin to gound for a second( I do have a 47 Kohm pullup at the MCLR pin)...

I really want to undersand the root cause of this problem, but in case if i can't find out. I wonder if I add some dummy code to make the problem goes away, then how reliable the build is and can i trust the build to use it for release????

Jim
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Apr 02, 2007 5:23 pm     Reply with quote

Are you sure that you're programming the PIC for "standalone" mode ?

Here is a thread that describes how to do that.
http://www.ccsinfo.com/forum/viewtopic.php?t=28356&highlight=standalone+icd

Also, look for anything that's strange in your hardware connections.
For example, sometimes a board will only work if the ICD-U40 is
connected to it. That's because the ICD-U40 was providing the
ground connection (it was left off the design by accident).
http://www.ccsinfo.com/forum/viewtopic.php?t=28072&highlight=icd+ground
JimmyNg
Guest







PostPosted: Tue Apr 03, 2007 4:10 pm     Reply with quote

hi,
I tried with the #opt 7....The code size jumps up from 39% to 47%. The problem goes away. I wonder if later on, I add more code into the build, then the problem will be appreare again.

With higher level 8->11. It won't work.

I like to know more about the #opt. Choosing the higher OPT, will make the compiler procudes smaller the code side at the expense of execution time?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Apr 04, 2007 12:02 am     Reply with quote

Compile it with #opt 7 and #opt 8. Compare the differences between
the .LST files. Look for something that could cause the problem.
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