SW500010 Microchip Technology, SW500010 Datasheet - Page 81

HI-TECH C PRO FOR PIC10/12/16

SW500010

Manufacturer Part Number
SW500010
Description
HI-TECH C PRO FOR PIC10/12/16
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC10/12/16r
Datasheets

Specifications of SW500010

Supported Families
PIC10, PIC12, PIC16
Core Architecture
PIC
Software Edition
Professional
Kit Contents
Software And Docs
Mcu Supported Families
PIC10/12/16
Tool Type
Compiler
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
PIC10, PIC12, PIC14, PIC16, PIC16E
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
019P
778-1006
778-1006
C Language Features
The volatile type qualifier is used to tell the compiler that an object cannot be guaranteed to
retain its value between successive accesses. This prevents the optimizer from eliminating appar-
ently redundant references to objects declared volatile because it may alter the behaviour of the
program to do so. All Input/Output ports and any variables which may be modified by interrupt
routines should be declared volatile, for example:
Volatile objects may be accessed using different generated code to non-volatile objects.
3.3.10 Special Type Qualifiers
HI-TECH C PRO for the PIC10/12/16 MCU Familysupports the special type qualifiers to allow the
user to control placement of static and extern class variables into particular address spaces.
3.3.10.1 Persistent Type Qualifier
By default, any C variables that are not explicitly initialised are cleared to zero on startup. This is
consistent with the definition of the C language. However, there are occasions where it is desired for
some data to be preserved across resets or even power cycles (on-off-on).
startup. In addition, any persistent variables will be stored in a different area of memory to
other variables. persistent objects are placed within the psect nvram.
function they must be combined with the static keyword. For example, you may not write:
because intvar is of class auto. To declare intvar as a persistent variable local to func-
tion test(), write:
more information, and for an example of using persistent data.
The persistent type qualifier is used to qualify variables that should not be cleared on
This type qualifier may not be used on variables of class auto; if used on variables local to a
static persistent int intvar;
If the PICC option, --STRICT is used, this type qualifier is changed to __persistent.
There are some library routines provided to check and initialise persistent data - see
volatile static unsigned int
void test(void)
{
}
persistent int intvar;
.. other code ..
/ * WRONG! * /
TACTL @ 0x160;
Supported Data Types and Variables
A
for
81

Related parts for SW500010