Sie sind auf Seite 1von 9

Bryan Armando Valenzuela 10/08/2015

CCS
COMPILER
MANUAL

INTRODUCTION:
1

Bryan Armando Valenzuela 10/08/2015

Si Queremos Realizar la programacin de los


microcontroladores PIC En un lenguaje Como el C, Preciso
es utilizar ONU compilador de C.
DICHO compilador nos gneros Ficheros en formato Intel hexadedimal , Qu es el necessary prrafo Programar
( utilizando la ONU programador de PIC ) de la ONU
microcontrolador de 6 , 8 , 18 40 patillas.
El compilador de C Que vamos a utilizar es el PCW de la
casa CCS Inc. A su Vez , el compilador Lo integraremos En
un entorno de Desarrollo Integrado ( IDE ) Que Nos va a
permitir desarrollar Todas y Cada Una de las fases Que se
Compone ONU Proyecto , desde la edicin la del hasta
compilacin Pasando por la depuracin de Errores . La
ltima fase , una Excepcin de la DEPURACION Y los finales
de hardware Retoques , Programar Ser el PIC.
Like the Turbo C compiler , it " translates " the C source
code file ( C) to
machine language for PIC microcontrollers , generating a
file format
hexadecimal ( HEX ) . Besides this , also it generates
another six files as shown in the figure on the next page.
Finally, I say that this time I present the notes in support
electronic, unlike previous occasions were in print. Is a new
experience and as foolproof has its risks, but I hope and
wish that, Either way achieves ignite the flame of illusion, or
at least arouse interest in the study of electronics and in
particular of this unfinished world of programming in C and
microcontrollers.

Bryan Armando Valenzuela 10/08/2015

Utilities:
SIO
SIO (Serial Input Output) is a simple program " dumb
terminal " that can run from the DOS for input and output
over a serial port. WIS helpful as it shows all incoming
characters, except that non-printable will display its
hexadecimal code red.

PICCHIPS
That is a utility PICCHIPS reads the database of a device . I
have
esta compiler use database to determine the specific
Characteristics of
During compilation device . When you run the program
without any parameters , it will list all devices ( PIC )
available. If you specify a device as
eg PIC16C84 parameter , ie, write picchips PIC16C84 , we
Obtain Detailed information on this device . By way of
example and for Said PIC You get the following information:
PIC16C84-------------------------------Opcode:
14 bits, ROM: 1024, RAM: 36, I/O: 13 H/W: EEPROM(64) POR TIM0 TRIS
RAM: 0C-2F Ports: [A:01234---] [B:01234567] [C:--------] [D:--------]
[E:--------] Fuses: LP: 0003/0000 XT: 0003/0001 HS: 0003/0002 RC:
0003/0003 NOWDT: 0004/0000 WDT: 0004/0004 NOPUT: 0008/0000
PUT: 0008/0008 PROTECT: 3FF0/0000 NOPROTECT: 3FF0/3FF0 ID is at
2000 Par Device value: 0084 C Device value: 84, C-Scratch at: 0C

CHIPEDIT
ChipEdit is a Windows utility ( PCW only ) you can edit the
base
a device data . With this utility you can add devices ,
change or remove them from the database. To add a device,
select from another list equivalent , similar caracterticas ,
and click the Add button. To edit or delete a device, select it
and click the Edit or Delete button.
CONVERT
3

Bryan Armando Valenzuela 10/08/2015

PConvert is a Windows utility ( PCW only ) that allows


conversions a data type other types . For example , floating
point decimal to 4- byte hexadecimal . The utility opens a
window to perform pequea conversions and can remain
active during a session with PCW or MPLAB .
This can be useful during debugging a program.

operators and expressions

Operators and expressions:


Asigments Operators
Una expresin de asignacin tradicional es de la forma
expr2 expr1 = expr1 operato , that is, i = i + 5. This
expression can represented by another shorter form : expr1
= expr2 operator Continuing with the same example i + =
5.
It is in complex expressions , not as simple as the example,
where you can appreciate the convenience of using this
notation . The following table summarizes the compound
assignment operators and their meaning.

arithmetic operators
Arithmetic operators are used to perform mathematical
operations. Listed in the following table:

Bryan Armando Valenzuela 10/08/2015

Relational operators
Its mission is to compare two operands and an integer
result : 1 (true ) ; 0 (false ) . The following table illustrates
these operators:

Logic Operators
Like the relational operators , they return 1 (true ) , 0
(false ) after evaluation of its operands. The following table
illustrates these operators.

Bitwise operators
These operators allow you to act on the operands bitwise
and can only be
integer (including char ) . They are as follows:

Increment and decrement operators


Although these operators are part of the group assignment
operators , I
5

Bryan Armando Valenzuela 10/08/2015

preferred to separate in the interests of greater clarity.


Their behavior resembles incf increase instructions f , d
assembler PIC 16X84 or controlador Variable Intel 8051 inc
.

Bit shift operators


The shift operators give the C controllability at low level
similar to assembly language. These operators use two
integer operands (type
int): the first is the element to move and the second , the
number of positions moving bits . Are summarized in the
following table:

Operators direction ( & ) and indirection (* )

Operators direction ( & ) and indirection


The & and * are used to working with pointers (see item 11)
. He
C language is very influenced by the use of pointers. A
pointer is a variable
containing the address of a variable or a function , ie it is a
variable pointing to another variable. Pointers allow indirect
manipulation of data and codes . We have two operators;
see the following table:

The address operator & gives us the memory address of its


operand . He
result is a pointer to the object , that is, to a data type . For
example , if we
the pointer p stored in the memory address of the integer
variable counter, We must do the following:
6

Bryan Armando Valenzuela 10/08/2015

p = & counter ; / * P points to the address counter * /


The indirection operator * gives the value or content of the
variable whose address It is pointed to by the pointe.
p = & counter ; / * P points to the address counter * /
a = * p ; / * Stored in a content of var. pointed to by P * /

Expressions

Bryan Armando Valenzuela 10/08/2015

Processor directives:
All preprocessor directives begin with the # character
followed by a
specific command. Some of these directives are extensions
of the standard C. the C It provides a preprocessor directive
that compilers accept , and It lets ignore or act on the
following data . Our compiler supports any pre - processor
directive that begins with PRAGMA, which ensures
compatibility with other compilers.
Example:
#INLINE / * These two lines are valid * /
#PRAGMA INLINE
8

Bryan Armando Valenzuela 10/08/2015

Das könnte Ihnen auch gefallen