Other
Read books online » Other » Make: Electronics Charles Platt (smart books to read txt) 📖

Book online «Make: Electronics Charles Platt (smart books to read txt) 📖». Author Charles Platt



1 ... 110 111 112 113 114 115 116 117 118 ... 122
Go to page:
and painless. Once you have done that, you should find that it has placed a shortcut on your desktop. Double-click it, go to View→Options, and in the window that opens (shown in Figure 5-127), click the Serial Port tab. You should see a dialog box like the one in Figure 5-128. Now make sure that the Programming Editor is looking at the same COM port that was chosen by the USB driver. Otherwise, the Programming Editor won’t know where to find your PICAXE chip.

In the Programming Editor, go to View→Options and click the Mode tab, then click the button to select the 08M chip.

Figure 5-127. This screenshot shows the options window of the PICAXE Program Editor, which you must use to select the type of chip that you intend to program (in our case, the 08M).

Figure 5-128. Another screenshot of the options window shows the second essential choice that you must make: selection of the COM port that the installer chose on your computer.

Are we having fun yet? Obviously not, but you’re through with software hassles for the time being. The last step before you’re ready to use the PICAXE is to mount it, and its socket, on your breadboard.

Setting up the hardware

The PICAXE 08M looks like a 555 timer. (Other chips in the PICAXE range have more pins and more features.) It requires a properly regulated 5 volts, just like the logic chips you dealt with previously. In fact, the PICAXE people are rather emphatic about protecting it from voltage spikes. They want you to use two capacitors (one 100 μF, one 0.1 μF) on either side of an LM7805 regulator. This seems like overkill, but the PICAXE is more inconvenient to replace than a 555 timer. You certainly can’t run down to RadioShack to buy one. So let’s do what the manufacturer says, just in case, and set up a breadboard as shown in Figures 5-129 and 5-130.

Figure 5-129. PICAXE documentation specifies a 100 μF and 0.1 μF capacitor on the input side of a 5-volt regulator, and a similar pair of capacitors on its output side. On a breadboard, they can be arrayed like this.

Figure 5-130. The actual components for power regulation, applied to a breadboard, delivering 5 volts (positive and negative) down each side.

Now for the chip itself. Note that the pins for positive and negative power are exactly opposite to those for the 555 timer, so be careful!

Set up your breadboard following the schematic shown in Figure 5-131. Note that I am showing the stereo socket on its underside, because I think that’s how you’ll have to use it with the breadboard. If you try to stick its pins into the holes in the board, they will fit, but when you insert the plug into the socket, the thickness of the plug will tend to raise the socket up so that it loses contact. I really think the way to go is to solder wires to the pins on the socket and push the wires into the breadboard. See Figure 5-133.

Figure 5-131. The schematic of a test circuit for the PICAXE 08M shows the underside of the stereo socket, the essential 10K and 22K resistors on the input pin, and an LED to show an output from the chip.

Be aware that the PICAXE manual shows things differently (although I have retained their labeling convention for the parts of the socket and the parts of the plug, identified as a, b, and c).

One little detail about the socket that is commonly supplied for use with the PICAXE: typically it has two pairs of contacts for the connections labeled b and c in the manual, and in my diagram. When you solder a connection, your solder joint should include both of the contacts in each pair, as shown in Figure 5-132.

Remember that the PICAXE must have 5 volts DC, and remember that your voltage regular will deliver this voltage reliably only if you give it extra voltage on its input side. If you provide it with 9 volts, that will provide a good amount of headroom.

The 22K and 10K resistors are essential for using the chip; see the following warning note for an explanation. My schematic also includes an LED and a 330Ω resistor, but they are needed only for the test that we’ll be making momentarily.

Pin 2 Pull-Down

Always include the 22K resistor and the 10K resistor in the configuration shown in Figure 5-131. These resistors apply correct voltage to the serial connection, and when you’re using the PICAXE on its own, they pull down the voltage on pin 2.

If pin 2 is left unconnected (floating), it may pick up random voltages, which the chip can misinterpret as a new program or other instructions, with unpredictable and undesirable results.

The 22K and 10K resistors should be regarded as permanent items accompanying your PICAXE regardless of whether you have it attached to your computer.

Figure 5-132. Correct wiring of the socket is essential. When soldering wires to the lower terminals, make sure that you attach the wires to both of the terminals in each pair.

Figure 5-133. The breadboard version of the test schematic, with the plug of the USB download cable inserted in the socket on the board. The PICAXE chip can now receive a downloaded program, and will immediately start to execute it.

Verifying the Connection

Follow these steps carefully every time you want to program or reprogram your PICAXE chip:

1. Insert the USB plug of your PICAXE cable into the same USB port that you used before.

2. Start the Programming Editor (or AXEpad if you are using a Mac OS or Linux).

3. In the Programming Editor, select View→Options to verify that the editor is using the right COM port and is expecting the 08M PICAXE chip.

4. Plug the stereo plug on the free end of the USB cable into the stereo socket that is now wired into your breadboard. See Figures

1 ... 110 111 112 113 114 115 116 117 118 ... 122
Go to page:

Free ebook «Make: Electronics Charles Platt (smart books to read txt) 📖» - read online now

Comments (0)

There are no comments yet. You can be the first!
Add a comment