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

Problems debugging the PIC24FJ32GA004

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







Problems debugging the PIC24FJ32GA004
PostPosted: Thu Feb 05, 2009 11:14 am     Reply with quote

Hi all,
I'm having some problems to debug one simple code in the PIC24FJ32GA004.
When i put the clock to work with the PLL, a can't debug anything in the code, it runs like it has no breakpoints. Some times one erro occurs in the PIC C compiler saying: "Invalid clock value from the debugger. Debugger may not be properly communicating to the target..."
I'm using the PIC C compiler and the ICD-U40. The cristal that i'm using is 8MHz.
Above goes the code:

main.c:

#include "C:\users\rcfr\ProjetoSerial115200\main.h"

unsigned int8 a = 0;
unsigned int8 b = 0;
unsigned int8 c;

void main()
{

setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_psp(PAR_DISABLE,PAR_DISABLE);
setup_spi(SPI_SS_DISABLED);
setup_timer1(TMR_DISABLED);
setup_timer2(TMR_DISABLED);
setup_timer3(TMR_DISABLED);
setup_timer4(TMR_DISABLED);
setup_timer5(TMR_DISABLED);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
a = 10 + 10;
b = 1 + a;
output_high(PIN_B12);
output_high(PIN_C7);
delay_ms(1000);
output_low(PIN_C7);
delay_ms(1000);
while(1)
{
c = getc();
putc(c);
}
}

main.h:

#include <24FJ32GA004.h>
#device ICD=TRUE
#device adc=8

#FUSES NOWDT //No Watch Dog Timer
#FUSES NOJTAG //JTAG disabled
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOWRT //Program memory not write protected
#FUSES DEBUG //No Debug mode for ICD
#FUSES ICS3 //ICD communication channel 3
#FUSES NOIOL1WAY //Allows multiple reconfigurations of peripheral pins
#FUSES NOWINDIS //Watch Dog Timer in Window mode
#FUSES WPRES128 //Watch Dog Timer PreScalar 1:128
#FUSES WPOSTS1 //Watch Dog Timer PostScalar 1:1
#FUSES NOIESO //Internal External Switch Over mode disabled
#FUSES PR_PLL //Primary Oscillator with PLL
#FUSES NOSKSFSM //Clock Switching Mode is disabled
#FUSES NOOSCIO //OSC2 is general purpose output
#FUSES XT //Crystal osc <= 4mhz for PCM/PCH , 3mhz to 10 mhz for PCD
#FUSES I2C1SELD
#use delay(clock=32000000)
#pin_select U2TX=PIN_B11
#pin_select U2RX=PIN_B10
#use rs232(baud=114000, parity=N, xmit=PIN_B11, rcv=PIN_B10, stop=1)

I've read some old post in the forum, but every one is using the MPLAB to debug the code. I'm new using PICs so how should i use the MPLAB?!
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