page:  1   2   3   4  »    

Burn Baby, Burn

So you want to start burning your own PICs? We've written a short tutorial to help get you started.

We assume you are starting from scratch. We tried to write it for the beginner with little knowledge of bread boarding - skim as you see fit.


What you need:

  • PIC Programmer - We will use the PIC-PG1 low-cost serial programmer

  • Programmable PIC of some flavor - 16F628, 16F873, 16F877

  • Voltage Regulator -  LM317 variable or 78L05

  • Power Supply - 8V 'Wall wart' or above

  • Multimeter - You just can't leave home without it!

  • Hook-up wire - 22 American Wire Guage (AWG) wire works well

  • Bread board - Used for quick prototyping

  • Needle Nose Pliers - It can be tough jamming things into the bread board

Alrighty - so you've got most of what's on the list and you are ready to get going.

First you have to set up the power circuit.


Power Circuit -

Most of the circuits you will deal with operate on a 5 volt DC supply. Your house is 120 volts AC. How to make it work? Get a 'Wall Wart'. These are the large black boxes you plug into the wall to power your cell phone charger or cable modem. Checkout the label some time. It should say something like:

  • Input: AC 120V 60Hz

  • Output: 12V 500mA

If you plug this transformer (wall wart in engineering speak) into the wall, the cylindrical plug will output 12V and be able to source 500mili-Amps. If you are shopping for one, try to find one between 8-20V and 300mA to 1A DC. The Amp rating is not important for your first project. Blinking a light and running the PIC will only require ~20mA. A minuscule part of your transformer's ability.

But if most of the circuits run at 5V what are we doing with 12V supply? The wall warts produce a very 'noisy' 12V. We will clean that up with a 78L05 voltage regulator. If you apply some noisy voltage to the VIN pin, you will see a relatively clean 5V on the VOUT pin.

What you want to do is attach the positive line from your wall wart to the input pin of the VReg. Attach the ground line of your wall wart to the ground line of your bread board. Then plug a wire from the 'Output' pin to the power strip of the bread board along with a wire connecting the 'GND' pin to the Ground strip of the bread board.

All Voltage Regulators require 2-3V of 'over-head' voltage. This means that you must throw a few more volts on the input than what you are using on the output. This is because the internal circuitry has losses. If you try to pass 5-6V through a 5V regulator, nothing will break, but you will only see an iffy 4V on the output side. Try to give the 5V regulator at minimum 7.5V.

Whip out your trusty multimeter, plug in the wall wart, and measure the voltage between the high and low power strips on the bread board. You should read a voltage around 5V.

It is a good idea to hook a .1uF Capacitor between the high and low lines. This capacitor helps reduce any AC transients in the system. Tran what? The cap acts as a surge suppressor. When your roommate kicks on the blender and the lights go dim, the wall wart is going to pass a mild power spike to your circuit. The voltage regulator will suppress most of this spike, the capacitor helps suppress it even more.

The power circuit with the power strips conjoined

All ways test your power circuit before putting a microprocessor near your board. If something is hooked up wrong, or backwards, ICs can instantly fry. You will not see any smoke, but you will be scratching your head for hours trying to figure out why the darned thing doesn't work.

Warning - If you smell something odd or sense heat coming off the voltage regulator, immediately unplug your circuit. If you have a short of some kind, the VReg will begin to pass all sorts of current. This current turns to heat and causes the VReg to heat up dramatically. I have burnt my finger a number of times 'testing' the VReg. Under normal operating conditions, the VReg should barely be noticeably warm to the touch. If this is not the case, unplug and check.

So we will assume you've got your power circuit setup and ready to go.

On to the next step - Microcontroller Implantation.


Additional Discussion -

The LM317 on some Linear Systems Homework

Let's say you can't get your hands on a 78L05, or you want another voltage for some other module of the project. You need a LM317!

The LM317 is an adjustable regulator that can output 1.25V to 37Volts! It does this with two resistors and a feed back loop. You simple pick two resistors based on the datasheet equation:

Where R1 is 240-Ohm. You may ignore the IAJD term for the most part.

And hook them to the 'ADJ' pin as follows:

The capacitors C1 and C2 help and are good engineering practice. But if you don't got them, don't fret. They are only AC surge suppressors.

Our LM317 configured for 5V operation

With R1 as 240-Ohm, R2 as 720-Ohm, VOUT you get 5V out.

The following link is a fun graphical calculator for resistors. Have you got a pile of resistors and no idea what they are? Look 'em up!

 http://samengstrom.com/elec/resistor/index.html

Back to Tutorials

 

Comments

3 comments


Log in to post comments.

unebonnevie's rank:
+1.1
|   October 23, 2008 at 2:10 AM
Comment rating:
0
Hi,

I am a newbie with electronics. I have a couple questions when going through this tutorial.

a. Just found out that my breadboard can't seem to fit the pin size of the LM317 voltage regulator in orientation like your image shown. So, I had to spread the pins out a bit to fit them diagonally, so that each pin would occupy one hole on each different row. That's such bummer, as I don't know if it's a feature of my breadboard or not. So, what kind of breadboard you use in this tutorial? It seems like size of holes are much bigger than the ones on my breadboard.

b. How would I find the exact the resistors used with the exact ohm values to be used with the LM317 above so that I would have 5V output, that is, the 240 ohm and 720 ohm resistors? Is there a resistor calculator that would give me the color bands if I input the ohm and the tolerance? (LOL: I've got 1000 carbon film resistors and none of which has the exact ohm requirements for this tutorial. :-(

Thanks
unebonnevie's rank:
+1.1
|   October 23, 2008 at 3:21 AM
Comment rating:
0
LOL...I could put series of resistors to make up the 240 and 270 ohm values.
unebonnevie's rank:
+1.1
|   October 23, 2008 at 2:22 AM
Comment rating:
0
One more question: Can I use DC voltage for this tutorial, such as, a 9V battery?

Feedback

What's on your mind?

Please include your email address if you'd like us to respond to a specific question.

submit


If you would like to tell us more, you can fill out our form if you need some psycho-suggestive questions. Go to the form.