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

18F6622 ICD problem with compiler version 3.236

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



Joined: 03 May 2004
Posts: 48
Location: Sg

View user's profile Send private message

18F6622 ICD problem with compiler version 3.236
PostPosted: Wed Mar 22, 2006 8:15 pm     Reply with quote

Dear all,
I am using compiler version 3.236, pic18f6622 for my development.
Yesterday I had problem burning in the code, then i search in the forum, and found http://www.ccsinfo.com/forum/viewtopic.php?t=25924&highlight=18f6622 .I changed accordingly as ckielstra mentions.
Then the code can be burned into the chip.
But today when i try to use the ICD emulation mode, it prompts 'The detected target name:PIC18F6622 does not match the code's target: PIC16C622. Do you want to continue?' If i click 'yes', after some time, it would say 'Could not start target..... check MCLR and ocsillator' etc.
Can anyone help?
Thanks in adv.
Sigma
Sigma



Joined: 03 May 2004
Posts: 48
Location: Sg

View user's profile Send private message

PostPosted: Thu Mar 23, 2006 3:35 am     Reply with quote

I have checked the hardware connection, and they are okay. MCLR at 5 volt. IAR firmware version: 1.39 I can use iar.exe to program the chip, and it is working. But if i want to use the debug mode, it prompt the errors.
What i burn is
Code:

#include "18f6622.h"
#device *=16 ICD=TRUE

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

main()
{
}


The list file is:
Code:

CCS PCH C Compiler, Version 3.236, 30957               23-Mar-06 18:41

               Filename: C:\Documents and Settings\demo1\Desktop\New Folder\test.LST

               ROM used: 26 bytes (0%)
                         Largest free fragment is 64678
               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 ICD=TRUE
.................... 
.................... #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:  BRA    0018

Configuration Fuses:
   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: C00F   NOPROTECT NOCPD NOCPB
   Word  6: E00F   NOWRT NOWRTD NOWRTC NOWRTB
   Word  7: 400F   NOEBTRB NOEBTR


the hex code is

Code:

:020000040000FA
:1000000002EF00F0F86AD09EEA6AE96AC150C00BBC
:0A0010000F09C16E070EB46EFFD792
:020000040030CA
:0E000000000F191EF38100000FC00FE00F402B
:00000001FF
;PIC18F6622


When i remove the 'ICD = TRUE' in the c code
Code:

#include "18f6622.h"
#device *=16

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

main()
{
}



After compilation, the list file is
Code:

CCS PCH C Compiler, Version 3.236, 30957               23-Mar-06 18:29

               Filename: C:\Documents and Settings\demo1\Desktop\New Folder\test.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   NOPROTECT NOCPD NOCPB
   Word  6: E00F   NOWRT NOWRTD NOWRTC NOWRTB
   Word  7: 400F   NOEBTRB NOEBTR

[


the hex code is
Code:

:020000040000FA
:1000000002EF00F0F86AD09EEA6AE96AC150C00BBC
:0A0010000F09C16E070EB46E030065
:020000040030CA
:0E000000000F1F1FF38185000FC00FE00F409F
:00000001FF
;PIC18F6622


Can anyone help?
Thanks.

Sigma[/quote]
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Thu Mar 23, 2006 6:37 am     Reply with quote

Quote:

'Could not start target..... check MCLR and ocsillator'


This message appears every time the ICD cannot raise MCLR pin over 5V,
so I guess you have a hardware problem.

Do you have connected the R that separates the ICD from the MCLR?


Humberto
Sigma



Joined: 03 May 2004
Posts: 48
Location: Sg

View user's profile Send private message

PostPosted: Thu Mar 23, 2006 8:20 am     Reply with quote

Thanks Humberto. I know this famous problem of ICD 'can not start target......' But i would say this one i encountered is not the same problem. It is giving another problem before getting this one. The main problem is that there is mismatch between the compiler recognition and the ICD recognition of the chip. It said 'The detected target name:PIC18F6622 does not match the code's target: PIC16C622. Do you want to continue?' To me, it seems like the ICD detects a 18F6622 while the compiler see it as a 16C622. But my code is
Code:

#include "18f6622.h"
#device *=16 ICD=TRUE

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

main()
{
}

How can it be possible?! you see.

Please help.

Sigma
Sigma



Joined: 03 May 2004
Posts: 48
Location: Sg

View user's profile Send private message

PostPosted: Thu Mar 23, 2006 7:05 pm     Reply with quote

It seems like few people using 18F6622. But could anyone using this chip compile my sample program and try to see whether it will work on bebug mode using your compiler? If anyone have any suggestion, i will be glad to try it.
Thanks.
Sigma
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Fri Mar 24, 2006 5:09 pm     Reply with quote

It seems that setting ICD=TRUE changes more fuses than just the debugger enable fuse. The changed fuses in your example program are:
- NOBROWNOUT
- NOWDT
- NOSTVREN (Stack full/underflow reset enable bit)
- DEBUG
- NOLVP
Changing these fuses makes sense for the debugger.


Also check the readme.txt for the ICD2 debugger in the Microchip MPLAB directory or at http://ww1.microchip.com/downloads/en/DeviceDoc/ReadmeMP731.zip
Especially note the tip for setting the NOPUT fuse when using the ICD on a PIC18F6622 chip.

I don't see any errors in the list file. The error message for a PIC18C6622 detected is strange, could this be an error in your IAR software?
Sigma



Joined: 03 May 2004
Posts: 48
Location: Sg

View user's profile Send private message

PostPosted: Fri Mar 24, 2006 6:49 pm     Reply with quote

Thanks, ckielstra.
The list file and hex file seem no problem. But in the .cof.txt file, i am surprised to find the following lines:
Code:

Optional Header:
magic=7032
vstamp=12854
proc_type=0x00006622 [PIC16C622]
rom_width_bits=8
ram_width_bits=8


I found another link in the forum http://www.ccsinfo.com/forum/viewtopic.php?t=17208
A few more people share the similar problem, and remain unsolved, though.
Thanks.

Sigma
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