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

Any Bug in PCH 3.188 ? Please heeeelp !

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







Any Bug in PCH 3.188 ? Please heeeelp !
PostPosted: Sat May 22, 2004 7:06 am     Reply with quote

Dear Friends:

Due to the unacceptable bug with 3.190, 3.191 and 3.200, I am considering back to 3.188. If any of you have any knowledge about the proven bugs with 3.188, could you please kindly share your valuable information with us.

Thanks a huge lot.

Sincerely,

Chang-Huei Wu Crying or Very sad
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat May 22, 2004 9:48 am     Reply with quote

We used PCH 3.188 on a major project with the 18F458 and it worked OK.
C-H Wu
Guest







confused
PostPosted: Sat May 22, 2004 1:06 pm     Reply with quote

Dear PCM programmer:

Thanks for your encouraging information.

The project I am working on is 18F458 + 3.188 + #opt 10 + roughly 32 kB, I found that it does have a bug relating to bank setting on function return, however, it does NOT show up in simplied small test code. Same situation for 3.190, 191, and 3.200. After all these test, I am really confused Confused , and I have nothing more to say but keep my fingers crossed.

Best wishes
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat May 22, 2004 1:39 pm     Reply with quote

Quote:
The project I am working on is 18F458 + 3.188 + #opt 10 + roughly 32
kB, I found that it does have a bug relating to bank setting on function
return, however, it does NOT show up in simplied small test code

Our project used about 51% of the ROM.
We did not use #opt 10 or #opt 11, because I didn't want to take a risk.
Since you are at 32KB, I guess you have to use it, or find some other
way to reduce the code size.
C-H Wu
Guest







PostPosted: Sat May 22, 2004 9:07 pm     Reply with quote

While trying to reduce the code size, I will call Microchip tomorrow to see if they have any engineering sample for 18F4525 or 18F4620.
C-H Wu
Guest







A small bug with high optimization level, PCH 3.188 ~ 3.200
PostPosted: Sun May 23, 2004 2:17 am     Reply with quote

Tested with my real code for 18F458, the bank select bug with high optimization level when using PCH 3.188 ~ 3.200 turns out the following results

Code:
//                3.173             3.188       3.191       3.200   
// ------------------------------------------------------------------
//                ROM used   Bug    ROM  Bug    ROM  Bug    ROM  Bug
// ------------------------------------------------------------------
// #opt  0     //                   81%  no                         
// #opt  7     //                   78%  no     78%  no     74%   no
// #opt  9     // 23438 (72%) no    71%  yes    71%  yes    61%   yes
// #opt  10    // N/A               62%  yse    61%  yes    N/A     


A simplified test code may explain what happened like below:
Code:
int16   x, y;
#locate x = 0x056
#locate y = 0x356
void main()
{
   while(1)
   {
      if ( kbhit() && (mode = getc()) )
      {
         if      ( mode == '0' ) fun_A();
         else if ( mode == '1' ) fun_B();
         else if ( mode == '2' ) fun_C();
      }
      y = 0;
   }

when returning from fun_B() with high optimization level, the code write to variable x instead of y. However, there is no bug with this small test program.

Work around: instead of using y = 0, wrap it up with a function, then the bank select will be fixed, since CCS always put a "MOVLB 0" before calling a function or returning from a funcion, and there will be a correct "MOVLB n" right after entering the function.

Is it my problem in using global variables or is it really a compiler bug ? Confused

Thanks for your comment.

Best regards

C-H Wu
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Sun May 23, 2004 9:37 am     Reply with quote

This line
Code:

if ( kbhit() && (mode = getc()) )

looks to me like it will cause problems.

Does this have the same problems?
Code:
      if ( kbhit())
      {
         mode = getc();
         if      ( mode == '0' ) fun_A();
         else if ( mode == '1' ) fun_B();
         else if ( mode == '2' ) fun_C();
      }
      y = 0;
C-H Wu
Guest







PostPosted: Sun May 23, 2004 6:48 pm     Reply with quote

Thanks for your suggestion,

What in my real big code is
Code:
if (host.eth.pcol == PCOL_IP  &&  ip_recv())


I tried to separate the code into two lines
Code:
if (host.eth.pcol == PCOL_IP) if (ip_recv())


and the result is still the same, bug.
C-H Wu
Guest







Another workaround
PostPosted: Tue May 25, 2004 10:34 pm     Reply with quote

Considering the BSR setting bug in my previous post
Code:
      if ( kbhit() && (mode = getc()) )
      {
         if      ( mode == '0' ) fun_A();
         else if ( mode == '1' ) fun_B();
         else if ( mode == '2' ) fun_C();
      }
      y = 0;

the bug disappeared by using switch-case statement.

Cheers ! Very Happy
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