Results 1 to 5 of 5
HI again (from the cofee lounge).
I plan to use RS232 serial port control lines (RTS, CTS, CDC, RI, DSR...) to read and write logical levels from the outside world. ...
- 09-24-2008 #1Just Joined!
- Join Date
- Sep 2008
- Posts
- 3
Serial port registers HOWTO
HI again (from the cofee lounge).
I plan to use RS232 serial port control lines (RTS, CTS, CDC, RI, DSR...) to read and write logical levels from the outside world. This is for controling an external electronic device.
The problem now is that I have no clue how to read and write the 16550 registers as it seems that they are handled by the kernel.
Programming is in C++ .
I would appreciate any usefull suggestion about this.
Thank you.
Joss.
- 09-25-2008 #2
Looks like it's time for you to write a device driver, so google this:
Code:Linux "device driver" tutorial
--
Bill
Old age and treachery will overcome youth and skill.
- 09-25-2008 #3Just Joined!
- Join Date
- Sep 2008
- Posts
- 3
Hmm. You mean that it is not possible to program the UART through the kernel. Look gtkterm, a small terminal software like Hyper Terminal or Procomm, with this software you can configure line speed, thus gtkterm changes the content of the LCR (Line Control Register). This is exactly what I want to do exept that I want to talk with MSR and MCR, that are just differnents (but very close) IO ports.
- 09-25-2008 #4Yes. One can write a user application in C which configures line speed (transmission rate), bits per byte, parity (even/odd/off), number of stop bits and enabling/disabling hardware flow control, and which sends and detects break. That's why gtkterm could be written to do these things. For information on how to do that in C, do this at the command line:with this software you can configure line speed
But you want to do other things directly. I'm thinking that writing a driver might be the easiest way to do them.Code:man tcsetattr
--
Bill
Old age and treachery will overcome youth and skill.
- 09-30-2008 #5Just Joined!
- Join Date
- Sep 2008
- Posts
- 3
Sorry for delay before reply, I've been a few days off

Ok for your post but I have data concerning tcsetattr, but I have found some usefull information about functions included in <termios.h> in another forum, I will try some lines of code and will let you informed.
Thanks for the tip.
Joss.


Reply With Quote