m2star
Junior Member level 1
- Joined
- May 1, 2010
- Messages
- 18
- Helped
- 2
- Reputation
- 4
- Reaction score
- 2
- Trophy points
- 1,283
- Location
- Rawalpindi, Pakistan, Pakistan
- Activity points
- 1,390
i am working on a project, in which i have to receive data serially form PC
and show it on LCD, for this purpose i have to use micro-controller 89c2051
BUT i am facing an annoying problem with serial port,
its is not properly receiving the data which i am sending from PC
i use the following code for bouncing back the received data
but its not not working can anyone help??????????
"
"
and show it on LCD, for this purpose i have to use micro-controller 89c2051
BUT i am facing an annoying problem with serial port,
its is not properly receiving the data which i am sending from PC
i use the following code for bouncing back the received data
but its not not working can anyone help??????????
"
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 INITHW(); uchar RByte; while(1) { RECByte(); SNDByte(RByte); } void INITHW() { TMOD=0x20; //Timer 1, 8-bit auto-reload TH1=0xFA; //4800 baud rate //TL1=0xFA; SCON=0x50; //8-bit , 1 stop bit, REN enabled TR1=1; //start timer 1 } void RECByte() { while(!RI); RByte=SBUF; RI=0; } void SNDByte(uchar SByte) { SBUF=SByte; while(!TI); TI=0; }
"
Last edited by a moderator: