View previous topic :: View next topic |
Author |
Message |
mancio76
Joined: 10 Aug 2011 Posts: 8 Location: Italia
|
Debugging 18F25K22 |
Posted: Tue Nov 13, 2012 10:02 am |
|
|
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
|
|
Posted: Tue Nov 13, 2012 11:17 pm |
|
|
Hi
Try adding the following to the header file:
BR
NN _________________ Every solution has a problem. |
|
|
gpsmikey
Joined: 16 Nov 2010 Posts: 588 Location: Kirkland, WA
|
|
Posted: Tue Nov 13, 2012 11:58 pm |
|
|
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"
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
|
|
Posted: Wed Nov 14, 2012 2:05 am |
|
|
n-squared wrote: | Hi
Try adding the following to the header file:
BR
NN |
Thank you for the suggestion.
I've correct the header with
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
|
|
Posted: Wed Nov 14, 2012 3:55 am |
|
|
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 |
|
|
|