Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Pic Micro Pascal

From Wikipedia, the free encyclopedia
A major contributor to this article appears to have aclose connection with its subject. It may require cleanup to comply with Wikipedia's content policies, particularlyneutral point of view. Please discuss further on thetalk page.
See ouradvice if the article is about you and read ourscam warning in case someone asks for money to edit this article.
(May 2018) (Learn how and when to remove this message)
Pic Micro Pascal
DeveloperPhilippe Paternotte
Stable release
2.0.6 / September 9, 2014; 11 years ago (2014-09-09)
Operating systemWin32
TypeCompiler
LicenseFreeware
Websitewww.pmpcomp.fr

Pic Micro Pascala.k.a. PMP is a freePascalcross compiler forPIC microcontrollers. It is intended to work with theMicrochip TechnologyMPLAB suite installed; it has its own IDE (Scintilla-based) and it is a highly optimized compiler.

It is intended to target 8-bit processors only: PIC10, PIC12, PIC16, PIC16 enhanced, PIC18.

The main axis of development was to avoid special built-in functions and procedures to interface hardware registers. These registers are accessed directly as variables, there are no wrapper functions, and emitted code is quite compact.

PMP does not include an assembler or linker. It is designed to work with theMicrochipMPLAB suite installed, and directly uses MPASM and MPLINK .lkr files for memory mapping initializations; as of V2 it comes with its own database for processor features and standard register definitions.

PMP also supports theGPUTILS suite.

Language features

[edit]

PMP does not supportobject-oriented programming, but a RECORD can have methods.

As of 2014, the implementation supports multiple file compiling, by include directives and by a per unit concept.PMP supports a unique feature: variables may be declared in EEPROM and then used transparently as any other variable (with some limitations).

PMP's data types:

  • simple records (subset): RECORD
  • bit booleans: BOOLEAN
  • unsigned and signed 8-bit integer types: CHAR, BYTE, SHORTINT
  • unsigned and signed 16-bit integer types: WORD, INTEGER
  • unsigned and signed 32-bit integer types: LONGWORD, LONGINT
  • enumerations
  • arrays (one dimension): ARRAY
  • strings (variable length): STRING
  • pointers (subset)
  • floating point variables and operations (PIC16 and PIC18 only): two FP formats, one 48-bit internal (REAL) and a subset of theIEEE 32 bits format (SINGLE); both formats do not handle infinite andNaN

Language dialect

[edit]

PMP syntax is very close to the non-OOP syntax ofTurbo Pascal orDelphi, with some extensions to support some target processor features (bit manipulations ...).

programBeacon;usesA2D;varI_IR_Receiver:boolean@PORTB.4;// TSOP1736 IR receiverO_LED_RECEIVING:boolean@PORTC.0;// Receive in progressO_LED_ERROR:boolean@PORTC.1;// Receive errorO_PWM_A:boolean@PORTC.4;// PWM to US transducer phase A (addr cannot be changed)O_PWM_B:boolean@PORTC.5;// PWM to US transducer phase B (addr cannot be changed){ Beacon Addr dip switches }I_ADDR_0:boolean@PORTA.2;I_ADDR_1:boolean@PORTA.5;CONSTLOW_BATT_SENSOR_CHANNEL=ANS0;// Channel for battery measurement (RA0){ Led on/off values }cLED_ON=TRUE;cLED_OFF=FALSE;// pins that are inputsTRISA_MASK=[I_NOT_OPTION_SERIAL,I_ADDR_0,I_ADDR_1];TRISB_MASK=[I_IR_Receiver];TRISC_MASK=[];begin...PORTA:=0;// Prepare all outputsTRISA:=TRISA_MASK;// Set pins direction...A2D_Init([LOW_BATT_SENSOR_CHANNEL],5,adcFosc16,adm8Bits,advVdd);Baud(19200);// setup serial portassign(output,SerialPort_Output);writeln('Hello world!');...end.

Since version 1.6, some language "extensions" may be used (with explicit activation), most of them coming from other Pascal-Like languages such asOberon orModula:

...FORIinSomeVarDO<Statements>(* SomeVar may be any variable or an enumeration type *)FORI:=XTOYBYnDO<Statements>(* Specification of the variable step value *)LOOP<Statements>END(* Forever loop *)IFCondition1THEN<Statements>ELSIFCondition2THEN<Statements>(* Shortcut for ELSE IF *)RETURNSomeResult(* Function's result value assignment and exit *)

History

[edit]

PMP was created in 2006 by Philippe Paternotte and released asfreeware for now, asfree software in the future. The latest version is 2.0.6, September 2014.[1]

PMP has been the subject of an article inSERVO Magazine in March 2015.[2]

References

[edit]
  1. ^Reference manual, PPA, 2014,Documentation for Pic Micro Pascal V2[dead link]
  2. ^March 2015SERVO Magazine article, Thomas Henry, 2015,[1]

External links

[edit]
Dialects
Compilers
Current
Discontinued
API
Microcomputer
Comparisons
Designer
Related to
ALGOL (1958)
Modula-2 (1977)
Ada (1983)
Oberon (1986)
Modula-3 (1988)
Oberon-2 (1991)
Component Pascal (1991)
Retrieved from "https://en.wikipedia.org/w/index.php?title=Pic_Micro_Pascal&oldid=1339035652"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp