Picaxe Programming Editor

0 views
Skip to first unread message

Christian Swindler

unread,
Aug 3, 2024, 4:59:43 PM8/3/24
to swipriomiclips

The software supplied (either the Windows based Programming Editor or the AxePad Editor which works on Linux too) allows for programming in BASIC, which it then converts to Hex. This is then loaded onto the chip using the cable/bootstrap code, whichever editor is used the type of chip is detected prior to the Hex being uploaded, probably prior to it being compiled in fact.

If you can find a way of using the Duemilanove to program a PIC then you may be able to modify this to enable PICAXEs to be programmed the same way (since PICAXEs are just PICs plus the bootstrap code). I've had a quick Google for it and nothing obvious leaps out.

They have lots of different options, there may be something there that meets your requirements, if not then post back here and we'll see what we can do. I have an Experimenter Kit which was about 30 or 40 and can take most if not all sizes of PICAXE, setting up the programming circuit on a breadboard is quite straightforward though and the cables are quite cheap.

I'm getting close to finishing my start here robot and i need to get the servo to centre position... (I'm using the usb cord and windows vista basic). I downloaded the picaxe programming editor and the drivers for the usb cord and the cord is showing up when i go to options> serial port>com 4. But when i plug in my picaxe 28x1 to the usb and press check firmware this shows up:

Is the USB cable you are using the Picaxe programming cable? This is a specific cable that translates the USB signal to and inverted serial signal that the Picaxe uses. If you are using a normal USB to serial cable, it will not work.

Well, your set up with a copper pipe to complete the battery circuit seems suspect to me. Can you hook the output wires of the battery holder to something that will definitely show you are getting voltage? Like a motor or a 5V lamp or an LED with a 330 ohm resistor in series?

The PICAXE chips allow serial communications on many (but not all) of their I/O pins. You can always "talk" to your chip using the developer's terminal program included in the PICAXE Programming Editor, but there may be situations where you may not have or want the programming editor installed on the machine you (or your customer) will be using as your working control center. Also, the terminal feature in the Editor communicates via the same Com port as the programmer. This may introduce a hassle factor in that it forces you to use the SERIAL IN/OUT programming pins on the chip for communication, or to move the serial cable each time a change to the program is made. In these situations you might want to use a separate terminal program to communicate with the PICAXE. This page shows how to use the ubiquitous Windows HyperTerminal for that purpose. This demonstration uses the 08M chip.

Your PC must be equipped with a serial port. Laptops likely will not have a serial port. Late-model desktops may not have the serial port available on the back panel, but will have the port/s on the motherboard. You will need to equip the computer with an adaptor like this, available on-line lately for about $2.50. (Here for example.)

If your PC does not have a serial port (or has too few), a PCI serial port adapter like the one shown below can be installed in an unused PCI slot. This adapter adds 2 ports to to the existing number - ie, if there are no ports now, adding the adapter will increase the number of ports to 2. These adapters are available for about $20. Type "pci serial adapter" into a search engine. I've used the one pictured below successfully. Drivers for Vista and XP are included with the adapter. The driver for Win7 is available on-line at the vendor's website.

Since the designated SERIAL IN pin (pin 2) on the 08M can be used only for programming, it's necessary to establish a second, separate channel or "port" into the chip for communicating. For connection to a PC, the components connected to the serial input pin (10k and 22k resistor) must be duplicated on the pin you select for the second port. In the example below, the selected pin is pin 4 (In 3). For this particular pin, in addition to the resistors, a 1N914 diode must be connected from pin 4 to the +5v power rail, cathode end to pin 1, as shown.

The cable which connects port 2 to the computer is a duplicate of the cable used for programming the PICAXE chip. In fact, the same cable can be used for both functions, but it must be moved to the appropriate port when switching between the functions. If you will be making lots of programming changes, it probably will be worthwhile to make up TWO cables - it's one of the reasons for using a separate terminal program in the first place.

Later versions of Windows do not come with HyperTerminal. Several web sites claim that it can be easily transfered from an XP machine to machines running Vista or Windows 7 by finding and copying a couple of files. That is not likely to be true, but if you try [type "hyperterminal vista" into the Google search box], it probably will not harm your machine. HyperTerminal Private Edition 7.0, which works in Vista and Windows 7, is available (for $60!), but a better alternative, without features not needed for communicating with the PICAXE, might be something like Termite which has a look similar to HyperTerminal. It's FREE for personal and commercial use.

The program will then bring up a window asking how you would like to connect. Select Direct to Com1 (or Com2 - Com8). Note: If the same cable will be used both for programming and communication, the specified Com port must be the same as the port specified in the PICAXE Programmng Editor. If separate cables will be used, specify a different port. Do not enter any telephone numbers. (You may have to enter your area code.) Click OK.

Click file and save to save the connection settings. (Windows may suggest the appropriate place to save the settings. Go with the suggestion.) Find the .ht settings file (that you just saved), create a shortcut and drag it to the desktop.

[Note: It is not necessary to go through the steps to set up HyperTerminal each time it is opened. Simply click on the connection setup name (the name you gave it during the initial setup) and icon on the desktop to retrieve the settings and start HyperTerminal.]

HyperTerminal must be disconnected from the computer's Com port if the same port and cable will be used for programming the PICAXE. Do not disconnect the serial cable from the computer's Com port. Click on the little telephone to disconnect HyperTerminal. Minimize HyperTerminal.

Bring up the PICAXE Programming Editor. Copy the following program to the editor. Verify that the programming cable is connected to the correct port on the computer and the PICAXE board. Program the chip.

Reconnect the serial cable on the PICAXE board if necessary (move the cable from port 1 to port 2). Bring up HyperTerminal and re-connect (click the little telephone). Tap some keys on the keyboard. Each key tap should produce the corresponding character on the computer screen. It's that simple. You are now communicating with the PICAXE!

  • Verify Hyperterminal is connected to the correct Com port on the computer. If you are using the same cable to connect with HyperTerminal that you use for programming, the specified Com port must be the same as the one used for programming.

  • Verify HyperTerminal is sending and receiving data. Remove the programming/comm cable from the PICAXE board and place a jumper from pin 1 to pin 2 of the connector at the end of the cable (the PICAXE end of the cable). A paper clip works pretty well for this. This loops the transmit pin back to the receive pin. With the jumper installed, tapping a key on the keyboard should produce the corresponding character on the computer screen. If it does not, HyperTerminal is not connected to the correct port on the computer. If it does, there is some problem on the PICAXE board. Be sure the cable is attached to Port 2 on the PICAXE board.

This section demonstrates how the PICAXE can be used to communicate with other devices in a system. In this case the other device is the K107 LCD display controller, which many PICAXE experimenters may have acquired. (It could just as easily be another PICAXE chip. See some examples here.)The K107 Display ControllerThe K107 is the small board above the (4x20) LCD display.

The temperature code (get_temp) is shown here added as a subrouting at the end of the control code shown above, with a call to the subroutine after the "on" and "off" tests. Use the same code for reading the Centigrade (LM35) sensor. Since the ADC in the 08M can only read positive voltages, the code only works for temperatures above 0.

If you use HyperTerminal during a programming session and have arranged your PICAXE setup with two serial cables as I have, one for programming and one for communicating, you'll have to put up with some junk on the computer screen during the PICAXE chip programming process. If it's a problem, either disconnect HyperTerminal before each programming upload (with the little telephone) or use another pin, such as I/O 4 (pin 3), for communicating towards the computer. Press ENTER twice to get the prompt.

PICAXE products offer an attractive alternative to novices who lack experience using microprocessors and would like to learn more about them without a major investment in development tools and software training. PICAXE chips are Flash-programmed PIC processors containing a proprietary interpreter that offers powerful, easy-to-use, BASIC-like instructions. The chips are inexpensive, and the editing software for writing and testing the program is a free download. Ample info and tips are available in forums and published manuals. What else could you want?

Many hobbyists are reluctant to venture into new technology because of startup costs. A PICAXE provides a low cost way to get started with microprocessors. There is one catch, though. You may have assembled your first circuit on a solderless breadboard using only a few dollars in parts and written and debugged a program with the fun and exciting simulator built in to the free programming editor, only to discover that transferring the program from your PC into the PICAXE chip required a special USB download cable. This article addresses that issue.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages