Software controlling serial port pins


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Software controlling serial port pins
# 1  
Old 06-23-2009
Question Software controlling serial port pins

Hi. I have a project where I intend to connect a simple Infra-Red circuit to a computer. I must then make a software to control this device via software, i.e., I will not be using microcontrollers in the circuit.

I believe the best way to do it is using the serial port, /dev/ttyS0, and the function ioctl(). The thing is that I've found some code and tried a lot, but none seems to be clear enough or to do exactly what I want.

I understand that out of the 9 pins, there are some that I can't change, like the ground(GND) but seems like the others I can, through some sort of AND and OR operations, using iotcl;

I'm also having some doubts about what is HIGH and LOW because using TIOCMGET it shows some pins are HIGH, and when I test them I check no vcc on them, whereas some indicated as LOW do not have voltage.

Also, there seems to be some default configuration on the ttyS0 port, since with a LED, I touch the negative to the GND(5) and the pins 3 4 and 7 seem to be HIGH, lighting up the LED, while the remaining pins do not light it up.

So, I'm assuming that the pins that by default light the LED are set with HIGH values by the system

By the way, I'm running Ubuntu 9.04, Kernel 2.6.28, GNOME 2.26.1.

So, I would like some neat explanations to help me understand how to use the pins of the serial port to implement this unorthodox and most simple device.

The point is, such device may use GND to as its ground, and some all the time HIGh pin as its VCC, and other 2 pins, one to simply send pulses that will activate the infra-red signal, and other to receive electrical pulses from any infra-red device.

As an end, I desire to use this scheme to comunicate two computers with one of such infra-red serial connected device in each, and to controll the emission and receiving of the bits(pulses) by software.

That will allow me to define my start and end bits, size of word, etc.

Note that it is all didatic end, not much like pratical, but still usefull as a learning process envolving C programming to manipulate serial port and a little bit of electronics.

The circuit schematics is this:
Construíndo um Transmissor Infravermelho Para o seu PC | Clube do Hardware

No one needs to read it in portuguese to understand how to mount it up.

Now, the big challenge is to hook it up to a serial cable connected to the serial port and start programming it. Any, really, any constructive comments will be highly appreciated.
# 2  
Old 07-01-2009
Try a search for bit-banging parallel ports. That will be a better choice.
Motorola had an app note covering it in probably 1976.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Cabling and adapters to communicate to service processor serial port from Windows PC with USB port.

Hello, I have an unloaded T5140 machine and want to access the ILOM for the first time and subsequently the network port after that., and then load Solaris 10 the final January 2011 build. The first part is what confuses me -the cabling. I am coming from a Windows machine (w/appropriate... (5 Replies)
Discussion started by: joboy
5 Replies

2. Web Development

Setup Serial Port

I need to set a serial port to 9600 7E1. How do I accomplish this? I've tried every combination, with no luck. (6 Replies)
Discussion started by: Meow613
6 Replies

3. Solaris

Using PC serial port from ReflectionX

I am using ReflectionX on a windows PC to run an application on a Solaris box. The application uses the serial port and expects a definition like: /dev/ttyb Is there a way to use the PC serial port through ReflectionX? PC is running Windows-XP Solaris Box is: Sun Microsystems sun4u... (1 Reply)
Discussion started by: deanjennings
1 Replies

4. Solaris

How to enable Serial port on ILOM, when Network Port is enabled in parallel

Hi Everyone, In my environment, I have few T5220. On the iLOM Management Card, I have both Network and Serial port are cabled, I don't have any issues while I try to connect using Network Management port, but when I try to connect the serial port for the same server which is actually connected... (3 Replies)
Discussion started by: bobby320
3 Replies

5. Shell Programming and Scripting

Need help with serial port

Hi, I have a external board connected to my serial port. I need to execute "shutdown -r now" command when system boot up. When system boots up it requires a username ans password. Then I need to run my command. I can use rc script but that is rebooting system before it asks for username and... (0 Replies)
Discussion started by: charlie.arya
0 Replies

6. Windows & DOS: Issues & Discussions

Telnet to a serial port

Hello all. I have an old computer with M$-DOS 7. I want to use it like a dumb terminal, with telnet. I need to connect it to my desktop These are my questions: How can i configure the serial port on dos? How can i telnet form dos to the serial port? How can i set up a telnet server on the... (12 Replies)
Discussion started by: mghis
12 Replies

7. Solaris

Serial port on the T5140

What is the serial port on the T5140 used for. (4 Replies)
Discussion started by: pgsanders
4 Replies

8. Solaris

Serial port problem

I am working with solaris 9 sparc and I want to connect physical device in serial port but when I am connecting it,It is showing the error window saying-- So can any1 tell me the reason or is there any package I have to add to work with serial port??? (2 Replies)
Discussion started by: smartgupta
2 Replies

9. UNIX for Advanced & Expert Users

Communicating with Serial Port

I am using system running on red hat linux 4. I had connected health measuring machine to the serial port and configured it stty -F /dev/ttyS0 9600 -parenb cs8 -cstopb this machine requires a command to be passed to it for giving output. I am unable to pass command hexa format(0x68) to the... (4 Replies)
Discussion started by: netsavant
4 Replies

10. Shell Programming and Scripting

PERL:controlling serial ports ?

Is it possible to write a perl program to controll the serial port? e.g. What iam trying to do, for a challenge is create a box with two lights. red and green, connect to a serial port and have a perl program to give me the options to turn on the red light or green light. Is this possilbe, can... (1 Reply)
Discussion started by: perleo
1 Replies
Login or Register to Ask a Question