I wonder, why don't you use the UART that the F688 has?
Things are going to be much faster and reliable.
Now for the crap characters that remain in the string when you end it with less characters than 16.
An idea would be to have a FOR/NEXT loop and check where is the CR and fill the rest of the array with space character.
Have not tested but will give you a start:
for i=0 to 15
if testSTR[i]=13 then exit_for
next i
goto rest of the program
exit_for:
for j=i to 15
testSTR[i]=" "
next j
Ioannis
Bookmarks