mayasunny
Member level 3
Hiee members,
i'm working on a project which is send binary file to EEPROM, read it back and display it on uart terminal.
i'm using PIC16F877A micro controller, xc8 compiler and 93lc46a eeprom.
i'm able to sending/reading the file to/from eeprom properly.
i split the binary file (size 128 bytes) into two arrays, the above code is for first 64 bytes of data, in the code i'm comparing each byte of data, the problem is the for loop terminates at j = 62, (RxData[62] = FF ) . i don't know why? i have few doubt does it treats FF as end of the file, can i use strcmp in side for loop?
i'm working on a project which is send binary file to EEPROM, read it back and display it on uart terminal.
i'm using PIC16F877A micro controller, xc8 compiler and 93lc46a eeprom.
i'm able to sending/reading the file to/from eeprom properly.
Code:
for(j=0; j < 64 ;j++)
{
Ewen();
__delay_ms(100);
Write(write_addr2, RxData[j]);
__delay_ms(100);
Ewds();
Rx_file = Read(write_addr2);
Result[j] = Rx_file;
write_addr2++;
}
for(j = 0;j < 64; j++)
{
output = strcmp(RxData[j],Result[j]);
if(output == 0)
{
UART_TxChar(Result[j]);
}
else
{
RD0 = 1;
UART_str(error);
}
}
__delay_ms(1000);
i split the binary file (size 128 bytes) into two arrays, the above code is for first 64 bytes of data, in the code i'm comparing each byte of data, the problem is the for loop terminates at j = 62, (RxData[62] = FF ) . i don't know why? i have few doubt does it treats FF as end of the file, can i use strcmp in side for loop?
Last edited: