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

Compiler v4 error

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







Compiler v4 error
PostPosted: Thu Feb 08, 2007 12:02 am     Reply with quote

Hello.
I'm working PIC18F65J10 and PIC18F66J15
I have some question about that with v4 compiler

First Q.
I' try to same source program
good in v3.249 but bad in v4.016

second Q.
same source program but difference device

PIC18F65J10 is good but PIC16F66J15 is bad in ver3.249

Why is it?

Bonus Q.
setup_ccp error

//setup_ccp1(ccp_off); // occured error
//setup_ccp2(ccp_off); // occured error
//setup_ccp3(ccp_off); // occured error
//setup_ccp4(ccp_off); // occured error
//setup_ccp5(ccp_off); // occured error
ccp1con=0x00;
ccp2con=0x00;
ccp3con=0x00;
ccp4con=0x00;
ccp5con=0x00;


See the bellow summary source

#include "18f65J10.h"
//#include "18f66J15.h"

#FUSES HS,PROTECT,NODEBUG,NOFCMEN,NOIESO,STVREN,WDT4096,NOXINST
#ID 0x06,0x12,0x18,0x00
#ZERO_RAM
#priority timer1,ext1,ext,rtcc,timer2

#use delay(clock=16000000, restart_wdt)
#use rs232(baud=19200,xmit=pin_c6)//,rcv=pin_c7)

#include "math.h"

#INT_EXT1
void ext1_isr()
{
sleep_flag=TRUE;
.
.
}

#INT_TIMER1
void RTC_isr() //RTC ROUTINE
{
byte temp_hour_data;

TMR1H=0x80; TMR1L=0x00;
}

#INT_EXT
void ext_isr()
{
enable_interrupts(INT_RTCC);
//etc description
}

#INT_RTCC
void rtcc_isr()
{
disable_interrupts(INT_RTCC);
//etc description
}

#INT_TIMER2 //key and dispaly(FND,LED) routine
void timer2_isr()
{

}

void main(void)
{
set_tris_a(0xff);
set_tris_b(0xff);
set_tris_c(0x01);
set_tris_d(0x00);
set_tris_e(0x30);
set_tris_f(0xc0);
set_tris_g(0x00);

port_b_pullups(FALSE);
lata=0;
latb=0;
latc=0;
latd=0;
late=0;
latf=0;
latg=0;

sleep_flag=FALSE; // init sleep flag

//setup_ccp1(ccp_off); // occured error
//setup_ccp2(ccp_off); // occured error
//setup_ccp3(ccp_off); // occured error
//setup_ccp4(ccp_off); // occured error
//setup_ccp5(ccp_off); // occured error
ccp1con=0x00;
ccp2con=0x00;
ccp3con=0x00;
ccp4con=0x00;
ccp5con=0x00;

//setup_spi(SPI_SS_DISABLED);
SSP1CON1=0x01;
SSP1STAT=0x00;
//setup_spi2(SPI_SS_DISABLED);// occured error
SSP2CON1=0x01;
SSP2STAT=0x00;

setup_psp(psp_disabled);
setup_comparator(NC_NC_NC_NC);
setup_adc(ADC_CLOCK_INTERNAL);
setup_adc_ports(AN0|VSS_VDD); // A3, A5, E0, E1, E2 -> ANALOG
set_adc_channel(1);

ext_int_edge(L_TO_H); //fsk in
ext_int_edge(1,H_TO_L);
setup_counters(RTCC_8_BIT,RTCC_DIV_64);
setup_wdt(WDT_ON);
//setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1);

//setup_timer_2(T2_DIV_BY_4,0xfa,6);//@6Mhz
setup_timer_2(T2_DIV_BY_16,0x64,10); // the timer will include every 4uS,
// will overflow every 0.4mS and will interrupt every 4mS

SETUP_TIMER_3(T3_INTERNAL|T3_DIV_BY_8);//the timer will increment every 2us.
//It will overflow every 131.072ms.
//setup_OSCILLATOR(OSC_NORMAL);

disable_interrupts(INT_BUSCOL);
disable_interrupts(INT_BUSCOL2);
disable_interrupts(INT_RDA);
disable_interrupts(INT_RDA2);
disable_interrupts(INT_SSP);
disable_interrupts(INT_SSP2);
disable_interrupts(INT_PSP);
disable_interrupts(INT_RB);
disable_interrupts(INT_CCP1);
disable_interrupts(INT_CCP2);
disable_interrupts(INT_CCP3);
disable_interrupts(INT_CCP4);
disable_interrupts(INT_CCP5);
disable_interrupts(INT_COMP);
disable_interrupts(INT_OSCF);
disable_interrupts(INT_TBE);
disable_interrupts(INT_TBE2);
disable_interrupts(INT_AD);

disable_interrupts(INT_EXT2);
disable_interrupts(INT_EXT3);
disable_interrupts(INT_RTCC);
disable_interrupts(INT_TIMER3);
disable_interrupts(INT_TIMER4);

enable_interrupts(INT_TIMER1);
enable_interrupts(INT_EXT);
enable_interrupts(INT_EXT1);
enable_interrupts(INT_TIMER2);
enable_interrupts(GLOBAL);


//**************RTC_init****************//
TMR1L=0x00; //Preload TMR1 register pair
TMR1H=0x80; //for 1 second overflow

//setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1);

T1CON=0x0f; // Configure for external clock,
//Asynchronous operation, external oscillator
sec_data=0; // Initialize timekeeping registers
min_data=0;
hour_data=12;
enable_interrupts(INT_TIMER1); // Enable Timer1 interrupt
//*********************************************

while(TRUE){//main program description
if(sleep_flag)sleep();// if sleep flag set make processor sleep
}
}


CCS Technical Support does not monitor this forum on a regular basis. Please do not post bug reports to this form. All bug reports should be emailed to support@ccsinfo.com. Thank you.
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