SW006011 Microchip Technology, SW006011 Datasheet - Page 24

C COMPILER FOR 18XXXXX FAMILY

SW006011

Manufacturer Part Number
SW006011
Description
C COMPILER FOR 18XXXXX FAMILY
Manufacturer
Microchip Technology
Type
MPLAB® PIC18 C Compilerr
Datasheets

Specifications of SW006011

Tool Function
Compiler
Tool Type
Compiler
Processor Series
PIC18
Core Architecture
PIC
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
PIC18 Series
Lead Free Status / Rohs Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
SW006011
Manufacturer:
Microchip Technology
Quantity:
135
MPLAB
3.3
apRNOVR^-page 20
EXAMPLE 1
C18 C Compiler Getting Started
This example is designed for use with the MPLAB IDE v6.xx, the MPLAB SIM simulator
and the PIC18F452 device.It shows how to set up an MPLAB C18 project in the MPLAB
IDE, build the project and step through the source code using the MPLAB SIM
simulator. Additionally, running the program using the MPLAB ICD 2 with the
PICDEM 2 Plus demo board is demonstrated. The example assumes that the directory
c:\mcc18 is the MPLAB C18 installation directory.
Here is the source code for the example.
#include <p18cxxx.h>
int counter;
void main (void)
{
}
TRISB and PORTB are special function registers on the PIC18F452 device. The
PORTB pins are connected to the LEDs on the PICDEM 2 demo board; the TRISB pins
configure the PORTB pins for input (1) or output (0).
3.3.1
Select Project>New to create a new project. Then enter the name and directory of the
project in the dialog that displays and click OK.
If you installed the examples with MPLAB C18, then the example\
getting_started\example1 subdirectory of the MPLAB C18 installation will
already contain the source file for this example.
Note: The project name does not have to be the same as the directory name.
counter = 1;
TRISB = 0;
while (counter <= 15)
{
}
PORTB = counter;
counter++;
Setting Up the Project
/* for TRISB and PORTB
/* configure PORTB for output */
/* display value of 'counter'
declarations */
on the LEDs */
2002 Microchip Technology Inc.

Related parts for SW006011