OLD Introduction to inexpensive microcontroller systems
This page is obsolete. Left on the web "for old time's sake". An updated version of the page is available via the link at the start of this sentence.
I think the following people may be interested in what's on this page:
People wanting to try- free- some quality software that will allow them to experiment with Pascal programming. Pascal is the foundation of Delphi and Kylix. The software would be excellent for use in schools. It is robust, and even beginners should get somewhere.
People interested in low cost electronics project development. Relatively "beginner-friendly"... though if you are really new to electronics, pester me for the page I intend to write called "Starting From Scratch with Pascalite Hardware".
People interested in microcontrollers, for example the PIC family.
People interested in any of the following: the Dallas 1-wire product line, the I2C bus, data logging, process control systems, alarm systems (burglar or other), weather monitoring.... and, not least: having fun with electronics (without spending tons of money)!!
The microcontroller systems discussed here are....
... and then, at the bottom of the page, I have some information and links to other PIC related products and sites including some Basic compilers, and notes about other ways to program PICs without having any of the systems discussed in the main sections of this page.
Arduino
The Arduino is a neat little microprocessor-based device that can do more than some of the "full" computers I worked with in the 80s.
It has been my "microprocessor environment of choice" for over two years, and I feel no "itch" to move on."
Not my finest hour as a technical illustrator, but here are pictures of two Arduino clones from Modern Device. I like both of them! (Do shrink the width of your browser window until the boards are shown life sized for the best effect. As I said earlier, these ARE seriously cool!)
If for some reason you don't think the Arduino is "the one for you" (see above for why I think it is)
... then here are some alternatives you might find of interest....
One alternative to Pascalite is the BasicStamp, from Parallax Inc. It is a product that has been around for a while, and seems to have "established" itself. (Some would say that the Pascalite is an alternative to the Basic Stamp!)
This is a similar device: A physically small device built around a microcontroller. It can do the same sorts of things. It is programmed in a variety of BASIC. It has digital i/o lines and a serial port.
It is a much more mature product, dating back to 1992. As such, it has more sophisticated support (their site is available in English, Spanish (Espanol) and Italian (Italiano), for instance) and a larger user base.
There's even Peter Anderson's "Homebrew Basic Stamp" "second source", offering something very similar. (Please don't read anything into that... I believe he's been around too long, and has too much to lose, to be up to anything that violates copyright. Take his product as vindication of the Basic Stamp's position as an established product. Peter offers many add on modules (LCD text, sensors, etc) and a library of application notes.)
As with Pascalite, you can download the relevant software for free:
I used to have a deep link here for you, with a button for downloading the BASIC Stamp Windows Editor from the Parallax site, but that link is no longer good. I'm sure if you go to the site and dig, you'll find the document. (It was a 3 meg file, but it only took about 8 minutes when my connection was reporting as 46k) You can download excellent documentation separately.
Surprise! When (a while back.... 7/03?) I went to install the Editor, the install process tried to access something over the web, and wouldn't proceed without being given web access. The program wasn't that important to me, so I can't tell you if it works, how it works. It didn't seem to have the simulator built into the Pascalite alternative.
A big "plus" for the BasicStamp, for some, will be the fact that it has more support for the Dallas 1-Wire devices (someday take a look at my page about those chips). It also supports the I2C bus. Both, however, I think, are only supported by the "Pro" version of the BasicStamp II.
With the BasicStamp product line, there is less NEED to purchase the Starter Kit. It IS very nice, with a range of nice bits and pieces, though. Part no. 27235, $199 for the BasicStamp2p ("p" for "pro") starter kit.
You can get the device at the heart of that for $79. (BS2P24). It is like a 24pin dip, and the pinout and necessary details are all in the freely downloadable manual. (The manual has good technical info, such as pinouts.) The software is freely downloadable. There is no "application" processor or board option. I had trouble finding any offer of a CD with editors, PC hosting software, sample code on the site, but I believe one is available. Check the site before pestering the suppliers.
Alternatively, if you can forgo the Dallas 1-Wire and I2C capabilities of the "pro", then the BasicStampII is a nice device. Part BS2-IC, cost $49.
With a BasicStamp, you might want to purchase an LCD module (#27910, $49), and/ or a RTC chip. (I forgot to get the price on this. Uses the Dallas 1302 chip, which isn't of the 1-wire family.)
It wasn't clear from the (limited) investigations I made as to whether the clock chip's connections (P0,P1,P2 suggested) clashed with the needs of the LCD module. I'd guess you could have both connected, but check that out, if important to you!
In February 08 I came back to my Homebrew BasicStamp, and couldn't find my cable! The following may help you if you are stuck or unsure. It isn't the "official word" on the subject... but it worked for me!
From left to right:
"C" Is the 9 pin D serial port socket on the back of your Windows PC. Then you have the plug of your cable. I put only four wires in mine, and it worked. (See note below about handshaking). The illustration shows the front of the socket on the PC, and the back of the plug that will go into it.
Moving across the figure to the right, we first see the back of the socket at the other end of the cable, and then we see the front of the plug on the BasicStamp (Peter Anderson's "Homebrew" version, anyway) into which the cable is connected.
Within Windows, tell your machine you want the serial port to be set for 57600 baud, 8 data bits, no parity, two stop bits and ** NO * flow control.
Within the Stamp, specify 9600 baud, 8 data bits and no parity. It won't ask you about the stop bits, and it won't let you change the flow control.
Yes, I know I specified different baud rates. I'd be inclined to set them both (PC and Stamp) to 38400... but what I've given above is what the devices tell me I'm using at the moment. It works, and I'm not going to mess with it!
All of the above with a Windows 98 machine, and PBasic 2.3.0, which thank heavens I was able to find on an old hard drive. I couldn't find it on the Parallax site 2/08, and their current PBasic won't install without something beyond Win98. With PBasic 2.3.0 and Peter Anderson's Homebrew BasicStamp, the {$STAMP BS2} and {$PBASIC 2.5} directives seem to be okay. They worked in a little program I wrote, anyway.
MicroChip, the inventors of the PIC line of microprocessors, have a good track record, and now they have a PIC with most of what you need for USB built into the chip. I haven't played with it personally, but know people who have. It looks like it shares many of the Arduino's virtues. I suspect you need a little more experience or determination to get started with it, relative to the Arduino or Basic Stamp. And creating your own USB devices will never be trivial, but if you want to give it a try, you should look into the PIC 18F4550. The Sparkfun experimenter's board looks like a fine solution to the hardware issues. ($38 at 2/10)
The device is made by Dallas... costs about $50 and is built on a card that goes into a SIMM socket! (You'll have to spend more to establish a good "development lab".) TINI is programmed with Java. It can be a web server. Imagine it: Your main PC networked (ordinary ethernet type net) to Tini, Tini monitoring and driving a 1-Wire system. With the internet browser of your choice, you can interrogate or instruct Tini. IT IS JUST TOO COOL! If you don't think so, apologies for my failure to explain! But that's another story! (And one that I didn't get very far with, over the years. Mostly pressure of time and budget.)
Apologies: My web pages have become a little confused. THIS page is a "get you interested" effort. If you are already interested, and want to know more about using a Pascalite, that information is in two places. Both cover hardware and software issues.
Hands On experimentation with a Pascalite (Most useful to people with one, but also, I hope, of use to people wondering what you might do with one. It has a big section on how to access various features of the Pascalite.)
Pascalite- the software
Hurrah! After a few years of not being able to find the Pascalite, in November 2010 I received an email giving me a link to a current Pascalite supplier! Happily, during the Dark Days, I'd left what I created several years ago, which follows.
(That's the good news. The bad news is that the site seems to be in the midst of resurrection, and large parts, when I looked (20 November 2010) were still in Dutch, and I couldn't find the HOW TO BUY ONE page!... but I have high hopes that this may be changing. It was a great little product!! Also, in the email I had, there was an intriging "BTW: MicroPascal is compatible with the Arduino". As a great fan of the Arduino, that caught my eye, too!)
First let me tell you a little about the free, software-only part of the Pascalite:
At the Pascalite / Control Plus site there is a great little product, the Pascalite. The Pascalite software package (only 480kb) gives you great little editor, an integrated compiler, and a software simulation of the target hardware. More on this later, but a quick example: Suppose you wanted to simulate a home control system. (What's done here could also be done on an Arduino.)
Assume the following inputs:
a temperature sensor which returns a voltage proportional to temperature,
a switch that the homeowner uses to turn the burglar alarm on or off,
a "someone in house" detector
... and outputs:
to turn the home heating on or off,
to ring alarm bell.
With the software mentioned above, you can write a suitable program to watch the house, keep the temperature above, say, 50 ° F when the alarm is on, but above 68 when the alarm is off. At the same time it can watch the "someone in house" sensor, and if the "alarm on/ off" switch isn't turned off within 30 seconds it can send the "ring bell" output high.
The analogue input and the digital inputs and outputs are all represented in the simulation with a nice virtual "panel" of switches, LEDs and sliders.
(Control Plus also offer a 10bit temperature sensing module for the I2C bus, which you could use.)
The software comes with a good helpfile.
That helpfile will tell you lots and lots about the Pascalite software and hardware. Once I've convinced you to download it, you won't really need to read most of what is on this page. (No, I don't work for the suppliers... I'm a retired teacher who thinks you're missing out on some fun.)
A word on terms: "Pascalite" is used to refer to the software and to the hardware.
AND IT GETS BETTER.....
All of the above sounds like fun, maybe, but perhaps just a bit like mere play. What do you want from something free?!!
Pascalite- The Hardware
If you spend a little money, you get hardware! And that hardware can accept the fruits of your earlier "play"... that hardware could be wired into real sensors and actuators in your home and provide, really, the system simulated earlier.
Once the new (11/2010) site has the "How to Buy" stuff more easy to find, I think, if they have maintained what they were doing before, you will find that your Pascalite life comes in two parts. (An analogous situation awaits anyone going down the Arduino line, by the way.) At the beginning, you buy a "starter", aka "development", kit. It contains what you need to get going... cables, programmer, etc. (But not a "power brick"... but that's no big deal. (The BasicStamp kit needs a power brick, too.) Development kits often include a few conveniences, e.g. a board with LEDs and switches with a connector to the main device board. This is for trying out things easily. (See "carrier boards" in the Pascalite help file. I'd recommend having one, unless you are on a really tight budget, and really good with making and assembling PCBs.) Once you have the development kit, you can turn out multiple projects based on the device at the center of all of this for much less. Think yourself back to the year 1700. If you wanted to be on the leading edge of technology back then, you bought a printing press. Once you had the press, (development kit), you could turn out books (projects) for minimal additional expense.
What I just said about the board with LEDs, etc, doesn't really apply to the Pascalite product line. More on this later. (And I'll try to edit this away, in due course, sorry!)
For the sort of project described in my example, you need a development kit. In "the old days" (2004... try the Wayback Machine someday! It lets you look at what a webpage looked like on a specific date. I had the thrill (sorry... you can call me geek) of seeing the server that hosts one of the two copies. Now THAT's a database! (I saw the copy in the great library in Alexandria, Egypt) Sorry! As I was saying... In the old days, the "get started" hardware cost was about $75. (Remember that you can use the software... including the simulator... for FREE). After that, in the old days your subsequent per project cost dropped to about $55... or lower, if you can make PCBs. (More on this further down the page.) In November 2010, I would be very surprised if the prices haven't dropped.
The development kit gives you what you need for one project, and unlike the paper and ink to make a book, the materials can be re-cycled to make subsequent projects. Likewise, if you buy additional application modules (the $55 (2004) expense), they can also be re-programmed as often as you like.
So much good news.... and the bad news is?....
If you want an LCD display attached to your project, that will cost about $65 to do the easy way. (Bad Old Days price.)
The simulator doesn't simulate the RTC module, and it costs $15 to add to a project. ("RTC": Real time "clock": returns time of day, and day/ month/ year. ('though "year" is just 0,1,2 or 3. Enough!).
The cheapest modules have fewer i/o pins than the fancy ones. Pascalite (2005... that may have changed) only supports reading the ID of 1-Wire devices... but that will let you use them for dongles or user id verification. I see no way to call a machine code subroutine. Quite understandable, but don't assume there's a way, if you were going to!
(If you want to work with a PIC and 1-Wire, the answer may be at picbasic.org. I haven't visited there, but I'm told....
The compiler has both 1-Wire read and write commands (Oread and Owrite). The person who wrote said he had the PicBasic Plus, and mentioned a more advanced ProtonPlus. He also said that the thought there was a free limited use download called PicBasic Lite, but that he wasn't sure if it supports the 1-Wire commands.)
More details of the hardware, including a guide to ordering a Pascalite...
followed by...
Details of Magenta's kits (Click here to skip to that,)
followed by...
Other PIC related products and sites, including some Basic compilers. (Click here to skip to that,)
More on the Pascalite hardware and software...
I really like the Pascalite IDE (Interactive Development Environment). It really isn't excessive to call it Delphi-like for ease of use. The language and hardware are not as powerful as Delphi, of course, but the IDE is as developer friendly.
First you just type in your program. "Syntax highlighting" is built in- words like "program", "procedure", "begin" and "end" are in bold. Other special words (known to Pascalite, but not common in many Pascals) are shown in blue. (For years I used Notepad- no syntax highlighting- for many jobs. Now I use Textpad because it comes with syntax highlighting for everything I do... and the facility to define custom highlighting schemes should the need ever arise. ( Textpad's site. Shareware, c. $30)). When you're ready to try your code, you press F2. If the compiler spots a problem in your code, you get an error message, the relevant sourcecode is shown in red, and you're bounced back into the editor. If the code compiles, the virtual panel comes up, allowing you to see what's on the virtual outputs (including RS232 channel and LCD screen) as the program progresses, and allowing you to set or clear the virtual inputs, digital and analog.
You can single step the program, i.e. step through it a line at a time to see what's going on. There's also a "watch" facility: A window comes up on the screen telling you the current values in your variables.
Just in case you're thinking otherwise, I should point out that this system will never be suitable for writing a new word processor, or successor to Quake. It is intended to be the brains at the heart of electronics reading inputs and responding by changing the state of outputs. Typically the inputs will be switches or environmental sensors and the output will be numbers, messages, or the turning on or off of other electronics.
Be sure to look through the help file to see the sort of things you can do with Pascalite.
Turning to the hardware:
(This information is also available in the help file.)
Even the "baby" of the family, based on 8 pin PIC12C672, has...
One line for digital i/o OR 8 bit analog input
Another line for digital input
I2C bus. Through that, you can add RTC, LCD additional i/o lines, etc
RS232 communication
(Note: Neither the I2C nor the RS232 impinge on the2 i/o lines mentioned above)
the "mid-range" device is similar, but has 8 i/o lines, 4 of which can be used for analog input, and a 8-bit counter which can generate an interrupt on overflow. 18 pin PIC16C715.
So... what's keeping you? Go download the FREE software and look into this more fully!!
If you want the hardware. Prices in Euros (E). A Euro (April, 2002) is worth about 9/10 of a US $:
I would buy a Pascalite II Plus Starter Kit, SK-PLS, E84 (i.e. costs 84 Euros(2002 price). The "development board" is essential, not the more optional board with LEDs and switches sometimes included in "starter kits" from other mfgs. If you're willing to download the software and provide your own pc-to-Pascalite RS-232 cable, you can save yourself E11(2002 price) by going for the DB-PLS.
After you have a development system by one means or another, you are in a position to use "Application Microprocessors" and "Application Boards". The processor is JUST the PIC you need, along with some software to accept your program. Think of it as an OS. Cost for the "Plus" level device:E12(2002 price) (Pt no. AP-PLS). However, the processor alone is of little use, unless you are manufacturing dozens of a device that will have it sitting in a socket on a bigger PCB.... including, at least, an EEPROM. What the hobbyist and developer is more likely to want is part number AB-PLS, cost E61(2002 price). This is the application processor mounted in a small PCB which also carries the necessary EEPROM, and has connectors to the outside world. Have a look at the pictures on the website. I know... E49(2002 price) is E49, but think about the hassles just of making the equivalent, not to mention finding your mistakes.
Other goodies I'd want:
(Maybe) LCD module: LCD204, E69(2002 price)
RTC: CLK-A, E19(2002 price)
(Maybe) I2C temperature sensor: TEMP-A, E11(2002 price) (Remember the Pascalite has analog inputs.)
Magenta Electronics
For many years (as of 2007), Magenta Electronics has been producing kits for schools and hobbyists since 1975. While there is no connection, afaik, between them, Magenta has regularly supplied PCBs and part kits for the projects explained in the excellent Everyday with Practical Electronics (EPE) magazine. Both Magenta and EPE are in the UK, but some of my readers are too, and with credit cards and airmail, who cares?
Magenta produces many good kits, some suitable for every skill level, but among them are several PIC programmers. As you would expect, both the EPE and Magenta sites have links to tutorials, compilers, sourcecode.
Other PIC related products and sites, including some Basic compilers....
In this section, some brief notes about some other ways to program PICs....
For about $30 US, and outfit called Celestial Horizons used to offer an interactive Basic compiler for PIC microcontrollers. They told us that you can enter the Basic code and immediately see the translation to PIC assembly language.
There was a downloadable manual and trial version, which is just limited to 20 lines of code. I don't think there's any Pascalite-type simulator.
I wrote the basis of the previous two paragraphs a while ago... 6/03? The link that worked then was: http://www.celestialhorizons.com/compilers/Bronze/bronze.htm. I hope the product is still available. The link was wrong at 5/07, but I didn't hunt with Google. At 2/08, a page of frames with broken images loads from www.celestialhorizons.com
Sigh.
Seetron has lots of links to good stuff... PICs, interfacing, programming, etc.
At around 6/03, many people seemed to be selling something called the PicBasic Compiler by MicroEngineering Labs, of Colorado. The link was troublesome 5/07, but, hurrah! At 2/08, the site seems "normal"... but the compiler, in the version with the BasicStamp II commands, costs $250. There is a demo which can compile 31 lines of code.
Basic Micro has also long been worth checking out for PIC software, etc. Among other things, they offer a BasicStamp 2 pin compatible device for $49.
A Linux person posted the following, but I haven't seen any sign of the project coming to beta or fruition. Sadly, at 2/08, the page is still there, but reads "Coming soon..." and "Page updated 2003". I only leave this mention in place in case someone can direct me to something similar that is "alive".
Work is progressing on a compiler which will implement a simple BASIC/MODULA2/Pascal language here called SIL. The compiler translates the SIL program into PIC16C84 assembly language. The assembly language contains all high level language constructs as comments. For example, WHILE loops
the body of the loop are marked to allow the user to easily continue working with the assembly language code. The compiler is being ported to LINUX and completely re-written in the C-language. The source code will be available according to GNU copyright rules.
Dontronics seems to be one of the second sources for PicBasic, but note all the other stuff they offer, too.... especially the free book.
PICmicro Basic Compilers
mEL PIC Basic Standard
mEL PIC Basic PRO
CH-BASIC-Bronze
CH-BASIC-Flash
PICmicro Basic Misc.
Codedesigner Editor for mEL Compilers
Basic Stamp One Compatible Source Code
PICmicro C Compilers
WIZ-C C Compiler by FED (formerly PIXIE)
NEW, User Group, 14 bit PIC's and PIC18CXXX 16 bit core PIC's
WIZ-C Professional
PICMicro C Cross Compiler by Hi-Tech
PICC-18 C Compiler by Hi-Tech
CCS C PCM Compiler for 14 bit parts
CCS C PCB Compiler for 12 bit parts
CCS C PCH Compiler for PIC18 parts NEW
CCS C PCW Windows Compiler (Windows IDE with both PCB and PCM)
PICmicro Assembly
Scott Edwards PIC Source Book/Disk. Free On Line
This page is obsolete. Left on the web "for old time's sake". An updated version of the page is available via the link at the start of this sentence.
Ad from page's editor: Yes.. I do enjoy compiling these things for you...
hope they are helpful. However.. this doesn't pay my bills!!! If you find
this stuff useful, (and you run an MS-DOS or Windows PC) please visit my
freeware and shareware page, Sheepdog Software (tm), download something, and circulate it for me?
At least (please) send an 'I liked the parallel port use page, and I'm
from (country/ state)' email? (No... I don't do spam)
Links on your page to this page would also be appreciated!
Don't forget to check out the programs for controlling the state of the parallel port at my shareware site. There are two free programs there... one for toggling bits, the other for using the computer as a timer via the parallel port.
Here is how you can contact this page's editor.
Click here to go up to general page about electronics by editor of this page. Click here to go up to general page about electronic projects by editor of this page.
Why does this page have a script that loads a tiny graphic? I have my web traffic monitored for me by eXTReMe tracker. They offer a free tracker. If you want to try it, check out eXTReMe's site. The Google panels and the search panel are also script based.
Page tested for compliance with INDUSTRY (not MS-only) standards, using the free, publicly accessible validator at validator.w3.org