Probing the PICAXE, Part 1

Although the PICAXE has limitations from the viewpoint of professional applications, PICAXE platforms are pretty much ideal for the kind of stuff David gets up to in his workshop.

Memory-wise, the PICAXE chips offer fairly limited capacities compared to the huge memories available in other MCUs. To be fair, however, these devices are aimed more at the educational and hobby/DIY market than professional applications (click here to see a table detailing the capacities and capabilities of the various PICAXE chips.

Apart from bare chips, PICAXE offers various DIY kits and boards to get you started. There is a huge array of gear available, including add-on sensor boards and output devices. For instance, you can get various LCD output modules that only require a one-pin serial connection to the PICAXE.

There are various boards oriented towards specific tasks. The 28X2 PICAXE comes as a 0.3" 28-pin chip, but you can get a 0.6" board containing the 28X2 MCU, download socket, voltage regulator, and reset button that would be ideal for using on a breadboard. You can also get a 28X2 "Shield Base" board, which is compatible with Arduino Shields for expansion. All in all, there's some very tasty stuff indeed (click here to see an index of boards, chips, and kits -- use the small blue links under the "Product Codes" to get more information).

Back to my little kit. I got one of the smaller versions -- the AXE092 kit with the smallest 08M2 chip; three LEDs and a piezo sounder for output; and a switch and an LDR (light-dependent resistor) to provide digital and analog inputs. The assembly was very easy, thanks to the excellent instructions, and it would be even for someone with little electronics experience. Power is from a small 3xAA battery box (4.5V), though you could also use a 3-5V power supply. My kit's programming lead was serial (there is a USB version now, which is probably why my kit was so cheap!) But you can make up your own serial lead if you wish. Here is a schematic of my kit:

Observe that the schematic refers to the chip as an 08M, which is an older chip; mine came with the latest 08M2. The programming pins are 2 (Rx) and 7 (Tx). As you can see, Pin 7 (= port 0) is also used as a digital output. You can use the programming input, Pin 2 (= port 5, not shown above) for other purposes, but you then have to reset the chip (or use the BASIC DISCONNECT command) before programming it again. The AXE092 kit does not appear in the list I mentioned above -- I think it's been discontinued (again, this is probably why I got it so cheap), but there is a small User Manual available.

A photo of the AXE092 board is shown below (note that this photo was taken from the manual -- the LEDs on the board I built stand up straight and my resistors are all oriented the same way, LOL):

The AXE092 PICAXE Kit. The big black thing at the upper left is the programming socket. The small black thing at the lower left is a push switch. The DIP switch is for disconnecting outputs to use them for other things. The upper wires on the right-hand side go to the battery; wires on the lower right-hand side go to a piezo sounder.

It was at this point that I ran into my first problem -- I found my PC did not have a serial port. The Device Manager said that I did, but I could not find "hide or hair" of it. My motherboard manual also said I had such a port, but I discovered that was for a previous board version. Fortunately, I had a USB-to-Serial adapter knocking around, so I got that out.

David
When I saw your blog on the PCB, I hoped that you had become a blogger. This confirms it. Now you have to catch as well as pitch (field as well as bowl in your case).
Being too lazy to go and check it out (start of the weekend and all that) I wanted to ask if the Picaxe is in fact a standard Pic with a BASIC interpreter in firmware, much like Zilog And Intel had in year's past?
Also is it possible to descend into assembler?

Thanks Aubrey! Max is very persuasive.... Ref assembler - this is one of my questions that I will be investigating for a further blog, so you'll have to wait! I know it does let you access the different memories (PEEK and POKE statements), but I don't know how far beyond that you can go.

Why is the first question always one to which you have to say "I'll get back to you on that"? I always seem to do that when I'm on training courses.....so I guess it's karma.... :-)

Pretty cool, David. You model picaxe looks only two pins bigger than a dual opamp.

Glad to hear you're a BASIC afficionado. In case you didn't know, there's a very nice new version of BASIC from right in your own backyard: QB64. Virtually 100 percent compatible with MS Qbasic, even gives you that same familiar editor, but it goes a lot further too. Runs fine on 32-bit or 64-bit machines, MS, Apple, or Linux, and it's a compiled version.

These picaxe devices seem to have a language simiilar to older versions of BASIC, in which variable names were restrictive.

(Now you've got me questioning how I orient the resistors on my boards. Thanks a lot!)

Hello Bert, thanks. The PICAXE 08M2 is 8 pins, same as a dual opamp. and it has an internal resonator so all 6 pins apart from power can be used for I/O (with certain restrictions).

You CAN call your variables whatever you want, using a command, and I'll be dealing with that in Part 2.

I must look into QB64 though I have long had a hankering to learn Visual Basic. Structured program people will tell you that the GOTOs in BASIC are a no-no, and I do make an effort to avoid them in general use, but there's times they save you a lot more jumping through hoops.

I'd love to be a fly on the wall next time you are building something :-)

@adventures0 - sounds like you should have written this! I have found before that writing blogs like this, and maybe having some fixed goals in mind project-wise, is a GREAT way to learn. I am so impressed at the ease of use of the PICAXE and the wide range of sensors and peripherals which have purpose-made commands to simplify their use. It's going to be impossible to cover everything but I'm hoping to do a couple more blogs on them. Any suggestions on topics that you think would be good to cover would be very welcome.