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

PIC18F6720 if ( value ) .... debugger or chip ?

 
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

PIC18F6720 if ( value ) .... debugger or chip ?
PostPosted: Fri Aug 06, 2004 8:58 pm     Reply with quote

When this kind of crap happens I don't know if it's the chip, or the debugger...

Source....

if ( ExitVal )
{


From .LST file
.................... if ( ExitVal )
937C: MOVLB 5
937E: MOVF xFF,F
9380: BZ 938A
.................... {

Looks like the debugger thinks ExitVal is not zero !

http://hans-w.com/if_problem.gif

PIC18F6720 Rev. A4 silicon...

If it's not the debugger, then chip is useless.

I've been battling stuff like this for the past few weeks. I know the debugger has problems displaying data at the mouse cursor.
The expect value is ZERO the debugger shows 0X00 yet it thinks the value is NOT zero...

My question: Will the CCS debugger follow the chip ? or is the debugger lying to me ?

Last night the CCP5 would not output... This morning it did. I just put it down to lack of sleep... !

Now I'm beginning to think it's time to call Microchip and talk about this.
Mark



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

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

PostPosted: Sat Aug 07, 2004 7:05 am     Reply with quote

Rev A3 of that chip was crap! I had all sorts of problems. I haven't noticed any problems with the newer chips. I do remember instructions being skipped. If I were to look back at some old code, I find places where I added NOP's just before the instructions that were skipped. From the errata, it states that certain code sequences cause problems. It was very frustrating indeed. One minute it would work, I could change the order of 2 instructions and cause it to fail. I was about to the point to ship my product to them to demonstrate the problem. Then out comes the errata. I don't really remember the date codes but if the chip begins with 03 I would get Microchip to swap it out.
Guest








PostPosted: Sat Aug 07, 2004 9:57 am     Reply with quote

Mark wrote:
Rev A3 of that chip was crap! I had all sorts of problems. I haven't noticed any problems with the newer chips. I do remember instructions being skipped. If I were to look back at some old code, I find places where I added NOP's just before the instructions that were skipped. From the errata, it states that certain code sequences cause problems. It was very frustrating indeed. One minute it would work, I could change the order of 2 instructions and cause it to fail. I was about to the point to ship my product to them to demonstrate the problem. Then out comes the errata. I don't really remember the date codes but if the chip begins with 03 I would get Microchip to swap it out.

Thanks for the feedback.
I checked the chip codes with Microchip before buying them. They are Rev. A4
I read about the instructions problem and adding nops, however the Errata sheet says it's only when doing table reads, and my code avoids that. BTW the table read problem is still there in Rev. A4 !
I'll call Microchip on Monday, see if anything new has happend and if another Errata sheet is pending..
Hans Wedemeyer



Joined: 15 Sep 2003
Posts: 226

View user's profile Send private message

PostPosted: Sat Aug 07, 2004 10:27 am     Reply with quote

Mark wrote:
Rev A3 of that chip was crap! I had all sorts of problems. I haven't noticed any problems with the newer chips. I do remember instructions being skipped. If I were to look back at some old code, I find places where I added NOP's just before the instructions that were skipped. From the errata, it states that certain code sequences cause problems. It was very frustrating indeed. One minute it would work, I could change the order of 2 instructions and cause it to fail. I was about to the point to ship my product to them to demonstrate the problem. Then out comes the errata. I don't really remember the date codes but if the chip begins with 03 I would get Microchip to swap it out.


I added a nop before the if statement, the value is in fact 1 but the debugger is showing it as 0X00 !
At least the chip is OK.....
On Monday morning I'll call CCS...
Mark



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

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

PostPosted: Sat Aug 07, 2004 12:21 pm     Reply with quote

I use the ICD2 and have experienced those sorts of problems also. I sometimes add the var to a watch window just to make sure. It always seems to be correct in the watch window.
drolleman
Guest







PostPosted: Sun Aug 08, 2004 10:53 am     Reply with quote

I have run into this problem and this is what i had to do

if(!value) sometimes does not work so i do this if(!(value)) even this seems the same this fixes the problem.
Mark



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

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

PostPosted: Sun Aug 08, 2004 7:19 pm     Reply with quote

Those 2 statements would have the same effect. The only fault would be a compiler issue. Here is the asm. Note they are the same:

Code:

....................   int value1; 
....................   int1 value2; 
....................   
....................   if (!value1) 
*
010F:  MOVF   40,F
0110:  BTFSS  03.2
0111:  GOTO   112
....................   { 
....................   } 
....................   if (!(value1)) 
0112:  MOVF   40,F
0113:  BTFSS  03.2
0114:  GOTO   115
....................   { 
....................   } 
....................   if (!value2) 
0115:  BTFSC  41.0
0116:  GOTO   117
....................   { 
....................   } 
....................   if (!(value2)) 
0117:  BTFSC  41.0
0118:  GOTO   119
....................   { 
....................   } 
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