FIGURE 2. PICBASIC Pro Basic Compiler.
• 4.5V battery pack
This project ended up going
beyond the $25 range, but only
because I included all the components
he needed along with the
breadboard, LCD, and battery pack.
Those were not part of his original
“under $25” description. I put together
the demo unit and the sample
package and sent it to him. He was
very pleased with the results, so I
thought I’d share this with the readers
of SERVO, as well.
I’ll step through the details.
of the package. It is very easy to use
and a great language for someone
just getting started. It uses the same
format as the BASIC Stamp PBasic
language but produces a binary file so
you can program blank PICs. The
PICBASIC Pro compiler has advanced
over the years to become just as
powerful as any other “professional”
compiler. What helped with the
package was the fact that you can
download a free sample version of
this compiler from http://melabs.
The sample version is limited to 31
commands but that is more powerful
than it sounds. Many of the features
you want such as driving an LCD or
reading a potentiometer with an
analog-to-digital port are reduced
down to a single command. That leaves
a lot of space in the 31 commands for
other things. A sample LCD example I
saw in the BS1 application notes took
27 command lines to drive an LCD.
That is a lot of space in the BS1 80
command limit. I knew this would be
the product for the school.
and program button. The MicroCode
Studio software handles this for you.
You can download this from the
author at www.mecanique.co.uk/
code-studio/ index.html, but you
don’t have to because the Microcode
Studio installation is included with
the PICBASIC Pro file you download.
When you install the PICBASIC PRO
software on your computer, it will
automatically offer to install the
MicroCode Studio software, as well.
After it is installed, you will be set up
to write your first program.
Figure 3 shows the MicroCode
Studio screen with the LCDsample.bas
code created for the demonstration.
MicroCode Studio IDE
The PICBASIC Pro compiler (Figure
2) was selected for the compiler part
PICBASIC Pro is just a compiler,
though. It needs a development
screen to make it easier to write the
software. The BS1 has a very nice
interface with a single click compile
FIGURE 3. MicroCode Studio IDE.
Once you write the program
and compile it with PICBASIC Pro,
you need to send it to the PIC
microcontroller. This requires special
hardware known as a PIC programmer.
The BS1 doesn’t require this since it
receives the tokenized code through a
serial connection. Most of the custom
chip options (like Basic Atom and
PICAXE) do something similar with
software known as a bootloader.
In the early days of PICs, the
hardware programmer was several
hundred dollars. This prompted
hobbyists to design their own. The
original “Tait” design was created by a
guy named David Tait. His design was
reproduced and sold by many people
for years. The Tait design required a
parallel port and a high voltage source
(16V) to program a PIC.
One of the more popular designs
to follow was the JDM design by Jens
Dyekjaer Madsen that powers itself off
the PC’s serial port which eliminates
the need for an external 16V supply.
Some laptops don’t offer enough
voltage on the serial port, so it is
recommended to use the JDM
programmer on a desktop PC. This was
not a problem for the high school as
they were using desktop PCs already.
There are a lot of variations to the
JDM design. You can get schematics
and board layouts with a simple
Google search of “JDM Programmer.”
Beginnerelectronics.com offers a
programmer kit for $19.95 designed
68 SERVO 08.2008