Serial port programming in Linux

This is a discussion on Serial port programming in Linux within the Linux Programming forums, part of the Platform Specific Boards category; http://www.stat.ucla.edu/cgi-bin/man-cgi?termios Look at the bits which talk about XON and XOFF (for software control) Look at the bits which talk ...

  1. #16
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,855
    http://www.stat.ucla.edu/cgi-bin/man-cgi?termios
    Look at the bits which talk about XON and XOFF (for software control)
    Look at the bits which talk about CTS and RTS (for hardware control)

    Remember, you need a fully wired serial cable for hardware control.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  2. #17
    In the Land of Diddly-Doo g4j31a5's Avatar
    Join Date
    Jul 2006
    Posts
    476
    Didn't work also. BTW, in minicom, I set the software and hardware control to "NO". So I guess it means that it didn't use flow control at all. BTW, when I asked the person who make the device, he said that he built it to be an asynchronous NULL modem.

  3. #18
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,855
    Well then you have a problem then, if neither form of flow control is implemented.

    It's "fine" if you use it at human typing speed (a few chars per second), but if you send a huge block at program speed, then the link is swamped, data is lost and you're in the dark.

    Testing is like pouring cold water into a chocolate teapot and saying that it works.
    Your hardware designer has built and tested a cold water teapot, and you're coming along with hot water.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #19
    In the Land of Diddly-Doo g4j31a5's Avatar
    Join Date
    Jul 2006
    Posts
    476
    I see. Guess I have no choice but to have a discussion with the hardware programmer. But why does if I tried it in minicom it worked without any flow control? How does minicom work? Does it send the message one char at a time everytime it recognized a key press?

    Thanks a lot.

  5. #20
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,855
    > But why does if I tried it in minicom it worked without any flow control?

    > Bps / Par / Bits : 4800 8N1
    Because you can't type at 500 characters per second would be my guess.

    Whereas your code has absolutely no trouble maintaining a rate of 500 chars per second.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  6. #21
    In the Land of Diddly-Doo g4j31a5's Avatar
    Join Date
    Jul 2006
    Posts
    476
    Quote Originally Posted by Salem

    Whereas your code has absolutely no trouble maintaining a rate of 500 chars per second.
    Ahh, that makes sense. And I thought minicom sends the message after I hit "Enter". Silly me. Thanks for clearing that up.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. serial port to poll on request
    By infineonintern in forum C++ Programming
    Replies: 2
    Last Post: 06-11-2009, 07:52 AM
  2. Linux serial port interrupts
    By danga1993 in forum Linux Programming
    Replies: 1
    Last Post: 04-28-2007, 12:15 PM
  3. Serial port programming in Linux
    By g4j31a5 in forum C++ Programming
    Replies: 1
    Last Post: 09-28-2006, 09:24 PM
  4. need guidance to connect to serial port
    By gnychis in forum Linux Programming
    Replies: 1
    Last Post: 06-02-2005, 11:10 AM
  5. DOS, Serial, and Touch Screen
    By jon_nc17 in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 01-08-2003, 04:59 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21