Predefined Globals and Constants
To facilitate programming of PIC compliant MCUs, the mikroPascal PRO for PIC implements a number of predefined globals and constants.
All SFRs are implicitly declared as global variables of volatile word
type. These identifiers have an external linkage, and are visible in the entire project. When creating a project, the mikroPascal PRO for PIC will include an appropriate (*.mpas) file from defs folder, containing declarations of available SFRs and constants. All identifiers are in upper case, identical to nomenclature in the Microchip datasheets.
For a complete set of predefined globals and constants, look for “Defs” in the mikroPascal PRO for PIC installation folder, or probe the Code Assistant for specific letters (Ctrl+Space in the Code Editor).
Predefined project level defines
mikroPascal PRO for PIC provides several predefined project level defines that you can use in your project :
First one is equal to the name of selected device for the project.
If P16F887 is selected device, then P16F887 token will be defined as 1, so it can be used for conditional compilation:
{$IFDEF P16F887} ... {$ENDIF}
Other predefined project level defines are :
{$IFDEF P16}...{$ENDIF} {$IFDEF P18}...{$ENDIF} {$IFDEF MIKRO_ICD}...{$ENDIF}
What do you think about this topic ? Send us feedback!