Browse over 10,000 Electronics Projects

Using PIC Forth

Using PIC Forth

If you program the PIC, there is one programming language that builds a simple idea into a powerful system and still gives you a great deal of control over your program: Forth.
You probably use assembly language. Assembly language is great because it gives you such control over the processor and its resources. Most high-level languages force you to compromise, and you wind up with bigger programs (which means fewer features on a chip with 4 or 8K of program space).

Forth isn’t new — it has been around seemingly forever. But it is extremely well-suited to small processors like the PIC.

I had started writing a Forth system for the PIC about a year ago. It wasn’t the first Forth I’ve written, and I did get a version of it working. However, I stumbled upon an open source project called PIC Forth (by Samuel Tardieu) that is based on the GNU gForth compiler. It was so amazing, I gave up on my pitiful Forth compiler.

Forth is a great language to run with our GPMPU28 or APP-II boards. It targets any 16F87x processor. It has plenty of features including two ways to write multitasking programs!

If you are running Linux, it is pretty simple to install gForth and PIC Forth following the instructions. If you are using Windows, just download the Windows binary for gForth (see the link to the left). The current Windows version is gforth-0.5.0.exe. Then you can simply grab gForth from its home page.

If you are using Cygwin (and if you are a Unix/Linux guy running Windows you HAVE to have Cygwin) the situation is a bit more complicated. You can grab the source distribution of gForth.


Visit Here for more.