PicForth Quick Start Guide for Windows Users

A quick and painless way to get PicForth running under Windows

What is PicForth?

PicForth is a Forth compiler for Microchip's PIC16F87x microcontrollers. If you've been programming PIC's in assembly and are now contemplating using a high-level language to increase your productivity, PicForth is an excellent choice. PicForth is open source, works well on Unix/Linux and on Windows (and possibly a few others), compiles well optimized code, and gives you lots of control. Among its virtues are two different cooperative schedulers for multi-tasking, and an in-line assembler so you can fine tune the critical parts of your application.

PicForth is written by Samuel Tardieu, and distributed under the terms of the GPL.

Step-by-Step Installation

  1. Download all of the following into a temporary directory:
  2. Install Gforth - Just run gforth-0.5.0.exe and accept all the defaults. It takes less than a minute.
  3. Rename the files "Makefile" and "COPYING" in "C:\Program Files\gforth" to "Makefile.gforth" and "COPYING.gforth", respectively. Then extract all the files from the picforth-1.2.4.tar.gz file (or whatever version you got) into "C:\Program Files\gforth" . WinZip can do this. Probably some others can too. If your browser added an extra ".tar" to the end of the file name, (mine did) remove it or WinZip will get confused.
  4. Extract the file "Unix2dos.exe" from the UDDU.ZIP file that you downloaded into "C:\Program Files\gforth". WinZip or any other unzipper will do the trick.
  5. Copy pfcompile.bat and blinkytest.fs into "C:\Program Files\gforth".

Take It For A Test Drive

  1. Open a dos prompt and make "C:\Program Files\gforth" the current directory.
  2. Type "pfcompile blinkytest" and press Enter.
schematic You should now have a "blinkytest.hex" file ready to write to whatever PIC16F87x series PIC that you happen to have handy. All it does is blink an LED attached to PORTA bit 0, so it's very easy to breadboard it if you want to see the program run in a real PIC.

Where To From Here?

That's all it takes to get to the point where you can turn PicForth source files into programmed PICs (assuming you have a working PIC programmer). What remains, of course, is learning how to write those source files. That is beyond the scope of this document, which is only meant to help you get PicForth running under Windows with minimum fuss. A good place to start is to take a look at the blinkytest.fs file to see what a very simple PicForth program looks like. Blinking an LED is the PIC equivalent of "Hello world!". After that, try these resources:

home | resume |

Valid HTML 4.01! Linux Powered Valid CSS!