Jef Patat
Junior Member level 1
Hello,
I found this in some else's code:
...
void write_E2(unsigned int address, unsigned char data)
{
EEADR = address;
EEADRH = (address >> 8);
//The EEADRH:EEADR register pair is used to address
//the data EEPROM for read and write operations.
//EEADRH holds the two MSbits of the address; the
//upper 6 bits are ignored. The 10-bit range of the pair
//can address a memory range of 1024 bytes (00h to
//3FFh).
...
Is this a correct way of doing if you know:
...
extern volatile near unsigned char EEADR;
...
This means putting an int into a char.
will it choose the right byte, where can i find info about this?
Kind regards, Jef
I found this in some else's code:
...
void write_E2(unsigned int address, unsigned char data)
{
EEADR = address;
EEADRH = (address >> 8);
//The EEADRH:EEADR register pair is used to address
//the data EEPROM for read and write operations.
//EEADRH holds the two MSbits of the address; the
//upper 6 bits are ignored. The 10-bit range of the pair
//can address a memory range of 1024 bytes (00h to
//3FFh).
...
Is this a correct way of doing if you know:
...
extern volatile near unsigned char EEADR;
...
This means putting an int into a char.
will it choose the right byte, where can i find info about this?
Kind regards, Jef