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

sprintf

Hello ALL!

It would be very nice to get some help for the next question. I'm using a f12x µC. There are two active Uart's. I put a command on the Uart0 every 500ms. This command is transparent for this Uart and is sent to the UART1. The code for this function is:

char xdata parsStr0[256];
void SendStringUart1( U16 command )
{
**********
sprintf(parsStr0,"$%u",command);
**********
}
in this case I have a wrong parsStr0 every 5-10sec.
After I've added a space in the sprintf
******
sprintf(parsStr0," $%u",command);
******
function I've not this problem anymore.
Can somebody, please, explain me this strange behaviouar.
With big respect,
A.

0