This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

printf statement not working after putchar statement is used.

Hi All
I am using following putchar routine.

void srl_putchar(unsigned char send)
{
SBUF = send;
while (!TI);
TI = 0;
}

after using above routine to transfer a character via serial port i continued with
 
printf("%c%c",dle,etx); 
but program control remained infinitely in printf().
So i want to know,
What is the problem with srl_putchar() routine ?
Thanks in advance!

Parents Reply Children
  • i was using putchar() available in the library,but putchar()was padding
    extra bytes to the character which i want to send via serial port for eg.putchar(0x0a)
    results into 0x0d 0x0a,ie new line character. so to avoid changing putchar() routine i decided to write it myself.