Home page





Comparateur de prix
Cadeau original
Robot mobile IRBOT










The microcontroller PIC16F84

It's a microcontroller of the Microchip company which offers a very good ratio quality/price.

Its principal features :

18 pins chip.

You can download the complete data sheet (120 pages) and the applications notes by Microchip.

Page top


To begin

MPLAB - Development environment

MPLAB is a Windows_-based Integrated Development Environment (IDE)

To write a PIC program you need :

All that is gracefully disponible by Microchip. That is called MPLAB, download it and install it on your PC.

Page top


MPASM - The assembler

MPASM is part of MPLAB, it's the assembler for write the PIC program.

The best means of learning is to analyse a simple program, such as blinking a LED. I advise you to download the guide of MPASM from Microchip and to print it.

To give you an outline, here a small parts of program which lights a LED when you push button. The LED is connected to PORTB 0 and the pushbutton to PORTB 1.


toto btfss PORTB,1

b toto

bsf PORTB,0


toto is a label

btfss is a test bit instruction (bit test file skip if set), it test bit 1 of register PORTB, if this bit is 1 (supported pushbutton) it skip the next instruction, i.e. that it arrives at the instruction bsf, if the bit is 0, it execute the next instruction.

b toto branch to label toto, the programme loops

bsf PORTB,0  bit set file, i.e. it set to 1 the PORTB 0 (what lights the LED)


Page top


The programmer

Once the program compiled, it should be transferred in the microcontroller memory. For that you need :

A small material interface

It is the PIC programmer. He exist 2 versions: a version for port série, and a version for port parallel (it is that which i use). There are some in the trade at small price. If not you can assemble it yourself, it is what i did (AN589 of Microchip ).

A software

Which ensures the transfer of the data between the PC and the microcontroller (it is delivered with the programmer) or you can find it on the Web. (i use PIP02, but i advise it not, turn badly under Windows 95 and is not updated any more).

Here a list of programmers links


Page top



Your first program

Blinking a LED

Eh yes, it is necessary to start small to finish great.

2 different approaches :

Page top


Experimentation board

To test new assemblies containing PIC, it can be useful to have a experimentation board. For my part, i use the circuit "Low cost system development for PIC" describe in the n° 7-8/98 of Elektor. This system make it possible to test a PIC which you have programed with success.

The board has its own supply voltage 5V, a quartz oscillator, a RC oscillator and a test zone allowing to establish I/O components such as LED, Pushbutton ...

You will find the equivalent on the Web, for example PicTec or TOPIC (very well documented, layout provided) which combine experimentation card and programmer. (to be tested)

Page top


Examples of realisation

DCF77 Clock

It acts of a clock with automatic time setting by time signals DCF77 emitted by the transmitter of Frankfurt (in Germany).

Below the time wheel.

It is noted that in the space of 60 seconds are transmitted the information of the minutes, hours, day, day of week and year. The program of DCF77 clock exploits only information of the minutes and hours.

Picture from DCF77 site

A DCF77 reception module from Conrad collects and demodulates the time signals. At output of the module, a 0 logic corresponds to an impulse of 100ms, whereas a 1 logic corresponds to an impulse of 200ms. The microcontroller measures the duration of the impulses and decodes the time signal. The display of the hour is made on a series module 4x7 segments from Sélectronic. The processing of the time signal takes place in a interruption routine. There remains 70% of memory available to write the main program.

Download the diagram ,the program, the flowcharts and the doc of DCF77 clock. (dcf77.zip)

Page top


DCF77 heating programmer

It acts of an electric heating programmer which controls the radiators of 5 zones according to the hour and the presence of people. To reduces your electric invoice it is the ideal system.

It is composed of 2 modules

Features :

The heating by presence detection functions according to the following principle : as long as there a person in the part and that we are in the time range, the heating turns. If the person leave the part, the heating is reduced after 30' of inoccupation. When a person returns, the heating turn on. Apart from the time ranges the heating is reduced.


Download chauff.zip

Page top


Very original clock

The propeller clock, according to a clever idea of Bob Blick.

A PIC16C84 (or F84) whirls at 1800 rpm at motor shaft end !!!

Seven LEDs in rotation give the illusion of the hour displayed in the space.


A motor spin a propeller (the board with the LEDs) and the microcontroller (PIC16C84 or F84) generates the hour and changes the state of a line of 7 LEDs in order to simulate the display on a matrix of 7x30 points. The power supply is taken on the motor.

It is an illusion but the effect obtained is remarkable.

You will find all information (plan, diagram, software, layout, photos) relating to its construction on the page Propeller Clock of Bob Blick.

For my part, i used a flat motor of a cartridge reader with the layout describe in the page of Bob Blick. The result is conclusive.


Page top



Phone remote control

It is about a remote control of the warning system (in my personal case) via the phone with acknowledgement delivered in the form of a vocal message. The access is made safe by a password of 4 digits.

After identify, the following menu is diffused: " To modify (the state of the warning system) type the 1 - To question (the state of the warning system) type the 2 ". After having choice, an " Run " message or " Stop " is diffused in term of answer.

The process is directed by a PIC16F84, the vocal messages are memorised in circuit ISD1016A. (can be replaced by 1416)

ISD1016A is a circuit of 28pins which makes it possible to record and play a vocal message one duration of 16s, it can be split in several messages.

To download the data sheet série 1000 d'ISD

To memorise the vocal messages, it is necessary to build a small assembly with a speaker of good quality, a HP and switchs to select the addresses (that is explained in the data sheet).

Download com_tel.zip


Page top


RS232 Alarm box

This system was conceived for a professional application, but can be used for a personal use.

It is about a box able to generate a visual alarm (display 7 segments of the n° of alarm), sound and material (contact of a relay). The release of alarm is done by the port series RS232 (starting from a modem, microcomputer) by reception of a control word.

The box recognises 8 types of alarm and also manages the ends of alarm.

Ex: the box is connected to a microcomputer

to set off alarm 1, send the chain " med1 " on the port series

to stop alarm, send " $$fin "

Download boitier.zip


Page top


Routine RS232

RS232 is the protocol of data transmission in series. It is in particular used on the port series of the microcomputers.

It acts at the application note AN555 of Microchip which I adapted to the PIC16F84. Diagrams of interfaces with the MAX232 are proposed in note AN555.

Perhaps a little complicated, but reliable.

Its features


Download rs232.zip

Page top


LCD display

LCD display routine (8bits) of 2 lines module starting from a PIC16F84.

See this site for more details on displays LCD.

Download the diagram and the routine lcd.zip

A version 4 bits LCD routine, application note from Microchip adapted by Norm Cramer : cramer.zip

Page top


IR remote control

This project makes it possible to visualise codes RC5 of the remote controls infrared Philips on a display LDC 2 X 20 characters.

I invite you to go visit another page which treats remote controls IR.


Download ReadRC5.zip


Page top


Multi tasks operating system

Author: Pavel Baranov

This software, named Posit1, is a simplified multi tasks operating system for PIC microcontroller. It makes it possible to write a complex program in a very structured form.

It is composed of a main program os.asm which calls the various subroutines or tasks (t0.asm, t1.asm...).

Each task is cut out in 3 parts:

You need to compile only os.asm file. All the other files are included into os.asm.

The Pavel robot software is an application example of Posit1, have a look at it.


Download Posit1 on the site of Pavel Baranov


Page top


A multi-purpose laboratory instrument

It acts of application note AN689 from Microchip.

It is a remarkable project who use all the resources of the PIC16F84.

It is a multi-purpose laboratory instrument which consists of :

  • logic probe
  • single-channel logic state analyser
  • serial code receiver
  • frequency counter.

As this is single-chip instrument, all functions are supported by software.

Display on a LCD module (used is Hitachi's LM032L) with 2 lines of 20 columns.

Download the application note AN689 from Microchip.

Download the soft (.asm) and the layout in format .pcb (Protel),.bmp and .pdf : probe.zip


Page top


Home page | Electronic | Robotic | Links

Last update : 15/03/2002