Sending and Receiving One Character at a Time Using a Serial PortHardware: Serial
Problem: I have a serial card and I’m getting data coming in, but until I hit some specific number of bytes I don’t see any of the bytes coming in. How can I setup my serial card to send in every byte it receives immediately? Solution: You want to send one byte of data at a time. On the receiving end, you want to make sure you get the byte back right when the UART receives it. You are looking for 1 byte triggering. The trigger level determines how often an interrupt is generated to tell the driver that data is available in the UART receive buffer. The data bytes will collect in the FIFO until an interrupt occurs to tell the driver to read the information in the buffer. In Windows Device Manager there are sliders to set up byte buffers for receiving and transmitting. To get to these settings in Windows XP
Changing these settings will change when the serial card sends an interrupt to the operating system. The buffer is still the same size, however the interrupt flag will be generated earlier and more often. You can use this to your advantage if you are having difficulties with buffer overflow errors on your serial card at faster speeds. However changing the value to a smaller value does cause your system CPU to work harder to service the additional interrupts. If you cannot change the buffer size on your card or you cannot set it to smaller than 8 bytes, you might be able to use the techniques listed below. This is more common on older style cards.
Related Links: Attachments:
Report Date: 10/02/2002 Last Updated: 04/21/2006 Document ID: 2Q18I8YF |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
