Next:
Contents
Contents
cpik
C compiler for PIC
-18 devices
Version 0.7.4,
Alain Gibaud
alain.gibaud@free.fr
(Documentation: rev C)
Contents
Introduction
What is new in version 0.7.4 ?
What is new in version 0.7.3 ?
What is new in version 0.7.2 ?
What is new in version 0.7.1 ?
What is new in version 0.6.0 ?
The «philosophy» behind
cpik
A very special feature
Installation of
cpik
Manual build
Build using qmake
cpik
under Windows
Command syntax
Compilation
Link
Final assembly and jump optimizer
Pragmas
#pragma processor device_name
#pragma _CONFIGxy value
(Deprecated, but still supported)
#pragma config keyword=symbol,keyword=symbol,..
#pragma _IDLOCx value
#pragma saved_regs register,register,register, ..
#pragma fast_stack flag
#pragma noreturn
Support of C language on PIC-18 architecture
Stacks
Memory layout
Register usage
Computation model
Function calling conventions
Stack frame allocation and interrupts
Optimizations
Data in ROM
Creating a block of data in ROM
Passing immediate ROM data to a subroutine
Passing ROM data to a subroutine with a pointer to ROM
Accessing data in ROM with a ROM accessor
Features
Preprocessor
Data types
Numeric data types
ANSI types
void
type
Pointers
Type safety
Cast and type promotion
const
qualifier
Data structuration
Array
Struct and Union
Symbolic constants
Storage classes
Static data initialization
Non static data initialization
Scope control
Address allocation
Instructions
Operators
Extensions
Binary constants
Digit separator
Assembler code
Numeric constants in ROM (
__data8__
,
__data16__
, etc.)
Interrupt service routines
Why and how to write interruptible code
Disabling and enabling interrupts
Explicit bit fields
Hints and tips
Access to 16 bit SFR
Access to 16 bit SFR - second part of the story
How to initialize EEPROM data
Use
struct
to increase modularity
Do not use uppercase only symbols
How to write efficent code
Headers
device/p18xxxxx.h
sys/types.h
macro.h
pin.h
stdarg.h
float.h
assert.h
Libraries
standard IO library
IO redirection
output functions
Conversion specifiers supported by the
printf()
family
input
Conversion specifiers supported by the
scanf()
family
Standard math library
Trigonometric functions
Hyperbolic functions
Exponential, logarithmic and power functions
Nearest integer, absolute value, and remainder functions
Standard string library
sort library
Standard stdlib library
System
Character processing
Conversions to/from strings
rs232
LCD
AD conversion
EEPROM read/write
Timer 0
Source library structure
Needed software
Contributors
Credits
How to contribute to the
cpik
project ?
Feedbacks and suggestions
Bug reports
Documentation
Libraries
inc2h-v3
What is
inc2h-v3
?
How to build
inc2h-v3
?
Command summary
About this document ...
Alain Gibaud 2015-07-09