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

PCWH ROM used > 50K and program stops workng !

 
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

PCWH ROM used > 50K and program stops workng !
PostPosted: Sat Jun 26, 2004 6:20 pm     Reply with quote

My code stops working whenever ROM used goes above 49-50 K

Here is an example for PIC18F6720 when the code gets this large, all bets are off...

CCS PCH C Compiler, Version 3.202, 21503

Filename: H:\Picc\Projects\Version2\V2.LST

ROM used: 52124 bytes (40%)
Largest free fragment is 65536
RAM used: 2174 (57%) at main() level
2615 (68%) worst case
Stack: 11 worst case (10 in main + 1 for interrupts)

This code is made up of known tested code from smaller test programs.

Has anyone else had this problem with PCWH ?

Sad
cfernandez



Joined: 18 Oct 2003
Posts: 145

View user's profile Send private message

PostPosted: Sat Jun 26, 2004 7:32 pm     Reply with quote

I have the same problem in PIC18F8720, and I put the 3.200, try with this version.
Hans Wedemeyer



Joined: 15 Sep 2003
Posts: 226

View user's profile Send private message

PostPosted: Sun Jun 27, 2004 1:22 am     Reply with quote

cfernandez wrote:
I have the same problem in PIC18F8720, and I put the 3.200, try with this version.


I'm already using version 3.202 !
Did you contact CCS about the problem ?
cfernandez



Joined: 18 Oct 2003
Posts: 145

View user's profile Send private message

PostPosted: Sun Jun 27, 2004 1:27 am     Reply with quote

Not, and you?. You contact the technical support?.

Put the older version 3.200 and try your program with this, and tell me if work. My application use the 82% from 18F8720 and work fine.

Tell me if you found the problem or solution.
Guest








PostPosted: Sun Jun 27, 2004 4:01 am     Reply with quote

Hans,
I use V3.191 because it is the most stable version right now Smile
Additionally you can play with #opt 10 in this version.
Some comments about 18F6720 (I use it in the last 4 months):
1. There must be something wrong with GOTO/BRA addresses in some case of boudaries. IME if my growing-up code stops working then the opposite state of the #opt 10 line (active or commented out) does the work. Yesterday I had to comment out the opt line after inserting a simple putchar() (!).
2. There is a problem about RAM addressing. I am not sure whether it is a silicon error or a compiler feature. Keep your "simple" variables (global and local char, int, etc.) below 0x0100 RAM address. Check the symbol file for it. Move your arrays, structs, etc. to 0x0300+ address range using #locate directive.
cfernandez



Joined: 18 Oct 2003
Posts: 145

View user's profile Send private message

PostPosted: Sun Jun 27, 2004 4:09 am     Reply with quote

Invitado,

I see the alert from technical support that the 3.191 is more stable, but I test my code with the 3.200 and work very good, and I use the #opt 10 and my code reduce 2% compare with the 3.191, this good!!!.

With the 3.202 I see that the first goto is wrong, my code not execute nothing!!!.

I wait for a new version.

Best Regards,
TSchultz



Joined: 08 Sep 2003
Posts: 66
Location: Toronto, Canada

View user's profile Send private message

PostPosted: Sun Jun 27, 2004 7:50 am     Reply with quote

Crying or Very sad
Be a bit carefull with the whole PIC18Fxx20 line of chips. There have been many erattas on these. I was bitten by one of these, which in my opinion the chips should have been recalled. Rev C silicon may corrupt return values with "certain code combinations". Microchip cannot predict when this will happen. It is mostly a problem if operating faster than 8MHz.

I had no end of strange issues where code that seemed to work had odd bugs after making simple changes. After moving to A4 silicon these strange issues seemed to go away, this chip was much more stable.

This problem is not unique to the CCS compiler guys I know running the HiTech compiler encountered the same issues.

Not sure if this is what is happening but you may want to suspect the silicon. Microchip is still shipping the Rev C silcon. We had explicitly request the A4 silicon in order be guaranteed to get it.
Guest








PostPosted: Sun Jun 27, 2004 4:12 pm     Reply with quote

TSchultz wrote:
Crying or Very sad
After moving to A4 silicon these strange issues seemed to go away, this chip was much more stable.


I checked the Errata sheet before buying: Digikey supplied all date codes for the 429 items they had in stock, and Microchip decoded the date codes for me.
All of Digikey's PIC18F6720's are rev. A4

I do suspect the compiler. If I keep code at about or under 39% (~49000) all code modules work.
My code does not use malloc, so total RAM used should never go above the worst case quoted in the LST file.

I tried #opt5 and the code increased in ROM used to 60+ % however it did not run at all.

I'll step through the lst file and look for bad code, someone mentioned BRA as a possibility.

I'll also try placing RAM variables as suggested.
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