![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Controlling a RS-232 Serial Console from a Shell Script | Ishikawa | Shell Programming and Scripting | 1 | 01-10-2009 09:18 PM |
| how to set the variales for serial port | smartgupta | SUN Solaris | 1 | 11-22-2008 08:27 AM |
| Serial port configuration | munirh | SCO | 1 | 04-22-2008 09:09 AM |
| serial port signal | ppass | SUN Solaris | 0 | 02-04-2005 11:11 AM |
| PERL:controlling serial ports ? | perleo | Shell Programming and Scripting | 1 | 06-13-2003 03:42 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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. |
| Bookmarks |
| Tags |
| lowlevel serial port programming |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|