Electronics

Projects
  Kodak DC20 Controller

PIC Microcontrollers
  Getting Started
  16F84

Reference
  Resistor Color Codes
  Resistance Calculator
  Ohm's Law

 

 

Step 2: Building the Circuit

Basic PIC 16F84 Circuit with I/O

This picture shows the circuit we will build. Place your mouse over the picture to hide the components so you can see the connections better.

You'll want to build this circuit on a solderless breadboard, not on a printed circuit board as suggested by this picture. Use this picture as a wiring guide only.

Build the circuit without the IC to minimize the risk of damaging it. You'll need to program the chip outside of the circuit before it will do anything anyway. Insert the chip into the circuit only after you have programmed it and have double checked all connections.

Connections

The IC in the center of the picture is a PIC 16F84. It is oriented so that pin 1 is in the lower left corner. Continue counting the pins counter-clockwise. Pin 9 is in the lower right, pin 10 in the upper right and finally pin 18 in the upper left.

Two LEDs are connected to two I/O lines, pins 17 and 18, through current limiting resistors. These two resistors are both 680Ω. Pins 17 and 18 are bits 0 and 1 of Port A, respectively. Our program will turn on one of the LEDs by setting the respective bit on port A.

Pins 1 through 3 are the remaining bits on port A. They are unused in this circuit, so they are connected to +5V through 10KΩ pull-up resistors.

Pin 4 is the MCLR line. It is held high by connecting it to +5V through a 10KΩ resistor.

Pin 5 is Vss. It is connected directly to Gnd.

Pins 6 through 13 are bits 0 through 7 of port B, respectively. They are unused in this circuit and are connected to +5V through 10KΩ pull-up resistors.

Pin 14 is Vdd, connected to +5V.

Pins 15 and 16 are OSC2/CLKOUT and OSC1/CLKIN, respectively. They are connected to the two outside leads of the crystal. The crystal is not a polarized component, so it may be connected either way. The center lead of the crystal is connected to Gnd.

You need to program the IC to do something, so don't connect it to the circuit yet. That's all there is to building the circuit.

When you are ready to activate the circuit, connect a 5 volt power supply to Gnd and +5V.

Next: Writing & Installing the Program

 

Tell me what you think