<< The Fribotte Home page >>

[Home] [Who are we?] [Robot] [Tech DB] [e=m6 cup] [Forum] [Reports] [Links]

 Introduction : What is a PIC ?
A PIC is a micro-controller (manufactured by Microchip).
It is a component which includes RAM, ROM or equivalent, a calculating unit, and inputs/outputs.
In fact, there is a whole family of components more or less powerful and with different sizes.
They are interesting as being RISC micro-controllers (with few instructions), cheap and thrifty in power.
Here we will more specifically talk about the PIC 16F84
There are other pages on the Web which explain what a PIC is.
This page was created by using their advices !
Look more particularly at :

Electronics and Robotics (in French)
http://perso.wanadoo.fr/yves.heilig/

ATEI (in French)
http://www.multimania.com/pmorphe/


 General overview of the PIC 16F84
Works at 10 Mhz max. Each clock cycle takes 4 clock tops.
35 instructions
1Ko of FLASH memory for the program
68 octets of RAM
64 octets of EEprom
1 counter/timer 8 bits
1 Watch dog
4 interrupts
13 Inputs/Outputs which can be individually configured
SLEEP mode
18 pins case

The pic 16F84

The detailed caracteristics are in the documentation. (pdf format, 1.3 Mo)


 The equipment needed to start with a PIC
Our goal is here to make a small simple wiring which makes leds flicker with a PIC 16F84.
Once this wiring carried out, the most difficult part will be done and you will be able to start with more complex things.
Here is what you will need initially :

Name Price Remarks
1 PIC16F84 49 FFr Needed :-)
A PIC programmer home made or bought ready made at 400 FFr To download the program in the PIC FLASH
Eventually a transformer 50-100 FFr To power the programmer.
A plier to take the PIC out of its holder 25-50 FFr To avoid folding a pin while operating it
Not compulsory...
1 4 Mhz Quartz A few francs For the PIC clock
2 33 pf capacitors A few francs Also for the clock
1 100 nf capacitor A few francs Suppressor
some LEDS A few francs For the display
some 450 ohms resistances A few francs For the LEDS
1 5V regulator L7805 5 - 10 FFr (?) To provide the PIC with 5V
a connector for a 9V battery A few francs To power the board
A 9V battery 20-30 FFr To power the board
rigid wire ? To wire the board
1 test board 50 - 100 FFr To make the circuit


 Zoom on some componants
The programmer is the element which makes it possible to load the program in the PIC FLASH memory.
It is connected to the computer by series or parallel connections.
It can either be done by yourself or buy it.
The model presented here was bought ready made at 390FF, which is expensive compared to the home made systems, but you don't need any equipment to make it.
You will find diagrams in the links at the top of the page.
Note that it should also be powered with 12V.

The PIC programmer
The regulator will make it possible to provide a stable 5V from the 9V battery.
The left pin is the 9V input, the middle pin the common ground and the right one the 5V output.
This model holds 500mA, and a radiator can be added.

The 5V regulator
The 9V battery may need wire adaptation. Watch the connections !

The 9V battery


 Programming the PIC
It is not difficult, but you have to be carefull while using th PIC not to twist the pins or connect it upside down.
The program of the programmer you have to use depends on you programmer, of course, but in any case you should not forget to :
    Specify you are using a PIC 16F84
    Put the watch dog timer at OFF
    Put the oscillation mode on XT
    Erase the PIC Flash
    Load the program you want to use (see below) in the buffer
    Copy it int the PIC
    Check it !
    Disconnect everything properly.
The program loaded in the PIC :
Our aim here is just to make a test, so we will not write a program.
Take directly the compiled program with makes the leds on the port B outputs flicker
(Found on the page Electronique et Robotique go the this page to find the source).


The program of the programmer


 The final wiring
You just have now t make the wiring. Watch the directions of the componants (if they have some). Connect the battery above, and (if everything goes well) the leds will flicker!
If it doesn't work at once, start again. But that will undoubtedly be nothing complicated.
The diagram
A 100nfcapacitor is missing between the pins 14 and 5 of the PIC (Vcc and ground).
What it looks like...

Last modified : 28 march 2000