[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Serial port programming



Hello Eric,

Friday, February 10, 2006, 5:10:40 PM, you wrote:
EA> Can anyone point me to a code sample which opens a serial port and sets
EA> the baud rate on teh ETrax 100?

EA> Its setting the baud rate I really need to know how to do...

In C code: See termios manpage. It's a bit difficult to understand at
the beginning so I suggest you to google around for source code
containing tcgetattr or tcsetattr (just type those words in your
favorite search engine).

Easier: Use the "stty" shell utility to set up the serial port and
then start your application. Under Linux the port settings do not
change when you close the device.

Example:
  stty -F /dev/ttyS0 9600

More options on the stty man page.


EA> Also, how do I disable the shell on com port 1?

Disable it in /etc/inittab (it's commented).
If you want to disable the boot messages too, you have to recompile
the kernel. See "make menuconfig"

Udo




Udo