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 CCS Technical Support

Header files gone bad

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



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

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

Header files gone bad
PostPosted: Wed Aug 11, 2004 2:54 pm     Reply with quote

My turn to gripe Smile

3.191
Code:

#define ADC_OFF                0          // ADC Off
#define ADC_CLOCK_DIV_2        1
#define ADC_CLOCK_DIV_8     0x41
#define ADC_CLOCK_DIV_32    0x81
#define ADC_CLOCK_INTERNAL  0xc1              // Internal 2-6us


Now 3.206
Code:

#define ADC_OFF                0          // ADC Off
#define ADC_CLOCK_DIV_2    0x100
#define ADC_CLOCK_DIV_8     0x40
#define ADC_CLOCK_DIV_32    0x80
#define ADC_CLOCK_INTERNAL  0xc0          // Internal 2-6us


Now why did they change the constants? It keeps the ADC off!
Mark



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

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

Switches and Bank Selects
PostPosted: Wed Aug 11, 2004 2:57 pm     Reply with quote

Optimization 7
Code:

....................     case 0b010000000: 
....................       StationType = SYRS8; 
0BA9:  MOVLW  08
0BAA:  BSF    03.5
0BAB:  MOVWF  5E
....................       StationFlags.IR_Enable = TRUE; 
0BAC:  BCF    03.5
0BAD:  BSF    43.6
....................       break; 
0BAE:  BSF    03.5
0BAF:  GOTO   3B9
....................     case 0x000000000: 
....................       StationType = SYRS9; 
0BB0:  MOVLW  09
0BB1:  BSF    03.5
0BB2:  MOVWF  5E
....................       break; 
0BB3:  GOTO   3B9
0BB4:  BCF    03.5
....................     default: 
....................       StationType = SYRSUNDEFINED; 
0BB5:  BSF    03.5
0BB6:  CLRF   5E
....................       break; 
0BB7:  GOTO   3B9
0BB8:  BCF    03.5
....................   } 
....................   
....................   // If we have an invalid station type then Set_LED_Mode will set the error   
....................   Set_LED_Mode(MODE_NORMAL); 
0BB9:  CLRF   28
0BBA:  BTFSC  0B.7
0BBB:  BSF    28.7
0BBC:  BCF    0B.7
0BBD:  BSF    03.5
0BBE:  BSF    03.6
0BBF:  CLRF   5C
0BC0:  BCF    0A.3
0BC1:  BCF    03.5
0BC2:  BCF    03.6
0BC3:  CALL   192
0BC4:  BSF    0A.3
0BC5:  BTFSC  28.7
0BC6:  BSF    0B.7


all the goto's should be going to the
Code:

0BB8:  BCF    03.5


Opt @ 9
Code:

....................     case 0b101000000: 
....................       StationType = SYRS7; 
0B26:  MOVLW  07
0B27:  BSF    03.5
0B28:  MOVWF  5E
....................       break; 
0B29:  GOTO   339
....................     case 0b010000000: 
....................       StationType = SYRS8; 
0B2A:  MOVLW  08
0B2B:  BSF    03.5
0B2C:  MOVWF  5E
....................       StationFlags.IR_Enable = TRUE; 
0B2D:  BCF    03.5
0B2E:  BSF    43.6
....................       break; 
0B2F:  BSF    03.5
0B30:  GOTO   339
....................     case 0x000000000: 
....................       StationType = SYRS9; 
0B31:  MOVLW  09
0B32:  BSF    03.5
0B33:  MOVWF  5E
....................       break; 
0B34:  GOTO   339
0B35:  BSF    03.6
....................     default: 
....................       StationType = SYRSUNDEFINED; 
0B36:  BCF    03.6
0B37:  CLRF   5E
....................       break; 
0B38:  GOTO   339
....................   } 
....................   
....................   // If we have an invalid station type then Set_LED_Mode will set the error   
....................   Set_LED_Mode(MODE_NORMAL); 
0B39:  BCF    03.5
0B3A:  CLRF   28
0B3B:  BTFSC  0B.7
0B3C:  BSF    28.7
0B3D:  BCF    0B.7
0B3E:  BSF    03.5
0B3F:  BSF    03.6
0B40:  CLRF   5C
0B41:  BCF    0A.3
0B42:  BCF    03.5
0B43:  BCF    03.6
0B44:  CALL   17D
0B45:  BSF    0A.3
0B46:  BTFSC  28.7
0B47:  BSF    0B.7


Now the bank selection is correct!
valemike
Guest







PostPosted: Wed Aug 11, 2004 3:45 pm     Reply with quote

I never pay attention to optimization levels, though I think I should start!

I use the PCHW at work on this contract i'm on, so i can change optimization levels. But what 2 months from now, I am stuck using my PCH license.

What optimization level does PCH use?

I learn more and more each day not to even tinker with anything that says 3.2X

Sticking with 3.191 and below will help you to perform your core competency - and that's to develop a product for your company. Tinkering with the later versions will turn you into a paying fulltime Beta tester. Shocked Rolling Eyes

I wouldn't dare hook up 3.2XX to a circuit that drives high voltage motors Shocked
Mark



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

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

PostPosted: Wed Aug 11, 2004 5:52 pm     Reply with quote

Hardware guy choose MLF package so I am back to the 16F876A instead of the 18F252. I have been using the C18 for the 18's since the early days of the PCH compiler. Before that, all of my 16's are usings something like 2.709. It worked fine for me so I stuck with it even though I continue to pay the maintenance. I wish they would come out with module level compilation.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Aug 11, 2004 11:36 pm     Reply with quote

Quote:
I wish they would come out with module level compilation.
I don't see a linker as a big deal. Other than working more cleanly
with MPLAB 6.xx, I don't see that the lack of a linker causes any
problems with me completing a project efficiently. We are still feeling
the effects of the vs. 3.2xx changes. I would prefer to let those
changes settle out before any new ones are made.
Mark



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

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

PostPosted: Thu Aug 12, 2004 6:21 am     Reply with quote

If you stick to CCS and only CCS then I would agree that the "single source" approach isn't all that bad. But reusing code, using code across microcontrollers, libraries, RTOS's would be better if they had a "real" linker.
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