Sponsored Content
Top Forums UNIX for Advanced & Expert Users Software controlling serial port pins Post 302328205 by tigreped on Tuesday 23rd of June 2009 05:33:21 PM
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.
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. Solaris

Serial port on the T5140

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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
plmpower(8)							     powerman							       plmpower(8)

NAME
plmpower - control Insteon/X10 devices via SmartLabs PLM 2412S SYNOPSIS
plmpower --device serial-port DESCRIPTION
plmpower is a helper program for powerman which enables communication with Insteon/X10 devices via SmartLabs Power Line Modem, model 2412S. It is run interactively by the powerman daemon. It can also be useful as a standalone tool for debugging X10/Insteon networks based on the above device. NETWORK SETUP
Note the addresses of your Insteon/X10 devices. Plug the PLM into an AC outlet, preferably on the same electrical phase as the devices under control. Devices are available to bridge phases if this is not possible. Attach the PLM's serial port to your computer, and ensure that nothing else is using the serial port such as the system console or getty(8). Run plmpower and try the interactive commands below to see if the devices respond reliably. Once everything is working, configure powermand to run plmpower as a coprocess as described in powerman.conf(5). OPTIONS
-d, --device serial-port Specify the path to the special file connected to the PLM's serial port. -t, --timeout msec Set the Insteon timeout to the specified number of milliseconds (default 1000). -x, --x10-attempts number Set the number of times to run every X10 command (default 3). X10 does not provide an ACK/NAK mechanism like Insteon so we cannot be certain that any particular X10 command completed, therefore X10 commands are issued multiple times to increase confidence. INTERACTIVE COMMANDS
The following commands are accepted at the plmpower> prompt. Address arguments may be Insteon (e.g. 1A.2B.3C) or X10 (e.g. G12). help Display help on the available commands. info Get info about the PLM. reset Reset the PLM (clears the all-link db). on addr Turn on device. off addr Turn off device. status addr Query status of device (Insteon only). ping addr Time round trip request/response to device (Insteon only). FILES
/usr/sbin/plmpower /etc/powerman/powerman.conf ORIGIN
PowerMan was originally developed by Andrew Uselton on LLNL's Linux clusters. This software is open source and distributed under the terms of the GNU GPL. SEE ALSO
powerman(1), powermand(8), httppower(8), plmpower(8), vpcd(8), powerman.conf(5), powerman.dev(5), powerman-devices(7). http://sourceforge.net/projects/powerman powerman-2.3.5 2009-02-09 plmpower(8)
All times are GMT -4. The time now is 04:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy