SW500009 Microchip Technology, SW500009 Datasheet - Page 45

HI-TECH FOR DSPIC/PIC24

SW500009

Manufacturer Part Number
SW500009
Description
HI-TECH FOR DSPIC/PIC24
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC24 & DsPICr
Datasheet

Specifications of SW500009

Supported Families
PIC24
Core Architecture
PIC, DsPIC
Software Edition
Standard
Kit Contents
Software And Docs
Tool Type
Compiler
Mcu Supported Families
PIC24 MCUs And DsPIC DSCs
Lead Free Status / RoHS Status
Not applicable / RoHS Compliant
For Use With/related Products
DSPIC3X/PIC24
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
025
778-1003
778-1003
C Language Features
3.2.4 Bit Instructions
Wherever possible, HI-TECH C will attempt to use the PIC bit instructions. For example, when
using a bitwise operator and a mask to alter a bit within an integral type, the compiler will check the
mask value to determine if a bit instruction can achieve the same functionality.
will produce the instruction:
To set or clear individual bits within integral type, the following macros could be used:
To perform the same operation as above, the bitset macro could be employed as follows:
3.2.5 EEPROM Access
For most devices that come with on-chip EEPROM, the compiler offers several methods of accessing
this memory. The EEPROM access methods are described in the following sections.
3.2.5.1 The eeprom variable qualifier
The compiler provides the eeprom qualifier as a very simple and efficient method to configure and
access EEPROM. This feature allows initialization of EEPROM memory and allows the simplest
mechanism for runtime access. The eeprom qualifier may only be applied to global and/or static
variables and this indicates to the compiler that the object should reside in EEPROM memory. For
example:
This will create an eeprom “variable” which is predefined with the value 0x1234. This would be
equivalent to using the __EEPROM_DATA macro with 0x12 and 0x34 as two of its parameters.
This variable may be read or written to at runtime:
unsigned int foo;
foo |= 0x40;
bsf _foo,6
#define bitset(var,bitno)
#define bitclr(var,bitno)
bitset(foo,6);
eeprom unsigned int serial_number = 0x1234;
serial_number = 0xAA55;
((var) |= 1UL < < (bitno))
((var) &= ~(1UL < < (bitno)))
Processor-related Features
31

Related parts for SW500009