Getting Started

Hello and welcome! I've put together this collection of interesting projects showing just a few of the things the PIC Micro Pascal cross-compiler is capable of. If you work through them sequentially, like I did when first learning the language, you'll come away well prepared to tackle your own circuits. It's a fun journey and rarely leads to scurrilous language.

My aim is tripartite:
  • to help you learn about the PIC microcontroller,
  • see some cool hardware/interfacing techniques, and
  • discover the power of the PIC Micro Pascal language.
Just so you know, I'm an independent wayfarer on the PIC journey and have no other connection with the package, other than that I love using it. PIC Micro Pascal (PMP) is in fact the creation of Philippe Paternotte of France. He's done a magnificent job of putting together a comprehensive compiler, editor and IDE. I have been involved with microprocessors since 1981 and can unequivocally state that PMP is top of the line. And it's free of charge!

Why do I give PMP high marks? Several reasons.
  • Pascal is highly structured and encourages sound coding practices.
  • Hey, those local variables can't be beat!
  • And unlike C, it is incredibly readable; source code flows almost like a story.
  • PMP is highly optimized. It always creates small and/or fast executables.
  • Procedures, functions, units and libraries make building complex projects from simpler ones sensible, logical and incremental.
  • It compiles fast as hell, typically done by the time you lift your hand from the mouse.
  • And again, it's free, yet does everything you'd expect from a commercial package.
My projects here begin very simply; an LED and resistor are all you need at the outset. By the time you get to the end, however, you'll be doing things with motors, sensors, displays, wireless, MIDI and more.

What You'll Need


So, what are you waiting for? Latch onto a microcontroller (I've used the PIC16F88 throughout since it's commonly available, inexpensive, yet quite powerful), then download the PIC Micro Pascal package from the following link and get going!

There are a couple things to keep in mind as you commence your journey. First off, the download site, just mentioned, is a trifle scattered; you'll have to poke around a bit to find the download you want. Likewise for finding the manual.

Which version? All of the projects here have been tested with Version 2.0.6 which is quite steadfast. The newest version, 2.1.4, is still not shaken down completely, and moreover includes some syntactic changes which I haven't figured out yet. So, stick with the older of the two as you work through these exercises.

Go here to download PMP: http://www.pmpcomp.fr/

Install it on a Windows computer, then come back here to begin exploring with a number of cool projects. Also, I highly recommend printing out the manual and keeping a pencil handy. PMP is accessible, but deep!

And there is a forum there where you can ask questions, but I've noticed that the responses are often quite crabby if you don't know the protocol. Don't let it bother you too much! Some of the other users there are quite friendly and willing to help a newcomer along.

When first installing PMP, you have the additional hurdle of setting up the IDE, things like indicating default directories, connecting to the PIC burner, installing the assembler and so forth. The manual is a great help here, but so is plain old-fashioned experimenting. Believe me, it's worth it! And once you have that out of way, PMP really is a breeze to use.

About These Exercises


For each of these projects, you can download a schematic and the complete source code; links are provided on each page. These are stored in two separate public directories giving you free access. I would appreciate it, though, if you don't copy or distribute these files, but instead point others to this page.

For reference, the schematics may be found in Schematics and the zipped source code is in Source Code.

As for getting around, there's a pull-down menu bar at the top of this screen listing every project. If that's too detailed for you, then on the right you'll find the exercises organized by category. Notice that each project concludes with a link to the next so you can read them sequentially like a book if you want.

So have at it, and get ready for some genuine fun with the PIC in Pascal!

First Project: Blinking and Fading LEDs

No comments:

Post a Comment