Guess the main problem is that MCHP dropped PLIB for XC8 later than v1.34.
You can install v1.34 and try again, copy the source of the PLIB functions to your project
or rewrite all the functions coming from PLIB.
You can download PLIB from the same site you got xc8 from.
It wont work with the new xc8 version, but you get the source code for the fucktions.
Only two functions should be affected. I modified them recently for the
27J53.THERE thy look like this now:
- Code: Select all
void initADC(void)
{
// OpenADC(ADC_FOSC_64 & ADC_RIGHT_JUST & ADC_2_TAD,
// ADC_CH0 & ADC_INT_OFF & ADC_REF_VDD_VSS,
// ADC_TRIG_CCP2,
// ADC_5ANA & ADC_VBG_OFF);
ADCON1bits.ADCS = 0b110; //ADC_FOSC_64
ADCON1bits.ADFM = 1; //ADC_RIGHT_JUST
ADCON1bits.ACQT = 0b01; //ADC_2_TAD
ADCON0bits.CHS = ADCH_0;
ADCON0bits.VCFG = 0b00; //ADC_REF_VDD_VSS
ADCTRIGbits.TRIGSEL = 0b00; //ADC_TRIG_CCP2
ANCON0 = 0xE0; //ADC_5ANA
ANCON1bits.VBGEN = 0; //ADC_VBG_OFF
ADCON0bits.ADON = 1;
}
/******************************************************************************
* Function: void initSpecialEventTrigger(void)
*
* PreCondition: None
* Input: None
* Output: None
* Side Effects: None
*
* Overview:
*
* Note:
*
*****************************************************************************/
void initSpecialEventTrigger(void)
{
// Timer1 input = 48MHz/4 = 12MHz; Prescaler 8 -> 1.5MHz
// OpenTimer1(TIMER_INT_OFF & T1_16BIT_RW & T1_SOURCE_FOSC_4 &
// T1_PS_1_8 & T1_OSC1EN_OFF & T1_SYNC_EXT_OFF,
// TIMER_GATE_OFF);
T1CONbits.RD16 = 1; //T1_16BIT_RW
T1CONbits.TMR1CS = 0b00; //T1_SOURCE_FOSC_4
T1CONbits.T1CKPS = 0b11; //T1_PS_1_8
T1CONbits.T1OSCEN = 0; //T1_OSC1EN_OFF
T1CONbits.nT1SYNC = 0; //T1_SYNC_EXT_OFF
T1GCONbits.TMR1GE = 0; //TIMER_GATE_OFF
T1CONbits.TMR1ON = 0; // gets activated later when measurement starts
CCPTMRS0bits.C2TSEL = 0; // timer <-> ccp module (CCP2 / TMR1)
CCPR2 = 15000; // 1.5MHz/100Hz
ECCP2CONbits.CCP2M = 0b1011; // Compare Mode with Special Event Trigger
}
For the
4550 they are different, but I think you can do this with the help of the data sheet
