So there you have it! I dismissed the free version of the XC8 compiler, but you really shouldn’t. Migrating from CCS to the free XC8 compiler resulted in the ROM usage reducing from 22420 words to 20457 words. I converted one of my other projects which uses an 18F PIC. I wondered if this was limited to the 16F range of PIC devices, but it’s not. I think the results probably speak for themselves. The code sets up some IO, encrypts 128 bits using XXTEA then prints the encrypted result out of the UART.
CCS C COMPILER FULL
It’s designed to be opened in MPLAB X and is full of #defines, so it’ll compile fine using either CCS or XC8. This prompted me to come up with a project specifically to compare the two compilers, so that’s what I’ve done.
CCS C COMPILER PRO
This is the answer:įairly remarkable! The PRO (paid-for) version of the XC8 compiler is creating code that consumes 63% less ROM and 15% less RAM than the paid-for version of CCS. Out of curiosity, I wondered how small the PRO version of the XC8 compiler could make the code. So the headline so far is that CCS is 21% slower, takes up 4% more ROM and 38% more RAM than the free XC8 compiler! The free XC8 compiled code took 26329 clock cycles to configure CatTrack and run an encryption routine, whereas the CCS compiled code took 31849. I then thought that although the CCS code takes up more space, perhaps it’s compiled for speed rather than space? To cut a long story short – no, it isn’t. All strict options turned on by default More available compiler options. It appears that the free version of the XC8 compiler is creating more efficient code than the paid-for CCS compiler! Ignore the references to the PRO licence above – it was compiled in Free mode. If I2Cdiag is static and logic high an I 2 C function has hung up which. So now the moment of truth, let’s see the Memory usage when using the free version of the XC8 compiler: It took a few hours of work to plough through the code and make all the necessary changes required to convert from CCS to XC8. This is what the Memory usage currently looks like in the PIC16LF18345, compiled with CCS C: I did begin to wonder though, just how much bigger would my code be, and how much slower would it run if I used the free version of Microchip’s XC8 compiler? As I previously mentioned, I am using the CCS C compiler, basically because the ‘paid for’ version of their compiler is significantly cheaper than Microchip’s XC8 ‘paid-for’ version. Now that I’ve got CatTrack working, I’ve been having a look at refining the code.