You are on page 1of 11

PICAXE VSM Tutorial – Part 2

PICAXE VSM Tutorial – Part 2

Installation

To install the PICAXE VSM software download the demo installation package (18MB)
from www.picaxevsm.com If you are on dial-up internet and prefer a CD your local
PICAXE distributor should be able to oblige. The software is designed for Windows
2000, XP, and Vista. (95, 98 and ME are not officially supported, however users have
reported that the software does run on these older Windows versions).

The software will run in restricted ‘demo’ mode until you purchase a licence key (you
can still use the Rudolph simulation sample described below in demo mode).

Registration is also carried out online at www.picaxevsm.com via secure credit card
transaction, you will receive an email with your key shortly after purchase. Use the
PICAXE VSM ‘Licence Manager’ utility to install your key and ‘unlock’ the full version.

Figure 1 – PICAXE VSM screenshot

© Revolution Education Ltd 2007 www.picaxevsm.com 1


PICAXE VSM Tutorial – Part 2

Let’s Begin!

PICAXE VSM is a powerful piece of software, and so will naturally take a little while to
learn. To get started the most important thing is to be sitting comfortably with one hand
on the mouse and the other on the keyboard! As with most graphics packages the
software uses keyboard shortcuts aswell as the mouse. These take a little while to get
used to, but you will very quickly learn the shortcuts and appreciate how they speed up
use of the software.

So to learn basic navigation lets start by opening the existing ‘AXE107 Rudolph.dsn’
example from the /samples/(Demo Version Samples)/PICAXE folder. Then move the
mouse over the design and press the <Z> zoom, <U> unzoom and <P> pan keyboard
keys as you move the mouse around the design – see how you can zoom in and out very
quickly by using keyboard and mouse at the same time! If you are already familiar with a
different graphics/PCB application that uses different shortcut keys, you can easily
customise ‘PICAXE VSM’ to your preferred shortcut keys. To do this use the
‘System>Set Keyboard Mapping’ menu.

Object Selector

Whilst the sample design is open, let’s look at the different parts of the screen. The main
design area is obviously where you draw and edit your designs. To the left of this is the
‘Object Selector’ list, that lists all objects (components) currently used in the design.
Above the ‘Object Selector’ is the ‘Overview’ window, which we will look at later.

At the top and left of the screen are menu bars, and at the bottom of the screen is the
‘animation control panel’. This looks like the buttons on a traditional tape recorder
(remember the days before CDs and MP3s?!) – Play, Forward, Pause and Stop.

Simulation

Figure 2 – animation controls

Click on the ‘Play’ button at the bottom left of the screen and the Rudolph simulation will
compile and start. When you click on the animated push button switch a tune will play on
the piezo sounder (simulated via the computers speaker) and the LEDs will flash. The
actual tune played will be decided by the resistance of the LDR – varying light levels are
simulated via the up and down buttons beside the LDR (you may wish to zoom in using
the <Z> key)

© Revolution Education Ltd 2007 www.picaxevsm.com 2


PICAXE VSM Tutorial – Part 2

Whilst the simulation is playing click the ‘pause’ button at the bottom of the screen. This
will pause the simulation and open up a number of other ‘debug’ windows, which show,
for instance, the variable values and the PICAXE program. (Tip - you can select which
PICAXE windows are automatically displayed by checking them in the ‘Debug’ menu
whilst the program is paused).

Figure 3 – Paused program, looking at program lines and variable values

If so desired you can now also step through the PICAXE program line by line, by
clicking on the ‘Step into Source’ button on the Program window. You can also run at
full speed again by selecting the ‘Running Man’ run button.

Whilst the Program window is open, practice setting ‘break points’ by clicking at the left
hand side of any program line – a red circle will appear. This means the program will run
until this particular point and then stop – ideal for debugging those problem programs!
Try it out!

One final tip for simulation, if you want to step through a program line-by-line right from
the start, simply click ‘pause’ (rather than ‘play’) to start the simulation. This will start
the simulation and automatically break on the first program line.

© Revolution Education Ltd 2007 www.picaxevsm.com 3


PICAXE VSM Tutorial – Part 2

Our first circuit!

Now click ‘File>New Design’ menu and select the default template layout (this gives you
a blank A4 paper size layout). It is good practice to give your design a title, so use the
‘Design>Edit Design Properties’ menu to enter a title, revision number and your name.
Also save the file now, and remember to keep saving every so often as you work through
creating your masterpiece!

Figure 4 – Design Properties

Now we need to build the design. To start with we will just create from scratch a straight
copy of the existing Rudolph design – you may find it useful to print it out to copy.

The first thing is to add parts to our ‘Object Selector’. To do this click on the small ‘P’ at
the top of the ‘Object Selector’ (which is a shortcut for the ‘Library>Pick Device’ menu).

© Revolution Education Ltd 2007 www.picaxevsm.com 4


PICAXE VSM Tutorial – Part 2

We now have a list of 10,000+ components to search through. This could be daunting,
but fortunately a very powerful search facility and special ‘PICAXE’ category enables us
to quickly locate the parts you want! Start by typing in ‘LED’, and then click on the
‘PICAXE’ category. You will then have a much smaller list to choose from!

Figure 5 – Device selector

Double click on LED-RED and LED-GREEN. This will add then to the Object Selector.
Delete the ‘LED’ text and change to ‘resistor’, then click on the PICAXE category again.
Double click on the 330, 10k and 22k resistors. Then repeat this process for all the parts
in Figure 6.

Figure 6 – List of components required

© Revolution Education Ltd 2007 www.picaxevsm.com 5


PICAXE VSM Tutorial – Part 2

Figure 7 – PICAXE chip alternate symbols

Note there are two options for the PICAXE chip, either ‘traditional’ schematic format
(which has the power pins hidden) or ‘IC’ layout. Choose whichever you prefer, then
close the ‘Pick Devices’ window. Note that the power pins on the IC layout are actually
cosmetic, the simulation will run if they are connected or not!

Let’s draw!

First job is to drop the parts onto the screen, copying the Rudolph design layout already
used. Leave plenty of space between components to start with, you can always ‘tidy up’
later.

To select the first part to drop, click on it in the ‘Object Selector’. A preview of the item
will be shown in the ‘Overview’ window. Then move over the design and click to drop it
in place. You can then click again to drop another of the same component straight away,
or select a different component from the Object Selector. When all the components are
placed click on the ‘Selection Mode’ arrow (top of the left hand toolbar) to move out of
‘Component Mode’ (tip - you can also use the shortcut key ‘Spacebar’ to move back to
selection mode)

© Revolution Education Ltd 2007 www.picaxevsm.com 6


PICAXE VSM Tutorial – Part 2

If required components can be rotated and mirrored to make a neater schematic. To do


this right click over the component and select the appropriate popup menu option.

Figure 8 – right-click mouse menu

Your components names (R1, R2, R3 etc) should automatically be added as the
components are dropped. If you just get ‘R?’ instead of a number make sure that
‘Tools>Real Time Annotation’ menu is enabled. If necessary ‘R?’ can be changed to a
number simply by double clicking the label and editing.

You will also need to add a couple of ‘Ground’ and ‘Power’ terminals. To do this right
click the mouse and select Place>Terminal>Ground and then Place>Terminal>Power.
The default power rail is always 5V, if you want to change this (e.g. to 4.5V to simulate
3xAA cells) use the ‘Design>Configure Power Rails’ menu.

© Revolution Education Ltd 2007 www.picaxevsm.com 7


PICAXE VSM Tutorial – Part 2

Wiring

Finally we need to wire the components together. Make sure no part is currently selected
(a useful tip is just to click on a blank part of the screen to clear any selection) and then
move the mouse over a component pin. The mouse cursor will change to the ‘pencil’
shape and you can then click to start the wire. Move the cursor to draw the wire, clicking
wherever you want to fix a corner. Finish the wire by clicking over the second component
pin (or on to another wire). You cannot draw wires over labels or components, so always
leave plenty of room between parts. The wires will automatically move if you later drag a
connected component, so it is easy tidy up designs at a later point.

To delete a wire simply right click and select delete. Segments of wires can also be
individually dragged when the wire is highlighted.

Note that to prevent accidental mistakes you must specifically wire all parts together.
Two components pins placed ‘overlapping’ each other will not be ‘electrically’ connected
within the design.

PICAXE Program

Before the simulation can run we need to allocate a PICAXE program to the PICAXE-
08M component. This is carried out via the ‘Source>Add/Remove Source File’ menu, but
first you have to type in and save the PICAXE BASIC file you want to use! This can be
carried out using the normal PICAXE Programming Editor software, or the simple
‘Source Editor’ application provided with PICAXE VSM. Type in the test program
shown in Figure 9, and save it as a .bas BASIC file in the same folder as your .dsn design
file. I would recommend you always use the same filename stem to avoid confusion.

Figure 9 – Source Editor

© Revolution Education Ltd 2007 www.picaxevsm.com 8


PICAXE VSM Tutorial – Part 2

Back within PICAXE VSM select the ‘Source>Add/Remove Source File’ menu and
make sure the PICAXE chip (e.g. U1) is highlighted as the target processor. Then click
‘New’, select your file and then click OK.

Figure 10 – Assigning the source file.

If you now go back to the ‘Source’ menu you will see your program file is now listed
within the menu. If you click on the filename it will now open within the ‘Source Editor’.
This is a very useful shortcut if you want to tweak and save modifications to your BASIC
program whilst simulating and testing.

Run Your First Program.

Click ‘Play’ and if all is well your two Rudolph eye LEDs should now start flashing
every second! Congratulations, that is your first PICAXE VSM design created and
simulated. To have a play with the LDR, switch and piezo have a look at the example
BASIC file provided within the ‘AXE107 Rudolph.dsn’ sample design file.

© Revolution Education Ltd 2007 www.picaxevsm.com 9


PICAXE VSM Tutorial – Part 2

PICAXE VSM TIPS & TRICKS

The ISIS schematic drawing software for PICAXE VSM is an extremely versatile
application. However it will naturally take some time to learn all of its capabilities. The
following tips and tricks may be useful when starting off:

• Always study the example files to get a feel of the software before trying to draw
your own schematic.

• The software is designed to be used with two hands, one hand on the keyboard,
one hand using the mouse. To navigate around the design use the keyboard
shortcut keys to Pan, Zoom In, and Zoom out. These keys can be used even
when, for instance, drawing wires with the mouse. These shortcut keys can be
changed to your favourite combination via the ‘System>Set Keyboard Mapping’
menu. The currently selected shortcut keys can be identified via the ‘View’ menu
items.

• Most common actions can be carried out by right clicking the mouse (either on
the design for general options or over a component for object specific options).

• If you find it difficult to start a wire from a component pin, you may have an
object selected. Simply click on a blank part of the screen to de-select any object.

• Whilst drawing wires you can left click to ‘fix’ a corner position. Wires cannot be
drawn over component or names, so leave plenty of space between components.

• To move a wire click on it to select it. Then move the mouse to the part of the
wire you want to move and drag that section of the wire.

• If you find it difficult to drag a small animated component (as it operates when
you click on it), simply right-click over it and select ‘Drag Object’ instead.

• Components can be rotated and mirrored by right-clicking on the component,


‘mirroring’ a component often helps to make schematics neater.

• Make sure the ‘Tools>Real Time Annotator’ option is enabled to ensure all new
components added to the design are given a unique number (R1, R2, R3 etc.). If
this option is not enabled each component will appear as R? and will need to be
manually edited.

• To locate a component type part of its name in the ‘Library>Pick Devices’ menu
(or via right-clicking the mouse). This will then bring up a list of all the parts
available. Where possible use parts from the PICAXE libraries, so clicking on the
PICAXE category will reduce the options available.

© Revolution Education Ltd 2007 www.picaxevsm.com 10


PICAXE VSM Tutorial – Part 2

• To add ground and power symbols to your design right-click and select
Place>Terminal. By default all IC power pins are ‘hidden’ – the software
automatically connects them.

• The default supply voltage is 5V. This is defined by the ‘Design>Configure


Power Rails’ menu.

• Two components can be linked by two terminals instead of a wire. Place a default
terminal at each end and give the two terminals the same, unique, net name. This
can help to make larger schematics more readable. This process also works over
multiple sheets in the same design (to add or move to different sheets use the
‘Design’ menu).

• The PICAXE variable windows, program listing break-points etc. can only be
viewed when the simulation is running and paused. To ‘pause’ a program
immediately click the pause (rather than play) button to start the simulation. The
various PICAXE (and other component) windows can then be viewed (use the
Debug>PICAXE menu to select which windows are displayed automatically upon
a pause).

• To post a schematic on the www.picaxeforum.co.uk forum for advise it is better


to convert to jpg format first (.dsn designs may however also be uploaded to share
with PICAXE VSM others). To do this simply use Edit>Copy and then paste into
a graphics application (such as Paint supplied free with Windows). Then save the
file in .jpg format.

What is a ‘digital resistor’?

On many PICAXE designs pull-up and pull-down resistors are used to, for instance,
prevent an input pin floating when used with a switch or to pull the PICAXE reset pin
high. In these cases you are often not concerned about the analogue SPICE calculations
involved with this resistor e.g. the current flow in the resistor. Therefore to reduce the
SPICE simulation overhead in the design the resistor can be marked as ‘digital’ instead of
‘analog’ (Right click > Edit properties > Model Type). This tells the software to only
consider the digital pull-up/pull-down implications of this resistor. Therefore the
simulation will still operate as you expect, but the overall processing required in the
software can be significantly reduced.

© Revolution Education Ltd 2007 www.picaxevsm.com 11

You might also like