Instructables
a minimum of what you need to get started programming PIC micros for use in electronics projects (robotics, etc)
 
Remove these adsRemove these ads by Signing Up

Step 1: What you need for the project

NOTE: seems like if you have windows XP, there is no free PIC programmer software that can download code to your PIC throught the serial port. This meens you will have to buy or make a more expensive USB programmer circuit. If you have DOS on windows 95, the stuff below will work.

Look at the list of stuff you need below. Then look at the picture I made below. It has everything on it you need to get started with Pic micros. You can see how to make a simple circuit with the PIC and an LED, you can see code for a simple program, and you can see instructions on how to put the code onto your PIC. Once the code is downloaded onto your PIC, put your PIC back into the LED circuit, give it power, and watch the LED blink, whee!

#################################################################
TO BE ABLE TO READ THE DIAGRAM, CLICK ON THE 'i' IN THE TOP LEFT CORNER OF THE PICTURE, THEN CLICK 'largest' (ON THE LEFT OF THE PAGE), THEN CLICK THE PICTURE.
Also, download the PIC16F877StarterProject.zip It contains a more detailed picture.
#################################################################

==========Stuff used in this project:==========
(I am in no way saying you have to buy the things below, they just happen to be what I used when I started with PICs)

a PIC16F877
This is a PIC microcontroller. It's a mini-computer.
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=74

a PIC-PG2B JDM programmer
This is a circuit board which interfaces your computer to your PIC so you can program it (I bought one off ebay for around $15).
http://www.olimex.com/dev/pic-pg2b.html

PICBasic
This is the compiler used in this demo to (similar to Basic language) program the PIC.
http://www.picbasic.co.uk/
You could also use the -free- PICClite compiler (similar to C language).
http://www.htsoft.com/products/PICClite_comparison.php
You could also use a free assembly language compiler (assembly language is annoying).

IC-Prog
This program allows you to download your code to the PIC.
http://www.ic-prog.com/

USB to Serial Adapter
If you're using windowsXP you'll probably have problems using your serial ports (I did). A USB to serial converter (I have the 'Aten USB to Serial Adapter') may help.

one LED

one 4mhz chrystal oscillator

two 22pf capacitors

one 4.7k resistor

one 470 ohm resistor

one 5v power supply

###########################
Here's a Great PIC Intro Book
###########################

1-40 of 58Next »
Tbus6 months ago

Thank you for the PIC project. I am taking a home-study Into to Microcontrollers course (http://www.ciebookstore.com/intro-to-microcontroll...) and it's nice to know a lot of what I'm learning can be applied here and in other instructable projects!

I need a 5 PICs each that is programmed to give randon ( or psuedo random) movement to 4 small servo's. I am uing to built a turtle prop. I can build electronic circuits and do soldeing, but I do not know PIC programming. Please anyone can program and send me these PIC's together with the schematic to make it work, I will pay for it. and Many thanks for reading.
VIRON8 years ago
This looks interesting...
http://pp06.sourceforge.net/index.html
But windows just keeps getting sicker and less useful.
I'm searching for a technical bootable-linux-CDROM-distro. For free, of course!
leevonk (author)  VIRON7 years ago
puppy linux, look it up. You don't even need a hard drive. Check out the instructions on the website for how to install it etc, it's very very easy but they have great animated instructions. I put it on a cd, rebooted the computer (after changing the bios settings) and it worked beautifully.
Running from a live CD is a lot slower, though, and if you only have 1 CD drive (like me), you can't use CDs or DVDs. I love linux, though.
Puppy Linux boots to ram, so the apps start up lighting fast, and you can take the CD out. Try it, you will be surprised...
Cool, I will definitely try it out!
Let me know how it goes...
I like to use Suse linux with KDE. Its a little harder to get customized but has a lot of power.
omnibot VIRON4 years ago
For Linux there is <a href="http://piklab.sourceforge.net/">PikLab</a>.<br />
Win7Maniac4 years ago
What does the 4MhZ crystal do? Does it set the frequency for the controller? I've seen this used in many platforms, such as Arduino (except 16MhZ), but I don't know what it does.
12V5 years ago
i used a velleman k8048 and it works on xp with out paid software.
dude66574555 years ago
could you buy these at radio shack?
leevonk (author)  dude66574555 years ago
does anyone know about an open source pic programmer that will run on vista? will this one? thanks for the info in advance.
yourcat5 years ago
I think the PICAXE programming software can also do PICs, and that's free.
FlyByPC5 years ago
If you use a newer microcontroller (the direct replacement would be the 16F887), you don't need the resonator unless you want to run at more than 8MHz. A 12F683 is great for small (4-I/O, 1-input) projects. There are several WinXP-compatible PIC programmer applications. If you do go the USB route, spend a little more and get an In-Circuit Debugger; it can work directly with MPLab, and can both program and debug instruction-by-instruction.
Oldrunk5 years ago
There is free windows PIC programmer software called WinPIC for flashing the PIC with just about any programmer and a number of OpenSource compilers for C and Basic that work under windows and can be used with MPLAB IDE
collard416 years ago
its quite funny that you mention the PIC (personal introductory course) book, my friend wrote it.
deviance6 years ago
(removed by author or community request)
I still find this stuff somewhat confusing. After going through a lot of websites I'm going to attempt to make a programmer and buy some chips. Hopefully they're the right ones. While I do appreciate the effort I wish someone would write a Pic Programming Instructable for the complete newb including some exact part numbers of a chip to start with, a step-by-step guide for hookup, writing code, sending code to the chip and then hooking the chip up to a breadboard to test it... and maybe some simple code for an LED flasher with a walkthrough of what the lines of code mean. No I don't want someone writing projects for me as I fully intend on learning assembly language once I get my programmer working but a simple example would be a great start.
emilk deviance6 years ago
http://www.mstracey.btinternet.co.uk/pictutorial/picmain.htm
here is some pic asm tutorials to get you started. if you hawe some other chip then you only hawe to change som file registers according to data sheets.
Not that I like radio shack but they sell a complete pic programming kit with chips etc for about $80, there are also many online sites that do the same. it may help and avoid aggravation.
leevonk (author)  deviance6 years ago
everything you're asking for is on the next page: exact part number of the PIC and the programmer I used hook-up diagram (if you have any knowledge of breadboard this should be very easy to implement) code how to program the PIC via DOS At the time I when I wrote this instructable I didn't know of any easy, standard way to program PICs from a windows environment, I was using DOS, which most people don't have access to anymore. But I recently bought a cheap programmer (PicKit from mplabs) that makes programming PIC easy from windows, I'll add instructions on how to use it. I'll also put assembly code of the blink program on there, although this should be pretty easy to find on the web. assembly is a major major major pain in the ass, it's well worth the money/effort to get PICBasic or another higher level language compiler.
Thanks! Sorry for all the
newb' questions but what can I say, Imanewbie at this stuff =) Appreciate the input and will let ya know how my 'first attempt' goes ;)
This is the programmer I'm going to try building.

http://www.josepino.com/pic_projects/index?aaa-getting-started.jpc
if you look at the first pic you can see the PIC16F877 right on it... that is how you will id chips usually. the reason you may find many variety of chips under the same family is that they come in different packages. this is the same as most ICs... you will usually see them in at least two packages... one is usually a DIP package like pictured above and then there are smaller high density chips that us engineers use for our production. sometimes there are different specs for the different versions as well for example when we design for the military, we use mil spec chips that tolerate more extreme temperatures. there are many different companies that make PIC like chips... another big player are the AVRs. i would browse IC catalogs a bit and pay attention to the packaging and different specs and you will see that there may be up to half dozen different chips that have the same number with a small different character or two at the end like the (A) you found. if you are a beginner, i would recommend you stay with DIP packages but if you download the DataSheets for the chips you will see the different packages available and many even have pictures of the packages but most have the layout. i hope this helps :-) cheers, WL
sorry for the odd question, but is that reprogrammable? i've been so confused by these things lately, some being OTP or one time programmable, and others not. and the difference seems to be weather they have a screen to let UV light in or not. that chip seems to not have that screen, can someone correct me if i'm mistaken?
leevonk (author)  TheMadScientist6 years ago
yeah it's reprogrammable, any of the chips with 'flash' memory (go to microchip.com and look at their PIC lists, for instance the 40 pin 16-bit list: http://www.microchip.com/ParamChartSearch/chart.aspx?branchID=8172&mid=14&lang=en&pageId=75) are reprogramable
ohhhh, I get it... man it sucks to lack buy online capability... i'm trying to get by with chips that have ROM or EEPROM normally, but can access external memory banks...
No need! Most major chip vendors will send you free samples. Try it out! Also, google for LadyAda's website. She has a fabulous guide on getting silicon stuff for free, and a review of most major vendors who give out samples.
green rose7 years ago
hi im new here and im new to picmicro i just wana ask can you introduce me to this technology?we have our research and its about automated chicken feeder where the feeding time is programmed by picmicro pls help me what should i learn first before starting any project?im really at lost and can you help me regarding pic programming?thanks alot
mojomoney7 years ago
Have you ever attempted to run the programming software for Win 95 on an XP machine with the compatability mode set to simulate Win 95? You do so by right clicking on the executable file and opening the properties; inside the compatability tab there is an option to set the compatability mode to: Win 95, Win 98, NT 4.0 and Win 2000. I've had to use this in the past on PC's when XP first came out and few programs were written for it.
leevonk (author)  mojomoney7 years ago
I tried something similar to that, but not that exactly. It's not just a compatibility problem, xp prevents progs from accessing ports for security reasons, so it's actively inhibiting the functionality. Commercial programs can access the ports (obviously), I don't know how though.
if you go to:http://perso.orange.fr/softelec/Projects/PIC18/PP18/Projects_PIC18_PP18_us.htm
and download the software(it is PIC programming software!!! for PIC18 family) there is a program callled allowIO.exe that uses porttalk to allow programs to use IO ports under NT/XP/Vista
here is a segment from the installation instructions for the program: INSTALLING PP18 under Windows 2000/NT/XP:

- Copy "porttalk.sys" to your "C:\WINDOWS\system32\driver" directory.
- Execute "porttalk.reg" to register the new driver.
- Reboot your computer to start the driver after booting.
- Copy AllowIo.exe in the same directory than PP18.exe.
- Open a DOS window at this directory.
- Type "AllowIo.exe 0x378 PP18.exe" to allow PP18 a full access to LPT1.

Note :
During installation process you must have root privileges.
You can creat a batch file to launch AllowIO.exe and PP18.exe.
this will work with ne program just as long as you run it from a batch script and you know the port addressin hex!!!
hope this helps!!!
Brennn107 years ago
Is the chip mentioned here, a reprogrammable chip? Meaning that it can be used over and over again? With taking information off of it and putting different on.
leevonk (author)  Brennn107 years ago
yeah, it has flash memory, so its reprogrammable
What PIC programmer do you recommend?
leevonk (author)  Brennn107 years ago
for DOS programming at home, I'm using a cheap $15 programmer from ebay, works fine, just find one that has the PIC # you want to use listed as compatible. for windows programming at work I use an 'MPLAB ICD 2' connected to a 'demonstration board', they work well and the ICD 2 allows in circuit debugging (stepping the PIC through a program step by step to find a bug). http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010046
haven't used anything other than those.
Thanks alot. One more question. There are PIC programmers, and then there are micro-controllers. What is the difference?
1-40 of 58Next »