PICAXE Data Logger Code PDF Print E-mail
Written by Stuart Allan   
Saturday, 21 March 2009 22:24

This article contains all the code to run the modified PICAXE Data Logger that I have built. The device is based on the PICAXE 18X chip which is an 18pin PIC microprocessor. The other parts of the system are fairly basic; Digital temperature sensors (DS18B20) that communicate via a 1-Wire bus, a Real Time Clock chip (DS1307) and EEPROM (24LC256) that both use the i2c (2-Wire) bus.

The output is sent to a 16x2 LCD screen and to a computer via a normal serial bus.
The add-on memory expansion board is used to increase the total memory to 2MB. There are a total of 8 24LC256 EEPROM's.

One really important thing! -> One of the first things that this code does is change the frequency of the 18X's internal resonator to 8Mhz. This effectively over-clocks the chip. This is done to speed up the serial data transfer to the computer, but presents two issues:

1. The first time you download the code to your 18X chip, it's speed will be 4Mhz. So if you are using the Windows IDE you can leave the chip speed at it's default setting. From the first time the chip runs the program though, it's speed will be changed to 8Mhz. You will not be able to download any other program to the chip until you change the chip speed in the Windows IDE to 8Mhz! Mac OS X and Linux users avoid this issue.

2. The PICAXE manaul says that the DS18B20 temp sensors will not work at any speed other than 4Mhz. This is not entirely true, as the code below runs at 8Mhz and the sensors are fine. The problem is that the first ReadTemp12 command throws back an error from the sensor (85). After that everything is OK though. This is why I have done a dummy read on each sensor before the ouput is displayed for the first time.

Other SCPedia articles relating to the same Data Logger:

Schematics (Circuit)

Finished Project

 

The firmware file listed below can be used to download the firmware into your PICAXE data logger. All you need is the correct software to do it. The PICAXE website has several integrated development environments (IDE's) to choose from. They all compile the same Basic code and then download it to the chip.

Current Version:

Temp Logger 1.2

 

Older Versions:

Temp Logger 1.1

Temp Logger 1.0

Last Updated on Monday, 08 June 2009 23:56