Compiler Features - PIC10 Through PIC18
The compiler contains Standard C operators and built-in libraries that are specific to the PIC registers. Access to hardware features from C. Features include:
- 1, 8, 16 and 32 bit integer types and 32 bit floating point.
- Standard one bit type (Short Int) permits the compiler to generate very efficient Bit oriented code.
- #BIT and #BYTE will allow C variables to be placed at absolute addresses to map registers to C variables.
- Bit Arrays
- Fixed Point Decimal
- Constants (including strings and arrays) are saved in program memory.
- Flexible Handling Of Constant Data
- Variable Length Constant Strings
- Addressmod Capability To Create User Defined Address Spaces In Memory Device
Built-in Functions
The CCS C Compiler for PIC10, PIC12, PIC14, PIC16, and PIC18 microcontrollers has 307 Built-in Functions to access PIC® MCU hardware is easy and produces efficient and highly optimized code. Functions such as timers, A/D, EEPROM, SSP, PSP, USB, I2C and more:
- Built-in libraries that work with all chips for RS-232 serial I/O, I2C, discrete I/O and precision delays.
- Serial I/O functions allow standard functions such as GETC() and PRINTF() to be used for RS-232 like I/O.
- Formatted printf allows easy formatting and display in HEX or decimal.
- Multiple I2C and RS232 ports may be easily defined.
- #use rs232() offers options to specify a maximum wait time for getc.
- Hardware tranceiver used when possible, but for all other occasions the compiler generates a software serial transceiver.
- Microcontroller clock speed may be specified in a PRAGMA to permit built-in functions to delay for a given number of microseconds or milliseconds.
- Functions such as INPUT() and OUTPUT_HIGH() properly maintain the tri-state registers.
- Compiler directives determine if tri-state registers are refreshed on every I/O or if the I/O is as fast as possible.
- #USE SPI ()
- Simple functions like READ_ADC() to read a value from A/D converter.
- Source code drivers included for LCD modules, keypads, 24xx and 94xx serial EEPROM, X10, DS1302 and NJU6355 real time clocks, Dallas touch memory devices, DS2223 and PCF8570, LTC1298 and PCF8591 A/D converters, temperature sensors, digital pots, I/O expander and much more.
- 133 ready-to-run programs included.
Additional Features
The compiler can handle inline or separate functions, as well as parameter passing in re-usable registers. Transparent to the user, the compiler handles calls across pages automatically and analyzes program structure and call tree processes to optimize RAM and ROM Usage. Additional features include:
- Efficient function implementation allows call trees deeper than the hardware stack.
- Automatic linking handles multiple code pages.
- Assembly code may be inserted anywhere in the source and may reference C variables.
- Function Overloading allows for several functions with the same name, but differences in number and type of parameters.
- Default Parameters can be used in a function if arguments are not used in a call.
- Interrupt functions supported on PCM/PCH. The compiler generates all startup and clean up code as well as identifying the correct interrupt function to be called.
- Reference parameters may be used to improve code readability and inline function efficiency.
- Generation Of Multiple HEX Files For Chips With External Memory
- Variable Number Of Parameters in a function.
- Relocatable Objects / Multiple Compilation Unit (IDE Only)
- Automatic #fuses Configuration
The compiler runs under Windows 95, 98, ME, NT4, 2000, XP, Vista, Windows 7, Windows 8, Windows 10, Windows 11 or Linux. It outputs hex and debug files that are selectable and compatible with popular emulators and programmers including the MPLAB® IDE for source level debugging.