tutorialDec0604.pdf
(
2995 KB
)
Pobierz
Programming a PIC
Microcontroller
A Short Tutorial
by Yesu Thommandru
Iowa State University – ECpE
November 2006
Programming a PIC Microcontroller
Page ii of 24
Table of Contents
Table of Contents .......................................................................................................................... ii
Revision Record ........................................................................................................................... iii
1.
Introduction..............................................................................................................................1
1.1
Purpose.........................................................................................................................................1
1.2
Document Conventions................................................................................................................1
1.3
Intended Audience and Reading Suggestions..............................................................................1
1.4
References....................................................................................................................................2
2.
Choosing a PIC Microcontroller ............................................................................................3
2.1
Introduction..................................................................................................................................3
2.2
Types of PICs...............................................................................................................................3
3.
Integrated Development Environment...................................................................................4
4.
Programming Language..........................................................................................................4
5.
Compiler, Assembler, and Linker ..........................................................................................6
6.
Using MPLab IDE....................................................................................................................7
7.
Writing Software....................................................................................................................11
8.
The “Burning” Process..........................................................................................................12
9.
Breadboarding a PIC Microcontroller ................................................................................18
10.
Other Considerations.............................................................................................................21
Programming a PIC Microcontroller
Page iii of 24
Revision Record
Name
Date
Reason For Changes
Version
Yesu Thommandru
11/17/06
Started tutorial
1.0
Yesu Thommandru
11/18/06
Finished majority of tutorial
1.1
Yesu Thommandru
11/19/06
Added breadboard images, finished and posted
tutorial on Dec06-04 website.
1.2
Programming a PIC Microcontroller
Page 1 of 24
1.
Introduction
1.1
Purpose
The purpose of this document is to provide a simple, easy to use tutorial on programming PIC
microcontrollers. The tutorial begins with instructions on selecting a specific PIC and ends with
directions for breadboarding the microcontroller.
1.2
Document Conventions
In this document different styles of text and visuals are used to help the reader separate different
types of information. General description text will be in this format, size 11 italicized Arial.
Pseudo-code or source code will be written in multi-color, size 10 Courier New font as in the
following example:
#include
<stdio.h>
void
main(
int
argc,
char
*argv[])
{
printf(
"Star Wars!\n”);
return
;
}
Buttons and menu items will be in standard Arial text such as
B
utton
with the first letter underlined.
Important notes and pieces of information will appear in normal text in shaded boxes as in the
following example:
NOTE: I think Darth Vader would win in a fight against Boba Fett!
1.3
Intended Audience and Reading Suggestions
The intended audience of this document is students in the Department of Electrical and Computer
Engineering enrolled in EE/CprE 491 or 492 Senior Design. This document can also be used by
any student or individual who wishes to learn the basics of how to program a PIC microcontroller.
There are a number of suggested readings for any users of this document. The following books
are suggested for specific PIC programming tasks:
Introduction to microelectronic systems: the PIC 16F84 microcontroller by Martin Bates.
PIC microcontroller: an intro to software and hardware interfacing by Han-Way Huang.
The PIC microcontroller: your personal introductory course by John Morton.
PIC microcontroller project book by John Lovine.
Programming and customizing the PIC microcontroller by Myke Predko.
The quintessential PIC microcontroller by Sid Katzen.
NOTE: In my experience most of software in these books is written in Assembly and are thus not
useful to students wishing to program in a high-level programming language.
Programming a PIC Microcontroller
Page 2 of 24
1.4
References
Schildt, Herbert.
C/C++ Programmer’s Reference 2nd Edition
. McGraw-Hill Publishing. New
York, 2000.
Morton, John.
PIC Your Personal Introductory Course
. Newnes. Boston, 1998.
Bergquist, Carl.
Guide to PICMICRO Microcontrollers
. Sams Technical Publications. Indianapolis,
2001.
Predko, Myke.
Handbook of Microcontrollers
. McGraw-Hill Publishing. New York, 1999.
Predko, Myke.
PICMicro Microcontroller Pocket Reference
. McGraw-Hill. New York. 2000.
Smith, D.W.
PIC in Practice
. Newnes. Oxford. 2002.
Microchip.com. PIC16F877A. 2006. <http://www.microchip.com/>
MicrochipC.com PICMicros and C <http://www.microchipc.com/>
Best Microcontroller Projects <http://www.best-microcontroller-projects.com/index.html>
Plik z chomika:
Satoremihi7
Inne pliki z tego folderu:
bonk-0.6.tar.gz
(17 KB)
tera.7z
(2607 KB)
xvidcore-1.3.3.tar.gz
(799 KB)
last_x264.tar.bz2
(636 KB)
multicoreware-x265-e6b519dfbf81.zip
(890 KB)
Inne foldery tego chomika:
Pliki dostępne do 01.06.2025
Pliki dostępne do 16.11.2022
Pliki dostępne do 19.01.2025
Pliki dostępne do 19.04.2020
;)
Zgłoś jeśli
naruszono regulamin