AnsweredAssumed Answered

S12zvl EEPROM number of bytes read

Question asked by Charudatta Ingale on Aug 7, 2015
Latest reply on Aug 7, 2015 by Radek Sestak

bool Read_Data(unsigned char *buffer, unsigned int long  eeprom_address, unsigned char size)

{

 

   unsigned char i;

    while(FSTAT_CCIF == 0);   //wait if command in progress

    for(i=0;i<size;i++)

    {

        *(buffer + i) = *(unsigned int * ) eeprom_address;

         eeprom_address = (eeprom_address + 1);

    }

} /* Read_Data */

 

while calling this function it is not updating  the first byte read  in buffer and but other data is available.

 

Eg;

unsigned char  data[10];

unsigned char *buffer=data;

unsigned int arr[]={0X11AA,0X2222,0X3333,0X4444,0X5555};

 

this i wrote on EEPROM on address  0x100000  to  0x100009

so in data there is no first byte available

it is data[]={0XAA,0X22,0X22,0X33,0X33,0X44,0X44,0X55,0X55};

Outcomes