Tool/software: Code Composer Studio
Hello,
I need to send float data to SCI_UART. Based on SCI examples basic code for sending character is:
char *msg;
//......
msg = "\r\n\n\nHello World!\0";
scia_msg(msg);
//......
//
// scia_xmit - Transmit a character from the SCI
//
void scia_xmit(int a)
{
while (SciaRegs.SCIFFTX.bit.TXFFST != 0) {}
SciaRegs.SCITXBUF.all =a;
}
//
// scia_msg - Transmit message via SCIA
//
void scia_msg(char * msg)
{
int i;
i = 0;
while(msg[i] != '\0')
{
scia_xmit(msg[i]);
i++;
}
}
And I can receive this message in the RX.
But when I try to send a char like this:
float f; //..... sprintf(msg, "%f\0", f); scia_msg(msg);
This message will not be sent to the RX.
Thanks for your help.
Regards,
Amin