??? 03/01/04 20:47 Read: times |
#65773 - RE: What is wrong in my serial comm prog Responding to: ???'s previous message |
Deepak Kash wrote:
------------------------------- RET_OPEN:CJNE A,#'O',RET_CLOSE CLR P1.0 CLR P1.1 MOV SBUF,#'O' MOV SBUF,#'P' MOV SBUF,#'E' MOV SBUF,#'N' SJMP RET_END Shouldn't you just send one char to sbuf, and then wait until it's been transmitted? You put the next char in sbuf before the previous one has been transmitted... You cannot send a char every usecond, unless you transmit at some 10 Mbit/s... there are maybe other problems in your program, but this one is quite obvious... If you put your coms routine in an ISR, you should try and implement some buffer structure with a pointer and make sure that if you have stuff to transmit you sent one char and wait for your sbuf to be empty before sending the next regards Patrick |