Basic Question relating to the serial driver
Posted: Sun Oct 21, 2012 10:27 pm
Hello,
I want to use the serial driver to echo back what is received from the serial port back by using , I intend to write parsing routines eventually
Below is a fragment of my code in a thread
while (TRUE) {
chr=chIOGet(chp);
if (chr >0 && chr<128) //check if character is valid ascii
chIOPut(chp,chr);
chr=0;
}
I am getting characters echoed back to the serial port using the code above at a very slow rate and sometimes garbage chars.
What is the correct approach to reading characters from the serial port and eventually parsing it
Thanks,
Hansen
I want to use the serial driver to echo back what is received from the serial port back by using , I intend to write parsing routines eventually
Below is a fragment of my code in a thread
while (TRUE) {
chr=chIOGet(chp);
if (chr >0 && chr<128) //check if character is valid ascii
chIOPut(chp,chr);
chr=0;
}
I am getting characters echoed back to the serial port using the code above at a very slow rate and sometimes garbage chars.
What is the correct approach to reading characters from the serial port and eventually parsing it
Thanks,
Hansen