CCS Backwards Compatibility

CCS provides a method to attempt to make sure you can compile code written in older versions of CCS with minimal difficulty by altering the methodology to best match the desired version. Currently, there are 4 levels of compatibility provided: CCS V2.XXX, CCS V3.XXX, CCS V4.XXX and ANSI. Notice: this only affects the compiler methodology, it does not change any drivers, libraries and include files that may have been available in previous versions.

  • #device CCS2
    • ADC default size is set to the resolution of the device (#device ADC=10, #device ADC=12, etc)
    • boolean = int8 is compiled as: boolean = (int8 != 0)
    • Overload directive is required if you want to overload functions
    • Pointer size was set to only access first bank (PCM *=8, PCB *=5)
    • var16 = NegConst8 is compiled as: var16 = NegConst8 & 0xFF (no sign extension)
    • Compiler will NOT automatically set certain #fuses based upon certain code conditions.
    • rom qualifier is called _rom

  • #device CCS3
    • ADC default is 8 bits (#device ADC=8)
    • boolean = int8 is compiled as: boolean = (int8 & 1)
    • Overload directive is required if you want to overload functions
    • Pointer size was set to only access first bank (PCM *=8, PCB *=5)
    • var16 = NegConst8 is compiled as: var16 = NegConst8 & 0xFF (no sign extension)
    • Compiler will NOT automatically set certain #fuses based upon certain code conditions.
    • rom qualifier is called _rom

  • #device CCS4
    • ADC default is 8 bits (#device ADC=8)
    • boolean = int8 is compiled as: boolean = (int8 & 1)
    • You can overload functions without the overload directive
    • If the device has more than one bank of RAM, the default pointer size is now 16 (#device *=16)
    • var16 = NegConst8 is will perform the proper sign extension
    • Automatic #fuses configuration (see next section)

  • #device ANSI
    • Same as CCS4, but if there are any discrepancies are found that differ with the ANSI standard then the change will be made to ANSI
    • Data is signed by default
    • const qualifier is read-only RAM, not placed into program memory (use rom qualifier to place into program memory)
    • Compilation is case sensitive by default
    • Constant strings can be passed to functions (#device PASS_STRINGS_IN_RAM)

C-Aware IDE Demo
Embedded C Learners Kit
C Workshop Compiler