6
PICAXE-08 ALARM PROJECT
revolution
© copyright 2002 - AXE102 Alarm Student Project Notes Version 1.1
Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk
6
Supported by:
How are programs written?
Programs are drawn as flowcharts or typed as ‘BASIC’ listings. This is is explained in the
programming section (section 3) later in this booklet.
How is the program transferred to the microcontroller?
The PICAXE-08 microcontroller is programmed by connecting a cable from the serial
port at the back of the computer to a socket on the printed circuit board (PCB) beside
the microcontroller. This socket (which looks like a headphone socket as found on a
portable CD player) connects to two legs of the microcontroller and to 0V from the
battery. This allows the computer and the microcontroller to ‘talk’ to allow a new
program to be downloaded into the microcontroller’s memory.
The socket and interfacing circuit is included on every PCB designed to be used with the
PICAXE-08 microcontroller. This enables the PICAXE microcontroller to be re-
programmed without removing the chip from the PCB - simply connect the cable
whenever you want to download a new program!
The circuit diagrams of PICAXE circuits often do not include the components above to
make it easier to understand the input/output connections. However the two resistors
and the socket are always built onto every PICAXE project board!
Output 0
With the PICAXE-08 system leg 7 has two functions - when a program is being run the
leg is known as output 0 and can control outputs like LEDs and motors.
When a program is being downloaded the same leg acts as the ‘serial out’ pin, ‘talking’ to
the computer. Therefore if you also have an output such as an LED connected to the leg,
you will find that the LED will flicker on and off as the program download takes place.
Note:
Most modern computers have two serial ports, normally labelled COM1 and COM2. The
Programming Editor software used to create the programs must be configured for the
correct serial port – select
View>Options>Serial Port
to select the correct serial port for
your machine.
If you are using a new laptop computer it may only have the newer ‘USB’ type connector.
In this case you must buy a USB to serial adapter to use the PICAXE system. These are
available from most high street computer stores or online from www.tech-supplies.co.uk
(part USB010).
x
x
x
x
x
PICAXE-08
7 - serial out
1 - serial in
8 - 0V
22k
10k
Above view
of socket