Joined: 07 Sep 2003 Posts: 60 Location: Buenos Aires (Argentina)
#rom
Posted: Fri Jul 28, 2006 6:46 am
From CCs manual:
Quote:
#ROM
address is a ROM word address, list is a list of words separated by commas
Purpose:
Allows the insertion of data into the .HEX file.
In particular, this may be used to program the '84 data EEPROM, as shown in the following example.
What mean '84 ? 16f84 ?
It is possible a best way to this:
Quote:
#define V_TOTAL 0xF00020
// A address defined ponting to eeprom
#ROM V_TOTAL= { 0x0000, 0x0000}
#define V_TOTAL_DIR 0x00
// Another define pointing to the same eeprom address
int32 init_read_eeprom(void)
{
int32 temp32;
temp32 = read_int32_eeprom(V_TOTAL_DIR);
return temp32;
}
_________________ Best Regards
Daniel H. Sagarra
La Plata (Argentina)
Ttelmah Guest
Posted: Fri Jul 28, 2006 3:00 pm
Yes. The example is for the 16F84.
Your code has a problem with the addresses. The EEPROM is at location 0xF00000, in the 'program' map for the 18 chips. Your initial code puts the bytes at address F00020.Then tries to retrieve the bytes from address F00000...
V_TOTAL_DIR, needs to be 0x20, to access the same locations.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum