Interfacing PicAxe MicroController to Just Basic (Liberty Basic)

rbright

Member
Serial data collection and presentation in graphical form is something a lot of people desire. If this included yourself consider the free sources

available on an Australian site as being used for logging wind driven generator data including Volts, RPM, Amps etc.
http://www.thebackshed.com/Windmill/PicLog4.asp down the bottom of this page is a download link to the circuits & code.

Basically the system uses a simple 8 pin PICAXE circuit (08M) to collect the data as both AC & DC Volts or Pulse Input - Refer to downloadable circuit.

The PICAXE Basic code collects the data and converts it into a serial stream as follows:

Start:
SYMBOL Volt = W0
SYMBOL Amp = W1
SYMBOL RPM = W2
SYMBOL WSpeed = W3
SYMBOL Checksum = W4

Main:
readadc10 4,Volt
readadc10 1, Amp
Count 3, 1000, RPM
Count 2, 1000, WSpeed
Checksum = Volt + Amp + RPM + WSpeed
sertxd("[<V>", #volt, "</V><I>", #Amp, "</I><R>", #RPM, "</R><S>", #WSpeed, "</S><C>", #Checksum, "</C>]")
goto main


The Just Basic (Liberty Basic) code then collects this serial data & stores it in log files (see PicLog.exe) which if you wish you should be able to import into Excel but alternatively use the downloadeable EXE file (see PicGraph.exe) to open the log file - zoom into a time range - then present in graphical form. The code also provides facilities for setup, calibration etc.

As mentioned the provided application is based on logging a wind generator BUT the PICAXE code & circuit could be any analog data - just consider how

various sources of raw data can be inputted to PICAXE by looking at the schematic.

Then equally as simply the JB (LB) code can be adapted to graphically present and data from a delimitted log file.

Regards.... Ray Bright
 

Goeytex

Senior Member
I downloaded and have been messing around with both Just Basic and RobotBasic.

Just Basic is a bare bones BASIC that generates tokenized code. It is simple to use and supports Serial I/0 and File I/0 in the PC. I had a simple terminal program done in about 2 hours and was interfacing a Picaxe 20x2 with Windows X/P using serial commands from the Picaxe. It can be a fairly easy way to interface a Picaxe with a PC. Not a problem, for example, to write a program that builds a graphics "radar screen" for an Ultrasonic Radar.

Robot Basic is much more powerful but also more complicated. But it can generate a stand-alone .exe to run on Windows. It supports File I/O, serial I/O, Bluetooth, and Internet protocols. Has better error handling and a better IDE & Editor. Lots of built in math functions for doing conversions like distances, weights, etc. Even with more complexity than Just Basic, with a quick read of the manual I had a simple Serial Terminal Program up and running in a few hours.

Either one of these can allow a Picaxe to access the file system on a PC via serin /serout and send text to the screen, draw graphics/sprites on the PC Monitor, and do floating point maths. Add wireless modules to the Picaxe Project and do it remotely. And with RobotBasic access the Internet.

Both are completely free.
 
Top