I actually do have this experience!
I moved to the official Microchip tools about 6 years ago after using CCS for a time (the codebases here where I work were all CCS when I first started).
Migrating code over might be a bit of an annoyance, depending on how much you are relying on CCS-specific features, but is definitely doable. Learning XC8/XC16 shouldn't be too much trouble if you already know how to program in C. Most of the knowledge will carry, but some things will be different.
Like converting the CCS #FUSE directives over to using the #pragma config directives to set your config bits in XC:CCS:
#FUSES FRC //Use Internal FRC
#pragma config FNOSC = FRC //Use Internal FRC
The names of the structures for setting/clearing individual bits in a register are slightly different:CCS:
U2MODE.UARTEN = 1;
U2MODEbits.UARTEN = 1;
ISRs are also declared differently. I think
CCS may also automatically clear the interrupt flag inside the ISR (at least, none of the legacy CCS code I'm looking at clears the flag):CCS:
void __attribute__ ((interrupt,no_auto_psv)) _T4Interrupt (void)
IFS1bits.T4IF = 0; //Make sure we clear the interrupt flag!
Probably the most annoying bit might be if you use lots of the convenience functions in CCS. One example would be for something like peripheral setup. In CCS there was a convenience function "setup_compare()" that you could just provide arguments to:
Something like this would not work unless you wrote a setup_compare() function of your own.
In XC16, this would be a similar setup:
OC3CON1bits.OCTSEL = 0b000; //TIMER 2 IS SOURCE
OC3CON1bits.ENFLT = 0b000; //Faults Disabled
OC3CON1bits.TRIGMODE = 1;
OC3CON1bits.OCM = 0b110; //Edge Aligned
OC3CON2bits.OCMPINV = 0; //non-inverted output
OC3CON2bits.DCB = 0b00;
OC3CON2bits.OC32 = 0;
OC3CON2bits.OCMPINV = 0;
OC3CON2bits.OCTRIG = 0;
OC3CON2bits.OCTRIS = 0;
OC3CON2bits.SYNCSEL = 0b01100; //SYNC Timer2 (if SYNC is enabled)
This could be shortened to:
OC3CON1 = 0x000E;
OC3CON2 = 0x000C;
Basically, you would need to consult the device datasheet and/or create your own macros to reproduce the something like the setup_compare() function in XC16.
Hope this helps, my knowledge of CCS may not be entirely accurate, as the CCS I worked with was a few versions out of date even when I first started using it about 6 years ago (v4.132 is the version I've got installed for building legacy firmware).
post edited by KTrenholm - 2020/10/23 10:30:08