SW500009 Microchip Technology, SW500009 Datasheet - Page 46

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
Processor-related Features
The compiler will produce the appropriate code to access EEPROM and is particularly efficient
when accessing multi-byte variables. Unlike conventional RAM variables, if an initialized EEPROM
variable is modified during runtime, next time the processor is reset the variable will contain the
updated value, not the original initialization value. So in the above example, the first time the
processor starts up, serial_number will contain 0x1234, however after this is changed to 0xAA55,
serial_number will never revert back to the original 0x1234 value, even after reset, unless explicitly
programmed to do so.
a complex expression involving an eeprom qualified object is used, the compiler will generated a
“can’t generate code” error. In this case you should try and simplify the expression, perhaps by
using a temporary variable.
3.2.5.2 The __EEPROM_DATA() macro
For those PIC devices that support external programming of their EEPROM data area, the __EEP-
ROM_DATA() macro can be used to place the initial EEPROM data values into the HEX file ready
for programming. The macro is used as follows.
The macro accepts eight parameters, being eight data values. Each value should be a byte in size.
Unused values should be specified as a parameter of zero. The macro may be called multiple times
to define the required amount of EEPROM data. It is recommended that the macro be placed outside
any function definitions.
tioned by a linker option in the usual way.
loading EEPROM contents at program time only. Using eeprom qualified variables provides a more
flexible approach to pre-loading of EEPROM as they do not require initialization of eight bytes at a
time and they also come with built-in runtime access as discussed in section 3.2.5.1.
32
Note the compiler only support basic assignment operations on eeprom qualified objects. If
The macro defines, and places the data within, a psect called eeprom_data. This psect is posi-
This macro is not used to write to EEPROM locations during run-time, it is to be used for pre-
As the location of eeprom qualified variables is managed by the toolsuite, it is not nec-
essary to access EEPROM by specific address, in fact this should be avoided. For this
reason it is not recommended to combine the use of eeprom qualified variables with any
other EEPROM access method.
#include <htc.h>
__EEPROM_DATA(0, 1, 2, 3, 4, 5, 6, 7);
C Language Features

Related parts for SW500009