Difference between revisions of "Compiling PIC projects"
(→C compiler) |
|||
(6 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
*[http://www.bknd.com/cc5x/index.shtml CC5X] | *[http://www.bknd.com/cc5x/index.shtml CC5X] | ||
+ | |||
+ | You can also download from: | ||
+ | |||
+ | *[http://www.linksprite.com/pub/wiki/Component_breakout/SerLCD/cc5xfree.zip CC5X] | ||
[[File:Cc5x.JPG]] | [[File:Cc5x.JPG]] | ||
+ | |||
+ | ==C compiler handbook== | ||
+ | |||
+ | *[http://www.linksprite.com/pub/wiki/Component_breakout/SerLCD/cc5x-33.pdf CC5X handbook] | ||
+ | |||
+ | |||
+ | ==Pic Kit 3== | ||
+ | |||
+ | You can download the PITkit3 programmer software from [http://www.linksprite.com/pub/wiki/Component_breakout/SerLCD/PICkit3_1.0.0.0SetupA.exe] | ||
+ | |||
+ | [[File:Pickit3.JPG | 500px]] | ||
+ | |||
+ | |||
+ | ==Notes== | ||
+ | |||
+ | The position and size of the supported config identifiers should be | ||
+ | defined. This enables the identifiers to be used in #pragma config | ||
+ | statements in an application. | ||
+ | |||
+ | #pragma config_def [=] value | ||
+ | |||
+ | value: | ||
+ | 0x0001: FOSC in bit 0,1 : 0 - 3, LP, XT, HS, RC | ||
+ | 0x0002: FOSC in bit 0,1,2 : 0 - 7, LP, XT, HS | ||
+ | 0x0004: FOSC in bit 0 : 0, 1 | ||
+ | 0x0008: FOSC in bit 0,1,4 : 0 - 7, LP, XT, HS | ||
+ | |||
+ | 0x0010: WDTE in bit 2: off (0), on (1) | ||
+ | 0x0020: WDTE in bit 3: off (0), on (1) | ||
+ | |||
+ | 0x0100: PWRTE in bit 3 (inverted): on (0), off (1) | ||
+ | 0x0200: PWRTE in bit 4 (inverted): on (0), off (1) | ||
+ | 0x0400: PWRTE in bit 3 (not inverted): off (0), on (1) | ||
+ | |||
+ | 0x1000: BODEN in bit 6 : off (0), on (1) | ||
+ | |||
+ | |||
+ | Example: #pragma config_def 0x1111 // 0x0001 | 0x0010 | 0x0100 | 0x1000 | ||
+ | |||
+ | FOSC in position 0,1 | ||
+ | WDTE in position 2 | ||
+ | PWRTE in position 3 (0=on) | ||
+ | BODEN in position 6 | ||
+ | |||
+ | NOTE: THIS PRAGMA IS NORMALLY FOUND IN THE CHIP HEADER FILE AND | ||
+ | SHOULD NOT BE USED IN THE APPLICATION SOURCE CODE. |
Latest revision as of 09:00, 9 December 2012
C compiler
The most popular free C compiler for PIC project is cc5xfree. You can download from:
You can also download from:
C compiler handbook
Pic Kit 3
You can download the PITkit3 programmer software from [1]
Notes
The position and size of the supported config identifiers should be defined. This enables the identifiers to be used in #pragma config statements in an application.
#pragma config_def [=] value
value: 0x0001: FOSC in bit 0,1 : 0 - 3, LP, XT, HS, RC 0x0002: FOSC in bit 0,1,2 : 0 - 7, LP, XT, HS 0x0004: FOSC in bit 0 : 0, 1 0x0008: FOSC in bit 0,1,4 : 0 - 7, LP, XT, HS
0x0010: WDTE in bit 2: off (0), on (1) 0x0020: WDTE in bit 3: off (0), on (1)
0x0100: PWRTE in bit 3 (inverted): on (0), off (1) 0x0200: PWRTE in bit 4 (inverted): on (0), off (1) 0x0400: PWRTE in bit 3 (not inverted): off (0), on (1)
0x1000: BODEN in bit 6 : off (0), on (1)
Example: #pragma config_def 0x1111 // 0x0001 | 0x0010 | 0x0100 | 0x1000
FOSC in position 0,1 WDTE in position 2 PWRTE in position 3 (0=on) BODEN in position 6
NOTE: THIS PRAGMA IS NORMALLY FOUND IN THE CHIP HEADER FILE AND
SHOULD NOT BE USED IN THE APPLICATION SOURCE CODE.