I can't step over this instruction ( while(TI==0);// ) the program : #include "reg51.h" main() { TCON = 0x50; TMOD = 0x20; TL1 = 0xFD; TH1 = 0xFD; TR1 = 1; while(1) { SBUF = 0xFF; while(TI==0);// I can't step over here . TI = 0; }
Sorry, but I do not see where you initialized the SCON (and T2CON if it is presents) register(s)? May it be possible that T2 configured as baud rate generator but does not run? As well there are not shown interrupts settings, do you use ISR of T0 and T1? Another note about your example is that
TCON = 0x50;
Note: In fact, in the shift register mode no baudrate generator is needed because the rate is constant and equals Fosc/12. So if this mode were the intention, no set up of any timer or baudrate generator is needed.
View all questions in Keil forum