gnupic@linuxhacker.org

gnupic@linuxhacker.org


Subject: Re: OT. Serial communications.
From: Byron A Jeff
Date: Sat, 20 Sep 2003 20:51:32 -0400

On Sat, Sep 20, 2003 at 06:04:45PM -0500, Wayne Patterson wrote:
> This might be a stupid question, but I don't have the answer so.

No such think if you don't know the answer.

> How do you output from the terminal to a serial port in linux?

You write to the file associated port.

> Do you cat and or pipe to /dev/ttyS*?

No. The reason is that you have to configure the port first by setting the
bit rate, parity, modem control, and the like.

> And how do you receive from the same port to the terminal?

The same. Read from the file after it is configured.

> I have looked on the web and found a ton of stuff but it is all overkill for 
> what I want to do. I just want to test serial communications to a pic to test 
> the hardware. Any help will be appreciated.

You need a terminal program them. Almost every Linux distribution has a
copy of minicom, which does the job nicely.

For PIC testing I use my slightly modified version of linwload, which is
a Wloader clone for Linux written by Wojciech Zabolotny. It's nice because
I can download code to my chip then immediately connect using the serial
port. Woj's page is here:

http://www.ise.pw.edu.pl/~wzab/linwload/linwload.html

My modified copy is here:

http://www.finitesite.com/d3jsys/linwload.tar.gz

My copy is useful because it does a select on the input/serial port so as not
to suck up a bunch of CPU like Woj's original version does.

Hope this helps,

BAJ

gnupic@linuxhacker.org