a minimum of what you need to get started programming PIC micros for use in electronics projects (robotics, etc)

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!

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.

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).

This is the compiler used in this demo to (similar to Basic language) program the PIC.
You could also use the -free- PICClite compiler (similar to C language).
You could also use a free assembly language compiler (assembly language is annoying).

This program allows you to download your code to the PIC.

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

<p>can i use a PIC instead of atmega MCs in arduino?</p>
<p>Thank you for the PIC project. I am taking a home-study Into to Microcontrollers course (<a href="http://www.ciebookstore.com/intro-to-microcontrollers-programming-troubleshooting-course" rel="nofollow">http://www.ciebookstore.com/intro-to-microcontroll...</a>) and it's nice to know a lot of what I'm learning can be applied here and in other instructable projects! </p>
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.
<a href="http://www.microcontrollerboard.com/pic_microcontroller.html" rel="nofollow">Hi, Here is the link to a great website&nbsp;for&nbsp;PIC microcontroller projects, tutorial,&nbsp;and much more<br> &nbsp;http://www.microcontrollerboard.com/pic_microcontroller.html</a>
This looks interesting...<br/><a rel="nofollow" href="http://pp06.sourceforge.net/index.html">http://pp06.sourceforge.net/index.html</a><br/>But windows just keeps getting sicker and less useful.<br/>I'm searching for a technical bootable-linux-CDROM-distro. For free, of course!<br/>
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&nbsp;out. Try it, you will be surprised...<br />
Cool, I will definitely try it out!<br />
Let me know how it goes...<br />
I like to use Suse linux with KDE. Its a little harder to get customized but has a lot of power.
For Linux there is &lt;a href=&quot;http://piklab.sourceforge.net/&quot;&gt;PikLab&lt;/a&gt;.&lt;br /&gt;<br/>
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.
i used a velleman k8048 and it works on xp with out paid software.
could you buy these at radio shack?
nope.<br/>you can get them here though:<br/><a rel="nofollow" href="http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&amp;name=PIC16F877A-I/P-ND">http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&amp;name=PIC16F877A-I/P-ND</a><br/>
does anyone know about an open source pic programmer that will run on vista? will this one? thanks for the info in advance.
I think the PICAXE programming software can also do PICs, and that's free.
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.
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
its quite funny that you mention the PIC (personal introductory course) book, my friend wrote it.
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?
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: <a rel="nofollow" href="http://www.microchip.com/ParamChartSearch/chart.aspx?branchID=8172&amp;mid=14&amp;lang=en&amp;pageId=75)">http://www.microchip.com/ParamChartSearch/chart.aspx?branchID=8172&amp;mid=14&amp;lang=en&amp;pageId=75)</a> are reprogramable<br/>
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.
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
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.
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<br/>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 <br/>here is a segment from the installation instructions for the program: INSTALLING PP18 under Windows 2000/NT/XP:<br/><hr/> - Copy &quot;porttalk.sys&quot; to your &quot;C:\WINDOWS\system32\driver&quot; directory.<br/> - Execute &quot;porttalk.reg&quot; to register the new driver.<br/> - Reboot your computer to start the driver after booting.<br/> - Copy AllowIo.exe in the same directory than PP18.exe.<br/> - Open a DOS window at this directory.<br/> - Type &quot;AllowIo.exe 0x378 PP18.exe&quot; to allow PP18 a full access to LPT1.<br/><br/> Note :<br/> During installation process you must have root privileges.<br/> You can creat a batch file to launch AllowIO.exe and PP18.exe.<br/>this will work with ne program just as long as you run it from a batch script and you know the port addressin hex!!!<br/>hope this helps!!!<br/>
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.
yeah, it has flash memory, so its reprogrammable
What PIC programmer do you recommend?
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). <a rel="nofollow" href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en010046">http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en010046</a><br/>haven't used anything other than those.<br/>
Thanks alot. One more question. There are PIC programmers, and then there are micro-controllers. What is the difference?
What do you think the cost of these starter project materials would be, roughly?
usb to serial adapter (if you have a computer with windows 95 or earlier, don't need it) costs around $20 PIC microcontroller costs around $7 JDM programmer costs around $20 compiler options: PICClite is free PICBasic costs $99 PICC costs $950
also,<br/>IC-Prog is free<br/><br/>electronic components are almost nothing<br/><br/>regulated 5v power supply can be around $20 but you can use batteries, or probably find a good 5v wall-wart (those transformers that come with your electronic gadgets) sitting around somewhere.<br/><br/>You could also use any wall-wart (regarless of voltage) and a very cheap LM7805 regulator (see URL below)<br/><a rel="nofollow" href="http://www.iguanalabs.com/7805kit.htm">http://www.iguanalabs.com/7805kit.htm</a><br/>
or use an usb cable the red wire is +5v and the black is ground thats what i did to make a masgaer
Hey all. This is my first reply to a post... I use PIC ucontrollers in my research robotics projects. A lot of people get started with the 16F84 or the 877. I'd like to point people in the direction of the 18F series chips, specifically the 18Fxx31 series (I really like the 18F4431). These chips have all of the basic functionality, but they have great peripherals of use to home experimenters. Specifically, they have 8 channels (4 pairs) of PWM and a quadrature encoder input that is great for motor interfacing. I use MPLAB along with either the C18 compiler or MPASM for assembler for most of my work. BTW, I don't represent Microchip in any way, I just really like their stuff!
mplab is free and you can build an ICD2 clone by going to www.icd2clone.com, i wouldnt knock assembly language, its syntax may be tricky, but i can do whatever your doing in c or basic in 1/4 of the memory and have it run many times faster.
yeah, and it will take you ten times as long to do it. I've used assembly language too, but I usually don't do applications that require its speed and efficiency of execution. So instead I prefer speedy and efficient programming.
You can get free chips off of the microchip website..
I'd like to get a multi programmer to program more then one processor . Links anyone? Or infact links to where I could buy like a starter set or each piece individually ?
It's not that hard to build a programmer yourself either. Basically there are three types of programmers that are most often used: JDM, TAIT and ICSP (single supply). I suggest having a look at the PICPgm software page at www.members.aon.at/electronics/pic/picpgm/ and navigating to the Hardware section. I began my PIC experiments by building a JDM circuit on a breadboard and it worked just fine for my purposes...
In circuit serial programming can be done with nearly any programmer. I guess you meant "low voltage programmer."
ICSP isn't a type of programmer, but just means In Circuit Serial Programming. If you take proper precautions with your circuit/developing board, you can modify any programmer to do ICSP. That being said, the Tait programmer is much easier to implement in this regard, and also is much more reliable as a first DIY programmer. The JDM requires at least +-8.5V in your serial port, and relies on capacitors and negative voltages to store up enough charge for short bursts of programming voltage. It won't work for all computers and is harder to modify. It uses negative rail as ground, so ICSP is trickier.
Hi there, I've not used rar files before - is there another way of providing the files in this compressed format? What is in there? Thanks
if I don't upload it as a compressed file the webpage will shrink the picture. the .rar is just a more in depth version of the picture shown. to open .rar files just download winzip or winrar (both are free).
This instruction is really great, it makes the beginning really easy, because you explained everything just the way everyone can understand it, really great work. I always wanted to start working with those microcontrolers, but it just seemed to be too hard to start, or I just didn't find the right instructions about how I could actually start. I am going to get the materials soon, and then I will start doing my very own microcontroler Projects. Only problem might be the compiler for the programs, but I am positive my uncle can provide me with one, as he works with microcontrolers and stuff for a living (but he was never able to explain this an easy way to me, but when you work with really complex stuff it is sometimes hard to explain the simpler things, I guess). There ist just one thing I don't get: what exactly are the two 22pf capacitors and the 4MHz chrystal oscillator doing? Sure, they are providing some sort of clock, but how are they actually doing it? What would happen if you put a different sort of capacitors in there?
I'm glad you found it helpful, it's true that it's hard to get a nice easy intro the PICs, nobody seems to want to put everything for one simple project all in one place. I'm glad my summary helped.<br/><br/>the crystal oscillator just oscillates when you apply a voltage to it at a certain frequency. Here is a quote from another site (http://www.du.edu/~etuttle/electron/elect16.htm)<br/><br/>&quot;Some crystals develop surface charges when they are squeezed, bent or twisted, and are called piezoelectric. Conversely, when an electric field is appied to them, they expand, contract, bend or twist. The mechanical vibrations of the crystal are directly associated with electrical changes at the same frequency. Like all mechanical systems, crystals may vibrate at resonant frequencies, where small pushes create a large amplitude, just as in electrical resonant circuits. The mechanical vibration of crystals gives a standard of time, better than that of mechanical clocks, but inferior to that of atomic vibrations.&quot;<br/>

About This Instructable


163 favorites


Bio: www.leevonk.com
More by leevonk: WolfPack: Large-Dog Carrier Vortex-Drive Micro ROV (ROVVor) Squintasaurus: cybernetic dynamically adjustable vision enhancement system
Add instructable to: