The 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.
- Obtain the following components: (These are available from Peter Anderson)
- PicAXE 08m
- Sufficient Wire
- 7805 Voltage Regulator or equivalent
- 4001 or equivalent diode
- 2 capacitors on the order of 10 – 100 uF.
- Female Din9(serial) connector (From an old mouse etc.)
- 2 LEDs and 2 resistors between 200 – 500 Ohms. (Red Red Brown is 220 and ideal)
- 9 Volt battery with battery snap or 7-12 Volt wall wart. (Transformer.)
- 10K Ohm resistor(Brown Black Orange) and 22K Ohm Resistor(Red Red Orange).
- Build the regulated power supply
- Insert the voltage regulator into the breadboard.
- 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.
- 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.
- Connect one of the ground rails of your breadboard to the other with a wire.
- Connect a wire from the ground rail of the breadboard to the central ground pin of the voltage regulator.
- Connect a wire from the right side (input) voltage rail to the input pin of the voltage regulator.
- 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.
- 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.
- 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.
- Connect your battery snap so that the black lead goes to your input ground 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.
- Make sure the the positive lead from the battery is unplugged.
- 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.
- Connect a wire from pin1 to the output voltage rail.
- 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.
- 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.
- 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.
- Connect the middle pin to pin7 of the PicAXE. This is the the serial output from the picaxe.
- Connect a 10K (brown black orange) resistor from the bottom pin of the stereo jack to ground.
- 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 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.
- Connect the Ground wire to Ground.
- Connect the serial output wire to pin7 of the PicAXE.
- 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.
5. Test your Development board.
- Open the PicAxe Programming Editor.
- Enter the following code:
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 clicking 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