-
string as parameter
Hello
Hello
I work with a PIC18F46K20
and now I want with a Function send text with RS232 to HyperTerminal.
Now I have the following code created.
Code:
// above the main
void UART_DEBUG_TEXT(const char szText[])
//in the while
UART_DEBUG_TEXT(Hello);
//below the main
void UART_DEBUG_TEXT(const char szText[])
{
unsigned char i = 0;
while(szText[i] != '\0')
{
if(UARTIntPutChar(szText[i]))
i++;
}
}
Now the problem that I see strange characters in hyper terminal. This example:
íˆÿ¿Œÿ ßÂ;ûf`ÿ°¿`ùÂz„úÙ¾b..ï)ýHöAÿ€õÏ ûýâï`ê:S}N¯þ
maybe someone knows what the problem is?
-
Are you sending and receiving at the same baud rate?
For that matter is the protocol you are sending being expected by the receiving app? IE proper amount of stop bits etc...?
Assuming szText points to some valid string ("You haven't provided in the code rather it does or not"), then there doesn't seem to be anything wrong with your function.
-
hello
thanks for you answer
My bautrate is good :
because if I do it this way without fuctie it goes well:
Code:
k = 0;
while(k < 18)
{
if(UARTIntPutChar(cArray2[k]))
k++;
Delay10KTCYx(100000);
}
Wim