PICList: Subscribe to the PICList
http://www.piclist.com. Don't post, just read for a while.
PIC: Select a chip and
The simplest chip to program, find code for, learn on is the
More bang for the buck is the
16F877 and it is mostly code
compatible with the 'F84.
The most bang for the buck is the 18F series chips and they have many new
and advanced features.
Static - don't touch the pins without grounding yourself.
Programmer Find a programmer
that supports your chip.
(The exhaustive list of all known programmers is at
DO NOT ENABLE CODE PROTECTION! No, it can't be undone. You will have
to replace the chip. Read the documentation on your programmer to figure
out how to avoid this.
http://www.microchip.com find, download
and read the datasheet for your chip from cover to cover. Read Jim's
introduction to the PIC, the
PIC FAQ and ask questions on the
PICList if you don't understand something. If your
brain is completely fried at this point, don't worry, lots of top-notch engineers
have been also. Here are some other ideas:
Intros and Tutorials,
Understanding & Programming the
PIC16C84 by Jim Browns (also at:
the classic intro to the classic PIC16C84. The chip is still available as
the 16F84A and the tutorial is still quite valid although it refers to figures
in an older version of the Microchip datasheets cached here:
CHEAPIC by Stan Ockers [ockers at
anl.gov] getting started and some nice projects.
The PIC Source
Book explains PIC programming in terms of the
A Beginner's simple Bike Computer
project by Fred Maher includes PIC programming, making PCB's circuit
http://www.voti.nl/swp/index_1.html Starting with
PICmicro controllers (C) 2002 Wouter van Ooijen
"PIC Elmer 160 Course Lessons" by John McDonough, WB8RCR
is a *very* detailed "click
here, press that button" introduction. Gives step-by-step instructions, with
screenshots, for downloading and using MPLAB, programming the PIC, single-step
debugging, I/O, and subroutines.
A nice startup page with a (frighteningly) simple programer, DOS software
and a sample program
Brian Kellys brief introduction
is a good downloadable beginners' tutorial that is PIC
C language specific. As a C newcomer
I found this one the most user-friendly and encouraging source.
If you can get past the poor English, this is a nice site. Does anybody have
the time or desire to help him out with his English translations?
Books: there are a lot of good
books about the PIC
Courses: some universities offer courses in embedded design.
Language: Select a development
language. Many years ago everyone used assembly language because there
was no alternative. A few years ago many people used assembly language because
the alternatives were expensive. Now there are lots of alternatives, many
of them free. See development
Start with very simple code like a LED coming on when a switch is
pressed, and build from this once it is working.
Don't Float: Tie the switch
pin Hi or Lo with a ~10K resistor or use internal pullups to avoid
floating inputs when the switch is open. In general,
do something with unused pins don't just
leave them floating
TRIS - make sure they are set
properly for in/out pins.
Debounce the switches to avoid false switch states.
RA4 on a 16F84 is "open collector" - it can pull to ground but will
not pull up to Vcc. You can still use it to drive LEDs by hanging
the LED & resistor between RA4 and +5V supply. (anode to +5V) This means
that the logic is now inverted; 1 = off and 0 = on
Diasble WDT if not needed
Check MCLR is connected to Vcc
Connect ALL Vcc and Vdd pins. Not just one of
Make sure Osc fuses are set for your type
of oscillator, crystal (XT), RC (RC),
resonator (HS). etc
Sample code for most common applications (including serial io, LCD
interfaceing, keyboards, the internet, etc...) are available at the
When your code doesn't work:
Set the entire program aside, find a way to seperate just a small, but functional
part of it and get that part working. Then, slowly add in the rest of the
code from the original program, testing and debugging each addition, untill
you have the entire program working
Comment each and every line of the code with what you think it is doing,
and then check the datasheet against your comments.
Post the commented code to the piclist with a subject line of "[PIC]: What
am I missing in this code?"
For good ideas on second and third projects, see:
http://www.piclist.com/projects. Good starting
projects with lasting value.
Still not getting anything to work? Try
If you are going to do this for a living, see the
begining engineers checklist
spamvisn@spam@ at wbs.co.za
Nearly the end of 2007 and I want to get back into PICS
16F628 @ 1 , 16F88 @ 1.9(*price of 628) 16F873 @ 2.1 , 16F877 @ 2.9 and the
USB 18F4550 @ 3x.
Is the 628 still a drop in for the 84, or is the 88 a better bet to invest
18F4550 is tempting, but I can't choose between that , the 877 , and the
AVR MEGA8-16 @ 0.8 (price of 628).
And my f84 programmer was dos based and is in pieces.
I want to know , though, the best drop in for the F84- F628?-or F88?
Newton replies: I think it's a toss up and depends more on what sort
of development you want to do in the future. If USB is important, go with
that, and so on.+
spamtommowas@spam@ at hotmail.com - hi ppl.
i have a problem with understanding the goto command.. i have encountered
source code which goes to a subroutine and then that subroutine has a 'return'
or 'retlw' in it. does goto work the same way as call? could someone please
explain its difference. regards. sorry about the double post.
Newton replies: See the
instruction list section of the
datasheet for the processor you are using for the exact action of the goto,
call, return, and retlw commands.+
spammadyg@spam@ at excite.com
asks: " the Pic can see a "1" or a "0" however
how can a Pic "see" the middle position of a 3 state dip sw?"
Newton replies: Assuming there is a 1k resistor between the switch
and the pin, set the pin as an output, pull it low then immediatly switch
back to an input and read the value. If it stayed low, repeat the process
but pull it high instead. If it stays where you put it, the switch is in
This is making use of the pins own internal capacitance and would be more
reliable with a small cap between the pin and ground. At that point you basically
have an RC circuit such as is used in a sigma-delta A to D converter or the
POT command used in the BASIC STAMP.+
van Dam Says:
Has lot's of information including a 'Getting started'and 'Tutorial' section
for beginners using JAL as PIC language. Also contains may pages for intermediate
| ||©2016 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?|
<A HREF="http://techref.massmind.org/techref/piclist/begin.htm"> Easy PIC'n,Beginner Microchip, Getting started PIC, PIC Microcontroller</A>
Welcome to techref.massmind.org!