When I learned Arduino basics, I saw some nice small hobby robots based on Arduino and also on PICAXE. I did not know about PICAXE at the time. But I quickly realized that PICAXE is very popular in hobby robotic communities. After some time I read a few interesting articles about the basic principles of PICAXE and I decided to try and explore PICAXE. It looked quite easy.
In this instructable I'll show how to start program PICAXE, how to upload program into PICAXE and how to create a simple thermometer.
AXE027 USB Cable is inappropriately expensive (about 30 USD) in my country. If you don't want to buy AXE027, you will need this additional parts:
USB cable
See Step 4. where I'll descibe how to create cheaper alternative to AXE027.
PICAXE philosophy is the same as philosophy of Arduino. PICAXE are cheap microcontrollers for education, for beginners and hobyists. You can use standlone PICAXE chip or you can use some Arduino-like development board. For example see original PICAXE Project-Boards.
PICAXE chip has a buildin BASIC interpreter and bootloader. Programming language is BASIC. There is also Blocky language -- a Scratch-like visual programming, but I will ignore it in this instructable.
Uploading a program to PICAXE work on same principle like in Arduino. It is done using the bootloader and serial line (RS232). You need only AXE027 cable. (AXE027 cable has builtin USB to serial converter)
See very nice original Getting-Started guide.
For all details about PICAXE I highly recomend you also see the original manual and BASIC programming manual.
I also have to mention that PICAXE microcontrollers are not opensource like Arduino, so you can't look into deep and you can't create your own PICAXE clone.
See original PICAXE sofware catalouge.
Full integrated development environment (IDE). Best choice if you use Windows.
Elementary IDE. With Syntax check, Upload, Debug over serial.
Supports also Linux and Mac OS.
If you use original AXE027 cable, you have to install AXE027 driver. See instruction on PICAXE web site.
I use USB to Serial with CH340 from Wemos company. Drivers for this converter are here: https://www.wemos.cc/downloads
Another popular USB to Serial converter is with the FTDI chip. Instruction are for examle in tutorial How to Install FTDI Drivers on Sparkfun page.
In this step I describe how to create cheap alternative for original AXE027 cable. If you already own the AXE027 cable, you can skip this step.
When I tried to upload a program to PICAXE using a cheap USB to Serial converer for first time, it did not work. I tried to find out what's wrong for long time, but with no result. Everything seemed to be alright. After some searching on the internet I found out that PICAXE uses Serial interface with inverted logic compare to the TTL.
Most of USB to Serial converters uses TTL logic levels:
On the other hand, the original RS232 serial standard has logic levels defined as:
I guess PICAXE probably maintains compatibility with the original RS232, where the voltage for logic 1 is lesser than the voltage for logic 0. But that's just my speculation.
In any case, when I inverted signals (RX, TX), I was able to upload program without problems
You need a common USB to serial converter and a logic level inverter. As a logic level inverter I choosed common chip 74HC04.
See schematic in the picture above. Wiring shouldn't be hard. See also other pictures...
Make input pinout layout of your inverter matching your USB to serial converter output pinout.
You can see source code of the thermommeter in attachement (thermometr.bas)
I tried to write and comment the code well.
The code can be splitted to a several parts:
PICAXE contain direct support for special LCD with serial interface, where you can send data to shown via serial link, but doesn't contain support for LCDs with HD44870 driver. I also can't found a library for HD44870 on the internet. That's the reason why I wrote my own routines for handling with LCD1602.
Before first upload, make sure you have correctly connected two resistors to the Serial In. (I made a mistake in connection several times...)
PICAXE Edtior and AXEpad are user-friendly, so uploading program is very intuitive.
If the LCD display is now shining, but the temperature is not visible, try adjust the display contrast with the 10k trimmer.
PICAXE20M2 is an interesting, easy-to-use microcontroller. It is also quite cheap. Of course, BASIC is not a modern language and PICAXE BASIC has some pitfalls, but it has to be said that PICAXE was created at the time when most microcrollers could be programmed only in assembler.
I was surprised that I did not find an useable library for working with LCD display with HD44870. On the other hand, it moved me to study how HD44870 works. Programming routines to work with LCD with HD44870 was fun.