FreeJALduino with Pic Micro Pascal (PMP)

0. Forewords

I hope this language, Pic Micro Pascal to become usable for my projects. It is almost identical with Turbo Pascal language, PIC targets are 12F, 16F and 18F, Floating Point Math for 18F's and some of 16F's, pointers (under testing), and a lot of nice things. It is free and the compiled project is an .asm source which is passed to MPASM compiler (Swordfish Basic and Proton Basic are doing the same). Support for gputils is in alpha stage but is working well with my board.

It don't have yet a rich library (only basics as ADC, PWM, IRQ_USART, Serial, LCD, Debounce, OneWire, SPI_SSP, etc.) but any contribution is welcomed.

Right now, I'm working with the unofficial beta version, 1.4.10.76 (not available to the public) and PIC18F2550 microcontroller (of course) and I'm starting to have nice results (still, no workable bootloader). I wish I can give you a link to this version (because the newest one, 1.5.3.80 is not working very well) but I hope Philippe Paternotte will came up soon with a workable version. See bellow:

UPDATE: The future version 1.5.4 is working again. It come also with a new optimizer and the result is a smaller code. It will not work with the USB bootloader with my FreeJALduino board but the board can be programed with Pickit2/3 and compatible programmers - no problem here, the board come with the ICSP connector so, it is easy to use even in this case. If you have such a programmer, then you can use Pic Micro Pascal as your language because it implements very well the Turbo Pascal 7/Delphi standards.

1. Installation

Well, not much here. Download the last workable version from http://pmpcomp.fr site and install it (wait for the next version bigger than 1.5.3.80). I suggest you to install it in C:\PMP\ folder (very helpful for Vista users).

It is very important to install the MPLAB package, even if you use gputils because PMP needs the device files from MPLAB IDE - for the next versions this step will not be required anymore.

If you use gputils, download it from http://gputils.sourceforge.net and install it in C:\gputils (the best option for VISTA users).

2. Project setup example

Unlike Jaledit, which is file oriented (that is, the current file inside IDE is compiled and a hex is generated - the settings are global), PMP is project oriented. That means you have a main file like in C. Not matter which file is currently opened, when you have a project opened, the main file and the included libraries are compiled and a hex file is generated. When a project is created, you need to specify the main file, frequency, and various paths for libraries, assembler and the linker. The disadvantage is that you need to do this for every project. I would like to have here some global definitions, which must be implicitly chosen for every new project... The option is present in the newest IDE version.

Well. it is about FreeJALduino board so we will use the PIC18F2550 microcontroller and the 48MHz clock. The project settings for both cases, mpasm and gputils can be set selecting "Options" option from the main menu "Project" and set tabs according to images (modify the path to your specific path if required):

a. - Using WINMPASM:

My path is "D:\\microchip\" - again, make changes according to your path.

b. - Using gputils:

For gputils, first two tabs, Project and Compiler are identical to those above.

I suppose you are familiar at least with Turbo Pascal 7 and you already read the PMP manual. Having the settings ok, then you can start compile your program, hunt bugs and burning the .hex file in your microcontroller.

3. What next?

Well, some examples developed with this nice language. <-- click to see :-D