Moderadores: andre_luis, 51, guest2003, Renie
unsigned char DADOS @ 0x66; // Endereço inicial da RAM onde fica armazenada palavra
unsigned char *PP;
// Transf. dados para ram
PP = &DADOS;
for (I = 0; I < 0x0a; I++) // 10 caracteres
{
*PP = MENS1[I];
PP++;
}
3.2.4.1 EEPROM Access
For those PIC devices that support external programming of their EEPROM data area, the __EEP-
ROM_DATA() macro can be used to place the inital EEPROM data values into the HEX file ready
for programming. The macro is used as follows.
#include <htc.h>
__EEPROM_DATA(0, 1, 2, 3, 4, 5, 6, 7);
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.
The macro defines, and places the data within, a psect called eeprom_data. This psect is posi-
tioned by a linker option in the usual way.
This macro is not used to write to EEPROM locations during run-time. The macros EEP-
ROM_READ() and EEPROM_WRITE(), and the function versions of these macros, can be called to
read from, and write to, the EEPROM during program execution. For example, to write a byte-size
value to an address in EEPROM memory using the macro version of EEPROM write:
Usuários navegando neste fórum: Nenhum usuário registrado e 1 visitante