??? 05/12/08 10:27 Read: times |
#154702 - try this Responding to: ???'s previous message |
try this test program. It will solve your problem.
#include<reg51.h> //void Initialise(); unsigned char a[15] = {"The number is 1"}; unsigned char b[20] = {"The number is not 1"}; void main() { unsigned char i; //Initialize(); //this function is Initialize LED TMOD = 0X20; SCON = 0x50; TH1 = 0xFD; TR1 = 1; while(1) { while(RI==0); // While control is here type any number in // serial window in debugging procces or // hyperterminal { i=SBUF; // here i=0x31(which is hex and ascii of 1) and //SBUF=0x00 and RI become 1 RI=0; //RI is cleared SBUF=i; //SBUF and i both showing 0x31 if(i==0x31) //you can see this condition must true //because(i==0x31) { for (i=0;i<15;i++) { while(!TI); SBUF = a[i]; TI=0; } } else { for (i=0;i<20;i++) { while(!TI); SBUF = b[i]; TI=0; } } } } } |
Topic | Author | Date |
Serial communication problem with AT89S52 | 01/01/70 00:00 | |
hyperterminal setting | 01/01/70 00:00 | |
As I said | 01/01/70 00:00 | |
FAQ | 01/01/70 00:00 | |
try this | 01/01/70 00:00 | |
Flow Control | 01/01/70 00:00 | |
Yes, but | 01/01/70 00:00 | |
Try this | 01/01/70 00:00 | |
So? | 01/01/70 00:00 | |
Cool!! And it worked!!! | 01/01/70 00:00 | |
how did it work | 01/01/70 00:00 | |
What I meant was![]() | 01/01/70 00:00 |