09-30-2005 03:33 PM
10-01-2005 06:34 AM
10-01-2005 08:38 AM - edited 10-01-2005 08:38 AM
Message Edited by LV_Pro on 10-01-2005 09:41 AM
10-01-2005 08:49 AM
thanks, but i think the setup in serial communication( eg. the rates, bits and so on) should be right cos it sometime work only warning message display.
and does have some way to clear the serial buffer in order to catch the data from the beginning?
10-01-2005 05:40 PM
Do not ignore the passage "If your settings match your devices settings, and you are still receiving a framing error, you may be experiencing noise on your serial line."
If it does the same thing in another software package I suspect a less than ideal I/O connection. Bad or floating ground.
The follwing is based on how things used to work.
The UART needs to be able to frame the characters transmitted across the line. Framing is the process of identifying the start bit the data the parity the stop bits. If you have a bad conncetion the UART will usually run into trouble with the start or stop bits. Since the frame can not be defined the data contained in the character cannot be assured.
Again back in the day...
You were not allowed to run a serial cabel more than 50 feet. Long lines, forescent lights, bad cable would degrade the start and stop bits.
Do not so quickly rule out bad rate settings. The comm chips being used these days are amazing in their ability to pull out data. I have seen baud rates set at double or half the correct setting give correct data with only occational framing errors. I believe this is because they are always over-sampling the lines to cancel the effect of bad signals. Chips I looked at 5 years ago were sampling at 10 the required rates unless you flipped bits to over-ride.
Trying to help,
Ben
10-02-2005 09:21 AM
@LV_Pro wrote:
That is the problem with using the "bytes at port" comparison with a lower number than the expected length, if the bytes haven't all come in when you read them you will have some come in after the read and be in the serial port buffer, waiting for your next read.