Difference between revisions of "PIC Microcontrollers with C18 Compiler"

From Mech
Jump to navigationJump to search
Line 37: Line 37:


===PIC18F4431===
===PIC18F4431===
[[media:PIC18F4431_datasheet.pdf | PIC18F4431 Datasheet]]
[[:media:PIC18F4431_datasheet.pdf | PIC18F4431 Datasheet]]


[[media:PIC18F4431_errata.pdf | PIC18F4431 Errata]]
[[media:PIC18F4431_errata.pdf | PIC18F4431 Errata]]

Revision as of 19:19, 8 September 2007

PIC Microcontroller

The microcontroller used for this tutorial is the PIC18F4431 made by Microchip. This is an 8-bit microcontroller with motor PWM generators, a quadrature encoder interface (QEI), and other "peripherals".

Compiler and IDE

The C18 compiler is a C-language compiler for the Microchip PIC18 family of microcontrollers. The student version of this compiler is available for free at Microchip's website. The difference between the student version and the commercial version is the level of optimization available. For most purposes, the student version should suffice.

Be aware that there are some differences between Microchip's C18 compiler and C compilers for other platforms. For example, an int data type in C18 is 16 bits, instead of the usual 32 bits. Refer to the C18 user guide for more information.

Microchip's IDE, MPLAB, is also available for free at Microchip's website.

Connecting the Programmer

Connecting the ICD2 Programmer

Writing the Code

Writing Code with the C18 Compiler

Example Projects

PIC Analog-Digital-Converter Example

PIC Motor Control and Serial Port Example

Tips

PIC/C18 Compiler Tips and Troubleshooting

Documents

MPLAB and C18 Compiler

MPLAB Quick Start Guide

MPLAB User's Guide

C18 Compiler Getting Started

C18 Compiler User's Guide

C18 Compiler Libraries

PIC18F4431

PIC18F4431 Datasheet

PIC18F4431 Errata

PIC18F4431 Configuration Settings