Thread: read write serial port

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Nov 2009
    Location
    Maryland, USA
    Posts
    46
    Quote Originally Posted by rcgldr View Post
    The hardware handshake should prevent receiver overrun errors.
    That's the theory, but we're mimicking a UART here so the hardware doesn't do it. The handshaking signal can only cause an interrupt and then it's up to software to stop sending. And it's up to software to notice the buffer's getting full and set the handshaking signal in the first place.

    But the maximum rate that most UARTs can send is a 115.2Kbps. Even the tiniest modern microcontroller can receive that rate without overflow, assuming interrupts aren't disabled too long, and if they are then handshaking wouldn't work anyway. And we're only doing 19.2Kbps here.

    The real reason they used handshaking was that an extra few bytes of RAM for a buffer was very expensive, so they absolutely had to process (e.g. print on the teletype) all data as it was received.

  2. #2
    Registered User
    Join Date
    Apr 2013
    Posts
    1,658
    Quote Originally Posted by KenJackson View Post
    That's the theory, but we're mimicking a UART here so the hardware doesn't do it.
    OK, so this is not a UART that uses CTS (clear to send) and RTS (request to send) like protocol (like RS232).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Write to serial port
    By sombrancelha in forum C++ Programming
    Replies: 14
    Last Post: 06-01-2012, 08:08 AM
  2. Serial port read/write problem
    By ojaro in forum C Programming
    Replies: 5
    Last Post: 06-25-2010, 08:26 AM
  3. Can't Read From Serial Port
    By HalNineThousand in forum Linux Programming
    Replies: 14
    Last Post: 03-20-2008, 05:56 PM
  4. How to read from a serial port
    By WDT in forum C++ Programming
    Replies: 6
    Last Post: 05-10-2004, 06:31 AM
  5. read from and write to serial port
    By wazilian in forum Networking/Device Communication
    Replies: 3
    Last Post: 04-25-2004, 08:22 AM