Getting Started with the PICmicro
Origin of the PIC
PIC stands for Programmable Interface Controller and was originally designed in 1978
with an NMOS (power hungry) process by General Instruments as a device to ‘mop up’
external functions for their larger 16 bit microprocessors. A venture capital group bought
the rights and Microchip Technology was formed in 1989. The product was converted
into CMOS, development tools produced and the product released onto the open
ket as the first OTP production device. The story from then is reflected by the
success of the PICmicro as one of the leading 8
bit microcontroller’s and the range of
products being designed and manufactured.
The uses of the PIC are extensive but as
TV/VCR equipment, Stereo receiver, CD player, Remote controls, Cable
TV converter, Video games, Camera, Garage opener, Microwave oven, Washer/dryer,
Kitchen appliances, Cordless tools, Vacuum cleaner, Electric blanket
Auto security system, Keyless entry, Radar detector, Cruise control, Anti
lock braking, Speedometer, Climate control, Turn signals, Active suspension, Fuel
pump control, Fuel injection, Sun roof control, Air bag sensor, Power seats, Emission
Computer mouse, Laptop trackball, Computer keyboard, Handheld
scanner, Laser printer interface board, PC LAN system, X/Y plotter, Copier, Bar code
reader, Disk drive, Tape back
up unit, Serial bus, Facsimile machine
ne, Cordless telephone, Feature phone, Answering machine,
Pay phone, Pager, Modem, Credit card verification
Motor control, Compressor, Thermostat, Security system, Postage meter,
Utility meter, Robotics, Process control, Gas pump, Smoke detec
tor, Carbon Monoxide
detector, Electronic highway
Advantages of the PIC over other microcontroller’s
Low cost and easy to use development tools
Extensive range of application notes & code examples
No mask charge unless the user moves to a ROM based produ
Inventory kept to a minimum
the same product could be used for a wide variety of
Better security than competitors devices
Lower operating frequency (to produce same code speed) resulting in lower emitted
Microchips position in the Microcontroller market
Die size comparison of some 8 bit microcontrollers
See Microchip’s databook, product selection guide or Web page
for full range and availability
16C52, 54, 55,
56, 57, 58
devices aimed at the low cost end of the market
16C710, 711, 715, 73, 74
the 7xx range have a/d capability
16C63, 64, 65
similar to above but without the a/d
EEPROM memory for program and non volatile data area
16C621, 622, 623
brown out (power dip) detect + comparator’s + d/a
pin version of 16C5x series aimed at compact low I/O products
pin PICmicro with A/D and EE memory
built LCD driver
comparable performance with 68HC11
flash memory based PICmicro
latest technology PICmicro’s for high end applications
What do I need to start development ?
The minimum items required to start PIC development work are :
An IBM compatible PC
A data sheet on the chosen PIC
A Beginners Guide to the Microchip PIC
free from the Microchip web site
If you then wish to take the development from paper to a hardware design, you will need:
and support get the PICSTART Plus, which covers all the
A development board or hardware starter kit
to save time trying to debug software and
Some EPROM (windowed) versions of the PICmicro’s to be used
say 3 to 5 to save
time when t
hey are being erased.
An EPROM eraser.
If developing with the 16F84 (EEPROM) or flash PICmicro’s, you don't need an eraser
as the device is electrically erasable
i.e. no window.
Assembler and Simulator foc from Microc
hip Web Site
Programmer + MPLAB (assembler, simulator, editor) +
PIC sample. No trace or emulation function
ideal for development with 16F87x devices
ICE PIC In
allows debugging of hardware and software
at same time. You need a programmer to go with the ICE
for part numbers
again see catalogue or Microchip product list for
description and order codes.
See Bluebird Electronics website for current range
8/18 pin PICmicro
Hardware Starter Kit
PCB, 8 leds, regulator, 4MHz crystal,
16C55/57 Hardware Starter Kit
PCB, 8 leds, regulator, 4MHz crystal, reset
Project Board 1 (18 pin PIC's)
PCB, leds, regulator, push buttons, speaker,
thermistor, dip switch, PP3 battery holder, 4MHz crystal, reset switch
kit for students or engineers.
16C64/74 Hardware Starter Kit
PCB, leds, regulator, push
interface, EEPROM socket, 200 hole patch area, PIC Soft disk.
A pin conversion adapter to allow 16C63/73 devices (28 pin) to be
used with the above 16C64/74 Hardware Starter Kit.
Project board software source c
ode, application source code from
Microchip Embedded Control Handbook plus MPLAB
PIC in a Box
A complete starter kit for those intending to work with the PIC. PIC in
a Box comprises PICSTART Plus, Beginners Guide to the PIC, PIC Cookbook Vol
Board, PIC Soft with additional projects aimed at the absolute beginner
and starter guidance notes.
Pointers to get started
Start off with a simple program
don’t try to debug 2000 lines of code in one go.
Use known working hardware
kits for example
for the initial
design phase to save debug time.
Have a few windowed PIC’s to hand when developing to save time waiting for
If using the PIC Start (programmer only) you will need to use the program
w extra development time.
An ICE will speed up development and save the company money
if an engineer
costs his company £200 per day, 3 days wasted trying to sort out a bug without an
ICE, and the ICE would have paid for itself, and met a deadline!
me form of I/O map when starting your design to speed up port identification
Draw a software functional block diagram to enable modular code writing
Comment the software as it’s written. It is meaningless the following day or if read by
Write, test and debug each module stage by stage
Update documentation at the end of the process
How do I program a PIC ?
Run MPLAB software on the PC
Power up the programmer
Build the project
Set the defaults for product, Watchdog, O
scillator, POR, Brownout and Code
Check you have the correct PIC to program
Check it’s blank
Test in the product
How much will it cost me ?
Microchip CD ROM
A Beginners Guide
to the Microchip PIC
PIC Cookbook Vol 1 and 2
PIC C an introduction to C on the PIC
a few windowed devices
for the finished project
less than 25
ICE PIC in circuit
CCS C Compiler
What about PIC designs for manufacture?
For those embarking on product development with a deadline or a complicated design
for their company, invest in the ICE PIC In Circuit Emulator. It will save
time and money
in product development and, the engineer from loosing their sanity. The ICE enables the
programmer to step through a program, set breakpoints, trace what is happening within
to list a few of the features. The ICE will pay for it
self on the first major project.
What happens when my program won't run?
Check the following:
Has the oscillator configuration been set correctly when you programmed the PIC?
Was the watchdog enabled when not catered for in the software?
Have all the po
rts been initialised correctly.
On 16C7x devices, check if the ADCON1 register is configured as analog or digital.
Ensure the data registers are set to a known condition.
Make sure no duplication of names given to variables, registers and labels.
Is the re
set vector correct, especially if code has been moved from one PIC family to
Refer to the debug flowchart on page 100 of Beginners Guide to the PIC
Microchip Approved Training Workshops
Get your project off to a flying start!
What are Training
PIC Training workshops are designed for those who want to know the practical aspects
of using the PIC in their product design. Small class sizes (up to a maximum of 8
delegates) ensure individual needs are met.
Why a Training Workshop will he
lp your Company
Typically an Engineer will spend a few weeks getting a reasonable understanding of a
new microcontroller. The time spent on this learning curve is costly for the Company and
delays product development. The workshop assists in getting the
Engineer over the
initial hurdle in a fraction of the time normally taken with the guidance of a Microchip
In just one day you'll learn...
How the PIC operates
internal and external needs
the ins and outs
flowcharts, code writing, assembler directives
with and without an ICE
hands on use of ICE PIC and PICSTART PLUS
The EMC directive
software techniques to assist in product reliability
How is the day org
The workshop is in two parts. The morning is spent working through the theoretical
aspects of the PIC and product development. Following lunch, the afternoon is allocated
to work on customer specific projects. Delegates are encouraged to bring
hardware from their intended project to help get the project started. Some equipment is
provided for project construction, debugging and programming including ICE PIC and
PICSTART PLUS development tools for hands on experience.
What does eac
h delegate receive?
Each delegate will receive a copy of “The Beginners Guide to the Microchip PIC”, 'PIC
Cookbook', a PIC Project Board to continue the learning process together with any
software developed during the day and some goodies.
Where are th
e Training Workshops held?
Workshops are held at Urchfont Manor, Wiltshire, where the isolation from on
interruptions results in a truly intensive training session.
When are the Training Workshops held?
Workshops are held on a mutually agreed dat
e giving flexibility in arranging training
around staffing levels and project deadlines.
How much does a Training Workshop cost?
electronics.co.uk for information.
What about large organisations?
For larger companies, the Corporat
e workshop is intended for engineers involved in PIC
based projects to work to a common set of standards. It can also form part of an
ongoing training package for new members to the engineering department or existing
engineers needing an understanding of
the products being used by their team. Course
content and duration is completely flexible, please call us to discuss your needs.
What about large projects
If you need to get a large project under way or a number of smaller ones, an extended
course is av
ailable, covering 2, 3 or 4 days. These extended workshops have proved to
be successful for clients needing more than a jump start.
CAA, British Gas, Scottish Nuclear, Trinity House, Scottish Constabulary, AC Deco, MK
, IMI Pactrol, Unitek, Cranfield Institute, Loughborough College,
Lancing Linde and Army
Technical Support to list a few.
Booking a Training Workshop
To book or discuss your training requirements, phone Nigel or June on 01 380 827080.
Microchip Registered Consultant and Trainer
01 380 827080
01 380 827082