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

Debugger not working with 18F67K22

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



Joined: 18 Nov 2013
Posts: 160

View user's profile Send private message

Debugger not working with 18F67K22
PostPosted: Wed Jan 20, 2016 6:14 pm     Reply with quote

I've used the 18F8722 for years with good success. Now I'm trying the 18F67K22, which appears to
largely be an upgraded version of the 18F8722. In any case, I have a new board, and I can program
the PIC with CCSLoader and blink some lights. All good.

But the debugger in the IDE does not work. Using a very basic program, I compile with ICD=TRUE,
and enable the debugger. The IDE downloads the program, then the status message says "Verifying Data: Debugger".
After a long time, I get a pop-up that says "No response from ICD" with a button that says "Run Diagnostics".
I click the button and the pop-up message changes to "The application was unable to start correctly (0xc0000142)"
"Click OK to close the application." I click OK and the ICD led turns red.

This is the program I'm trying to run in the debugger, which runs fine without the debugger:

Code:

#include <18F67K22.h>
#device ICD=TRUE
#use delay(crystal=9990244)
#use FIXED_IO( C_outputs=PIN_C2, PIN_C0 )

void main(void) {
   int x;
 
   x=5;
   while(TRUE) {
        x++;
        x=x+2;
        delay_ms(500);
        output_low(PIN_C2);
        delay_ms(500);
        output_high(PIN_C2);
    }
}


Is there something different I need to do for this PIC?

I'm using v5.053 of the IDE.
Ttelmah



Joined: 11 Mar 2010
Posts: 19504

View user's profile Send private message

PostPosted: Thu Jan 21, 2016 3:09 am     Reply with quote

Have a look at this thread on the MicroChip site:

<http://www.microchip.com/forums/m904063.aspx>

Might give some pointers.

The 67K22, is prone to taking a long time for some crystals to start. Try adding PUT, and putting a 1MR resistor across the crystal.
It's also very sensitive to the length of the ICD cable.
SeeCwriter



Joined: 18 Nov 2013
Posts: 160

View user's profile Send private message

PostPosted: Thu Jan 21, 2016 11:32 am     Reply with quote

I looked at the thread in the Microchip forum. As far as I can tell, I don't have a problem with the oscillator.
It starts just fine and works with IESO enabled or not, and with PUT enabled or not. I am using a 10MHz crystal,
by-passed with 24pf caps, as I've done with other PICs. And as far as not being able to debug, the poster had
pull-ups on PGD & PGC that were causing his problem. Once removed, he was able to debug. I don't have pull-ups on
the programming pins.

I've used several different PICs over the years, and the way the programming pins are connected to the programming
header is the same on all of them. The PGC, PGD, & RB3 pins have a series 100 ohm resister to the header. The MCLR
pin has a 2k pull-up in series with a diode to isolate the board's Vdd (5V) from the high programming voltage, and
a .1uf cap to ground.

The only thing different with this design is that we are using the Tag-Connect cable (legged) instead of a 6-pin
molex connector for the first time.

We are using the ICD-U64 for programming. It has the latest firmware, v3.14, and CCSLoad is v5.022.
Ttelmah



Joined: 11 Mar 2010
Posts: 19504

View user's profile Send private message

PostPosted: Thu Jan 21, 2016 11:44 am     Reply with quote

Try it with the internal oscillator selected instead. If it works, you have proved that it is not a problem with the cable etc..

If it works with the internal oscillator, try the resistor.

The problem I have seen, is not that it doesn't start, but that it is _slow_ to start. The ICD doesn't see the clock as running properly when it tests.

You did follow the extra guidelines about Tag-connect?. 0.020 clearance to any other signal, the 'keep out' area between the pads (this includes ground planes etc.), and no solder paste on the tag pads....
SeeCwriter



Joined: 18 Nov 2013
Posts: 160

View user's profile Send private message

PostPosted: Thu Jan 21, 2016 1:19 pm     Reply with quote

It doesn't work with the internal oscillator either.

The spec sheet from CCS was given to board designer, so I'm assuming the tag-connect guidelines were followed. It looks good.
SeeCwriter



Joined: 18 Nov 2013
Posts: 160

View user's profile Send private message

PostPosted: Mon Jan 25, 2016 10:21 am     Reply with quote

I've got most of my program working using printf() statements to debug it.
Since I can program the PIC and verify the programming, that would seem
to confirm that all the programming connections to the PIC are working,
and the oscillator is working.

If that's true, what is different about debugging that would cause the debugger to not work?
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