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

Problem with the ICD flag

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



Joined: 02 Feb 2006
Posts: 1

View user's profile Send private message

Problem with the ICD flag
PostPosted: Tue Feb 07, 2006 9:45 am     Reply with quote

I wrote the test program:
Code:
#include "18f6622.h"
#device *=16

#fuses PROTECT=15
#fuses WRT=15
#fuses EBTR=15

main()
{
}


When compiled this gave the listing:
Code:
CCS PCH C Compiler, Version 3.235, 27782               07-Feb-06 15:24

               Filename: C:\ccstest\main.LST

               ROM used: 26 bytes (0%)
                         Largest free fragment is 65510
               RAM used: 5 (0%) at main() level
                         5 (0%) worst case
               Stack:    0 locations

*
0000:  GOTO   0004
....................  #include "18f6622.h"
....................  //////// Standard Header file for the PIC18F6622 device //////////////// 
.................... #device PIC18F6622 
.................... #list 
.................... 
.................... #device *=16....................   
.................... #fuses PROTECT=15 
.................... #fuses WRT=15 
.................... #fuses EBTR=15 
....................   
.................... main() 
.................... { 
0004:  CLRF   FF8
0006:  BCF    FD0.7
0008:  CLRF   FEA
000A:  CLRF   FE9
000C:  MOVF   FC1,W
000E:  ANDLW  C0
0010:  IORLW  0F
0012:  MOVWF  FC1
0014:  MOVLW  07
0016:  MOVWF  FB4
.................... } 
.................... 
0018:  SLEEP

Configuration Fuses:
   Word  1: 0F00   NOIESO NOFCMEN RESERVED
   Word  2: 1F1F   BROWNOUT WDT BORV25 NOPUT WDT32768
   Word  3: 81F3   CCP2C1 NOLPT1OSC MCLR RESERVED
   Word  4: 0085   STVREN NODEBUG LVP NOXINST BBSIZ1K RESERVED
   Word  5: C00F   NOCPD NOCPB
   Word  6: E00F   NOWRTD NOWRTC NOWRTB
   Word  7: 400F   NOEBTRB


Which is what I expected, I changed the #device line to
Code:
#device *=16  ICD=TRUE


This changed the Configuration Fuses section to
Code:
   Word  1: 0F00   NOIESO NOFCMEN RESERVED
   Word  2: 1E19   NOBROWNOUT NOWDT BORV25 NOPUT WDT32768
   Word  3: 81F3   CCP2C1 NOLPT1OSC MCLR RESERVED
   Word  4: 0000   NOSTVREN DEBUG NOLVP NOXINST BBSIZ1K RESERVED
   Word  5: C0FF   NOPROTECT NOCPD NOCPB
   Word  6: E0FF   NOWRT NOWRTD NOWRTC NOWRTB
   Word  7: 40FF   NOEBTRB NOEBTR


This causes problems when I try to download the code to an ICD-U40 as in the 6622 the last 3 configuration words have only 4 bits in lower byte so the download fails as the actual configuration fuses dont match the fuses generated by the compiler.

Any ideas?
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