profmason.com

February 11, 2007

How to Build a PicAXE dev board

Filed under: PicAXE — profmason @ 9:33 pm

moz-screenshot-39.jpgThe PicAxe is a Pic microprocessor with a bootloader that allows the chip to be programmed in basic. This tutorial will lead the user through building a development board, including a regulated power supply and a serial interface. This will focus on the PicAXE 08M, but it is applicable to the rest of the PicAXE family.

  1. Obtain the following components: (These are available from Peter Anderson)moz-screenshot-36.jpg
    1. PicAXE 08m
    2. Breadboard
    3. Sufficient Wire
    4. 7805 Voltage Regulator or equivalent
    5. 4001 or equivalent diode
    6. 2 capacitors on the order of 10 – 100 uF.
    7. Female Din9(serial) connector (From an old mouse etc.)
    8. 2 LEDs and 2 resistors between 200 – 500 Ohms. (Red Red Brown is 220 and ideal)introbreadboard.JPG
    9. 9 Volt battery with battery snap or 7-12 Volt wall wart. (Transformer.)
    10. 10K Ohm resistor(Brown Black Orange) and 22K Ohm Resistor(Red Red Orange).
  2. Build the regulated power supply

moz-screenshot-37.jpg

    1. Insert the voltage regulator into the breadboard.
    2. Insert the 4001 diode across the input to the output. The silver ring on the diode should connect to the input lead of the voltage regulator.
    3. Label one of the columns of your breadboard as ground by drawing a black line down the column. Repeat this on the opposite side of the breadboard. The photograph above shows your progress so far.
    4. Connect one of the ground rails of your breadboard to the other with a wire.
    5. Connect a wire from the ground rail of the breadboard to the centvoltagereg21.jpgral ground pin of the voltage regulator.
    6. Connect a wire from the right side (input) voltage rail to the input pin of the voltage regulator.
    7. Now connect a wire from the output pin of the voltage regulator to the output voltage rail. Your breadboard should now look like the picture to the right.
    8. Connect your two capacitors across each of the vertical rails. (The negative terminal of your capacitor should connect to the ground rail and the postive to the corresponding voltage rail.) These capacitors act to smooth out both the input and output voltage.
    9. Connect the short leg of one of your LEDs to the output ground rail. Connect the long leg to an unused portion of the breadboard. Now connect your 200 – 500 ohm resistor from the LED on the breadboard back to the output voltage rail. This LED will serve to tell you if your voltage regulator is working.
    10. Connect your battery snap so that the black lead goes to your input grvoltageregcomplete1.jpgound rail and the red lead goes to the input voltage rail. Now connect your 9V battery. (If you did everything right you should have a regulated 5V output on the output side and your LED should glow brightly. If not check all your connections and make sure your battery is fresh.) Your breadboard should now look like this photograph.

3. Connect the PicAXE to the DevBoard.

    1. Make sure the the positive lead from the battery is unplugged.
    2. Insert the PicAXE 08M into an unused portion of your breadboard so that microprocessor spans the central rail and the small dot that indicates pin 1 is in the upper left.
    3. Connect a wire from pin1 to the output voltage rail.
    4. Connect a wire from pin8 to ground. (Note pin 8 is directly across from pin 1.) Your breadboard should now look like the picture below.

    picaxein.jpg

4. Connect your serial cable.stereojack.jpg

    1. To make repeated connections easier, it is useful to use a stereo connector and socket. RevEd sells a serial to stereo cable, or you can make one yourself relatively easily. There are instructions below on making your own cable.
    2. Insert the stereo jack into the breadboard. Make sure that it makes good contact with the breadboard. Connect the topmost pin of the stereo jack(closest to where you plug the cable into it) to ground.
    3. Connect the middle pin to pin7 of the PicAXE. This is the the serial output from the picaxe.
    4. Connect a 10K (brown black orange) resistor from the bottom pin of the stereo jack to ground.
    5. Connect a 22K (Red Red Orange) Ohm resistor from the bottom pin of the stereo jack to pin 2 of the PicAXE. This is the serial input to the picaxe. Your breadboard should now look like this.

You may skip to part 5 on testing your development board.
Notes on making your own cable.serialcable.jpg

    1. You only need to use three pins of your serial cable. In the photograph the blue wire is the serial output from the picaxe and is connected to pin2 of the DB9. The yellow wire is the serial input to the picaxe and is connected to pin3 of the DB9. Finally the black wire is connected to ground and is connected to pin5 of the DB9.
    2. Connect the Ground wire to Ground.
    3. Connect the serial output wire to pin7 of the PicAXE.
    4. Connect the serial input wire is connected across a voltage divider consisting of a 22K Ohm resistor and a 10K Ohm resistor to pin 2 of the PicAXE. Then to the where you brought the 22K Ohm resistor out in step 4 above.08mserialconnection.JPG

5. Test your Development board.

  1. Open the PicAxe Programming Editor.
  2. Enter the following code:
  • main:
    high 2
    pause 500
    low 2
    pause 500
    goto main

3. Connect a 200 – 500 Ohm Resistor from pin 5 to an empty row just below it. Connect an LED so that the long end goes from that empty row and the short end goes to ground.

4. Connect the battery and run the software by clickingmoz-screenshot-38.jpg the blue arrow. A downloading window should appear with a blue bar moving across it to show progress. After about 10 seconds the transfer should be complete. If it doesn’t work make sure that your battery is connected and check all of your connections.

5. Congratulations! You should have a flashing LED on your board. Try to figure out how to make multiple LEDs flash on the same board. (Refer to the pinout of the 08M at the beginning of the article) For more advanced projects you should look at other parts of this website or the book Programming the PicAXE

2 Comments »

  1. [...] follow the instructions in the “How to build a PicAXE dev board” tutorial. You will need this completed board as a starting point. Now you need to insert the [...]

    Pingback by profmason.com » Building a PicAxe 08M datalogger — March 10, 2007 @ 2:39 pm

  2. [...] follow the directions in my How to Build a PicAXE dev Board [...]

    Pingback by profmason.com » How to convert an RC Car into a Robot — September 10, 2007 @ 6:37 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress