Cannot compare unsigned char with hexadecimal
I have a code like that. The program won’t reach if condition when SBUF is 0xAA. if (SBUF==0xaa) { AA_flag=1; config[0]=170; }
Did you write an AA to SBUF and then expect to check it? Remember that the location is actually two different registers, one for data written and the other for incoming data when read.