on a PIC
This is surely the golden age of DIY electronics
— especially for newcomers starting out on a
shoestring budget. Free and open source
software abounds for drafting schematics,
designing printed circuit boards, simulating
circuit operation, turning laptops into
oscilloscopes, and more. Along these lines, not
long ago, something caught my eye which
seemed too good to be true: a full-featured
Pascal compiler for the PIC and absolutely free
of charge —no advertisements, no limitations,
and no strings attached.
70 SERVO 03.2015
Called PIC Micro Pascal (PMP for short), this superior compiler is the creation of Philippe Paternotte who has made it readily available for
download on the Web. What so boggled
me once I paused to examine it with
more care is that this is no stripped-down
rendition of Pascal. It offers all manner of
features found within the Turbo Pascal
and Delphi languages for PCs. The code it
produces is highly optimized throughout
— generally better than what I could write
from scratch in assembler. In short, if
you've craved advanced structured
programming on a PIC, yielding compact
hex code results without having to reach
for your wallet, this is the way to go!
I switched over to PMP from
assembler and compiled Basic, and have
never looked back. Here's why.
First, Pascal is a splendid language in
its own right. It's logical, sensible, simple
to learn, and makes a structured
approach to firmware design painless.
Even better — unlike some languages —
Pascal is easy on the eyes; the source
code is almost self-documenting.
The PMP implementation is incredibly
complete. Consider just a few of its
• Follows standard Pascal closely.
• Modularity (procedures and
functions), with local variables and
versatile parameter passing.
• Rich set of data types, including
floating point numbers.
• Data structures, such as arrays,
records, even user-defined types.
• Tons of optimization features.
• An attractive editor with integrated