Page 1 of 1

Basic Question relating to the serial driver

Posted: Sun Oct 21, 2012 10:27 pm
by hansen
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

Re: Basic Question relating to the serial driver

Posted: Mon Oct 22, 2012 8:27 am
by Giovanni
Hi,

Is the thread doing this loop at equal or lower priority of some other thread that could delay it?

Giovanni