Download CC5X User`s guide

Transcript
CC5X C Compiler
B Knudsen Data
CONTENTS
1 INTRODUCTION ..................................................................................................................................8
1.1 SUPPORTED DEVICES ..........................................................................................................................9
1.2 INSTALLATION AND SYSTEM REQUIREMENTS ....................................................................................9
Support for long file names ..................................................................................................................9
User interface .......................................................................................................................................9
1.3 MPLAB SUPPORT ............................................................................................................................10
1.4 SUMMARY OF DELIVERED FILES ......................................................................................................10
1.5 SHORT PROGRAM EXAMPLE .............................................................................................................11
1.6 DEFINING THE PICMICRO DEVICE ....................................................................................................12
1.7 WHAT TO DO NEXT ...........................................................................................................................13
2 VARIABLES.........................................................................................................................................14
2.1 INFORMATION ON RAM ALLOCATION ..............................................................................................14
2.2 DEFINING VARIABLES ......................................................................................................................15
Integer variables.................................................................................................................................15
Floating point .....................................................................................................................................16
IEEE754 interoperability ...................................................................................................................16
Fixed point variables..........................................................................................................................17
Assigning variables to RAM addresses...............................................................................................19
Supported type modifiers....................................................................................................................20
Local variables ...................................................................................................................................21
Temporary variables ..........................................................................................................................22
Arrays, structures and unions.............................................................................................................22
Large arrays on the Enhanced 14 bit core .........................................................................................23
Bitfields...............................................................................................................................................23
Typedef ...............................................................................................................................................23
2.3 USING RAM BANKS.........................................................................................................................23
The bank type modifier .......................................................................................................................24
RAM bank selection bits .....................................................................................................................25
Manual bank bit update regions.........................................................................................................25
2.4 POINTERS .........................................................................................................................................25
Pointer models....................................................................................................................................26
The 12 bit Core...................................................................................................................................26
The 14 bit core: the IRP bit ................................................................................................................28
2.5 CONST DATA SUPPORT.....................................................................................................................29
Storing 14 bit data ..............................................................................................................................29
Data of size 16 bit or more .................................................................................................................30
Code pages .........................................................................................................................................30
Merging data ......................................................................................................................................30
Examples ............................................................................................................................................31
3 SYNTAX................................................................................................................................................32
3.1 STATEMENTS ....................................................................................................................................32
if statement .........................................................................................................................................32
while statement ...................................................................................................................................32
for statement .......................................................................................................................................32
do statement........................................................................................................................................33
switch statement..................................................................................................................................33
break statement...................................................................................................................................33
continue statement..............................................................................................................................34
return statement..................................................................................................................................34
goto statement.....................................................................................................................................34
3