??? 03/07/04 11:27 Read: times |
#66171 - RE: What is wrong in my serial comm prog Responding to: ???'s previous message |
Deepak you are using this code
MOV SBUF,#'C' MOV SBUF,#0DH MOV SBUF,#0AH The problem is without waiting for the TI flag to be set which would indicate that byte has been transmitted you are pushing another byte into the SBUF register this overwrites the earlier byte and thus only 0AH is sent. At 9600 bps it takes 104 uS to send a bit i.e. Start bit and for processing MOV SBUF, #XXH takes only 2 Machine cycles i.e. 2.17 uS at 11.0592MHz. thus even before 8051 send the start bit the data in SBUF is changed from 'C' to 0AH. and thus only 0AH is sent. You don't need to use serial interrupt in your program Remove the serial ISR and change your code to do it with polling. i.e MOV SBUF,#'C' JNB TI,$ CLR TI MOV SBUF,#0DH ................ ................ You need to read the serial communication tutorial available here http://www.8052.com/tutser.phtml carefully. |
Topic | Author | Date |
What is wrong in my serial comm prog | 01/01/70 00:00 | |
RE: What is wrong in my serial comm prog | 01/01/70 00:00 | |
RE: What is wrong in my serial comm prog | 01/01/70 00:00 | |
RE: What is wrong in my serial comm prog | 01/01/70 00:00 | |
Moderator please close this thread![]() | 01/01/70 00:00 |