I think my code has fall into this problem:
I set i = 0 and j = 7 and hence n will be 8 based on the formula.
1. However, the display result showed that n will go until 254 and counter show the same number.
2. However also, if I comment out the if statement and left only "counter++", counter = 8 which is same as n.
Does anyone know if HITECH C Compiler has resolved this issue? I found the forum that discuss about this in previous HITECH website. http://forum.htsoft.com/all/showthreaded.php/Cat/0/Number/19441/page//vc/1
- CODE: SELECT_ALL_CODE
//two for loops on top with i and j
n = 16*i + j + 1;
read_byte = Read_Memory(n); // Read data from external eeprom memory
// Check if any mismatch or missing and feedback to user
if (n != read_byte){
sprintf(tx_buffer,"RetBinMatch,0,%d\r\n",n);
uart_send_string(tx_buffer);
counter_n++;
}
else{
counter++;
}