We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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 present)... 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?..." The default value of SCON is 0x00, so if the user is satisfied with the shift register mode @ Fosc/12 (SM1=SM0=0), it needn't be set up (nevertheless it's better practice expressing it explicitly). Note: In this mode the 8-bit data output is RXD pin! TXD pin outputs the shift clock signal. Sending 0xFF repeatedly (as in the shown program) will result in continuous H level at RXD pin (no START bit). It's evident that T1 is used as a baudrate generator (default for MCS51 Family). T2 needn't be present nor set up. T0 is also running - in the program it is evidently useless. (I suppose the complete tested program is shown). No interrupts needn't be shown for no interrupt is evidently needed neither used. (polling method, ie. "is TI set?", is used for serial comm handling). The shown program should work and it really works! Therefore, I think, the primary problem must be elsewhere, not in the program itself.
I asked about showing of ISR of timers because it may be that ISR of timer1 contains a typpo, for example, JMP $ etc... Really, what is the initialization of Timer1 at start of main for if UART uses just mode 0? Seems Jeny rejected some important code parts... Good days!
Yes, you are probably right. Best wishes