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

Debugging 18F25K22

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



Joined: 10 Aug 2011
Posts: 8
Location: Italia

View user's profile Send private message

Debugging 18F25K22
PostPosted: Tue Nov 13, 2012 10:02 am     Reply with quote

Hello to everybody,

I'm trying debugging PIC18F25K22 bus something seems doesn't work correctly.

I'm using PCWHD 4.137.
To attach to my target, I'm using the ICD3 from Microchip.

The .h file is the following:
Code:

#include <18F25K22.h>
#device ICD=TRUE
#device adc=16


#FUSES NOWDT                    //No Watch Dog Timer
#FUSES WDT128                   //Watch Dog Timer uses 1:128 Postscale
#FUSES INTRC                    //Internal RC Osc
#FUSES PRIMARY_SW               //Primary clock can be disabled in software
#FUSES NOBROWNOUT               //No brownout reset
#FUSES WDT_NOSLEEP              //Watch Dog Timer, disabled during SLEEP
#FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOXINST                  //Extended set extension and Indexed Addressing mode disabled (Legacy mode)

#use delay(int=32000000,RESTART_WDT)

And the .c is:

Code:
#include <Test_18F25K22.h>


void main()
{
   setup_timer_3(T3_DISABLED | T3_DIV_BY_1);
   setup_timer_4(T4_DISABLED,0,1);
   setup_timer_5(T5_DISABLED | T5_DIV_BY_1);
   setup_timer_6(T6_DISABLED,0,1);

   setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard

   while(TRUE)
   {
      output_low(PIN_C0);
      delay_ms( 50 );
      output_high(PIN_C0);
      delay_ms( 50 );

   }

}


The problem is that in debugging mode the system seem's doesn't work correctly.
Sometimes it connects to the target and let it running.
If I work with breakpoints or stops the system working, I need to reconnect the ICD to the target, as debugger, to let the system start.

In programming mode seems the system works fine.

Where is the trouble?
Is there anyone can help me?

Thanks
n-squared



Joined: 03 Oct 2006
Posts: 99

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Tue Nov 13, 2012 11:17 pm     Reply with quote

Hi
Try adding the following to the header file:
Code:
#FUSES DEBUG

BR
NN
_________________
Every solution has a problem.
gpsmikey



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

PostPosted: Tue Nov 13, 2012 11:58 pm     Reply with quote

Don't know if this affects your problem, but I just got email from CCS informing me that version 4.138 had been released - the interesting line in the update info was
"Updated: PIC18F25K22"

Very Happy

mikey
_________________
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3
mancio76



Joined: 10 Aug 2011
Posts: 8
Location: Italia

View user's profile Send private message

PostPosted: Wed Nov 14, 2012 2:05 am     Reply with quote

n-squared wrote:
Hi
Try adding the following to the header file:
Code:
#FUSES DEBUG

BR
NN


Thank you for the suggestion.
I've correct the header with
Code:

#FUSES DEBUG

But still not working properly!
I'm working around on internal clock to understand if the problem can reach from that.
Also, I'm waiting for news coming from version 4.138!
I hope it will resolve the problem!!
mancio76



Joined: 10 Aug 2011
Posts: 8
Location: Italia

View user's profile Send private message

PostPosted: Wed Nov 14, 2012 3:55 am     Reply with quote

I've update the software to 4.138 and the system was working a little.
Then, I've anailze more in deep my electrical circuit and I've found some components attached to the PGD and PGC data of the ICD3.
I've then isolate the system, removing some resistors and now, finally, the system eneter in debug mode correctly.
That was basically an hardware problem. Maybe mixed a little with the 4.137 software version

Thanks to everyone
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