668 C Compiler
CCS C Compiler
Processor &
Peripheral Controls
The CCS C Compiler for PIC10, PIC12,
PIC14, PIC16, PIC18 and PIC24
microcontrollers has over 180 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-inlibrariesthatworkwithallchipsforRS-232serialI/O,I2C,
discreteI/Oandprecisiondelays
• SerialI/OfunctionsallowstandardfunctionssuchasGETC()and
PRINTF()tobeusedforRS-232likeI/O
• FormattedprintfallowsforeasyformattinganddisplayinHEXor
decimal
• MultipleI2CandRS232portsmaybeeasilydefined
• #users232()offersoptionstospecifyamaximumwaittimeforgetc
• Hardwaretransceiverusedwhenpossible,butforallotheroccasions
thecompilergeneratesasoftwareserialtransceiver
• MicrocontrollerclockspeedmaybespecifiedinaPRAGMAto
permitbuilt-infunctionstodelayforagivennumberofmicroseconds
or milliseconds
• FunctionssuchasINPUT()andOUTPUT_HIGH()properlymaintain
thetri-stateregisters
• Compilerdirectivesdetermineiftri-stateregistersarerefreshedon
everyI/OoriftheI/Oisasfastaspossible
• #USESPI()
• SimplefunctionslikeREAD_ADC()toreadavaluefromA/D
converter
• SourcecodedriversincludedforLCDmodules,keypads,24xxand
94xxserialEEPROM,X10,DS1302andNJU6355realtimeclocks,
Dallastouchmemorydevices,DS2223andPCF8570,LTC1298
andPCF8591A/Dconverters,temperaturesensors,digitalpots,I/O
expanderandmuchmore
Advanced
Functions
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:
• Efficientfunctionimplementationallowcalltreesdeeperthanthe
hardwarestack
• Automaticlinkinghandlesmultiplecodepages
• Assemblycodemaybeinsertedanywhereinthesourceandmay
referenceCvariables
• FunctionOverloadingallowsforseveralfunctionswiththesame
name,butdifferencesinnumberandtypeofparameters
• DefaultParameterscanbeusedinafunctionifargumentsarenot
usedinacall
• InterruptfunctionssupportedonPCM/PCH.Thecompilergenerates
allstartupandcleanupcodeaswellasidentifyingthecorrect
functiontobecalled
• Referenceparametersmaybeusedtoimprovecodereadabilityand
inlinefunctionefficiency
• GenerationOfMultipleHEXFilesForChipsWithExternalMemory
• VariableNumberOfParametersinafunction
• RelocatableObjects/MultipleCompilationUnit(IDEOnly)
• Automatic#fusesConfiguration
Features
The compiler is comprised with Standard C operators and built-in libraries that are
specific to PIC ® MCU registers, and access to hardware features from C.
PIC10 / PIC12 / PIC14 / PIC16 / PIC18
1, 8, 16, 32-bit integer types & 32-bit floating point
Bit Arrays and Fixed Point Decimals
#BIT and #BYTE will allow C variables to be
placed at absolute addresses to map registers
to C variables
Standard one-bit type (Short Int) permits the
compiler to generate very efficient Bit-oriented code
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
Advanced Features in PIC24 & dsPIC
®
DSCs
Also 48 & 64-bit floating point make calculations
requiring greater precision or broader range easier
#BIT, #BYTE and #WORD will allow C variables
to be placed at absolute addresses to map registers
Constants in ROM
Enhanced oscillator control to choose from
a multitude of clock sources, PLL and power
saving options
Function recursion allows for interactive
processing algorithms