mapping gpio as a serial or parport

Started by drspastic, February 10, 2013, 06:19:55 PM

Previous topic - Next topic

drspastic

hi, one of my control applications needs either i learn c and replace the parts that can waggle the logic states of either rs232 or parallel printer port, or i hope, there is a way i can make a couple of pins pretend they belong to either type of port.
i need one line to act as a logic input and one as output. usually would use the control lines of a serial port (rts or dtr  as output and cts, dsr, or dcd as input) but that entails adding usb/serial dongle, then rs232/ttl level converter to get back to 5v logic. thats messy.
so has anyone a quick fix for this that avoids me spending the next 6 months learning c? i would rather just get this working and box it up.

JohnS

Olimex posted about using gpio so what's wrong with that way?

drspastic

Quote from: JohnS on February 10, 2013, 06:47:36 PM
Olimex posted about using gpio so what's wrong with that way?

problem is that i want to get on with my project and dont know enough about c to change the source code for thelinkbox. i am thinking of a lot of uses for the olinuxino boards to be integrated with amateur radio which is my main thing. there lots of software available that runs fine on the olimex but most of it uses serial port control lines to switch the transmitter on and to see if the reciever is getting any signals.

its far better to not modify working source code so a user can update from the repo.
what im getting at is maybe a driver that can mount the gpio pins to /dev/tty?

forgive me if what im asking is already there/obvious/impossible but my forte is antenna design and analogue electronics, i only know what i have already needed to learn about software design, and my programming days were in the 80's so im far away from being a linux guru.

any help that avoids me adding unnecessary extra hardware is welcomed, also help to identify what i should be looking for to make my own solutions if that is likely to be within my grasp.

the tutorial to get the led to come on was very informative and i had much fun adding bits to the script to make it flash morse code but that as far as it got. i still dont know how to read the state of the inputs, and certainly cant just edit it into a large complex piece of source code like thelinkbox.

there are points of learning where one doesnt know the questions one must google.

JohnS

You sound like you have not read the Olimex article about gpio and really should do.

JohnS

Here's how to find it:
in google put
a13 olinuxino gpio

JohnS

You really have no idea what you are talking about.  Clearly you have not looked at the actual messages I have posted for example detailing how to use a USB serial port or to make uboot do things and you also have not read the gpio article.

You don't want to put in even small effort such as google or search or RTFM.

Instead you are LAZY and COMPLAIN.  Well, it's EASY to be LAZY.  Much harder to be helpful.  Go do it.

drspastic

Quote from: JohnS on February 11, 2013, 01:15:59 AM
You really have no idea what you are talking about.  Clearly you have not looked at the actual messages I have posted for example detailing how to use a USB serial port or to make uboot do things and you also have not read the gpio article.

You don't want to put in even small effort such as google or search or RTFM.

Instead you are LAZY and COMPLAIN.  Well, it's EASY to be LAZY.  Much harder to be helpful.  Go do it.

you are clearly a very angry man. you had to have one last rant. i asked you to ignore my posts, please do so now if you have quite finished.

drspastic

anyone else have a suggestion how to trick the gpio pins to think they are rs232 control lines.

nvd

Let's see if I have got you correct.

You can only write to a device, preferably "/dev/ttySX", because you want to use software that is already available. Right?

Can I know about the software package to see how flexible is its configuration?

drspastic

Quote from: nvd on February 13, 2013, 11:34:51 AM
Let's see if I have got you correct.

You can only write to a device, preferably "/dev/ttySX", because you want to use software that is already available. Right?

Can I know about the software package to see how flexible is its configuration?

thanks! heres the link: http://sourceforge.net/apps/mediawiki/cqinet/index.php?title=Linkbox-url

i know i should learn C and rewrite the bits i need but this project is taking too long already what with all the electronics side i have been working on, plus it will be lambing season before long then there will be no time at all!
my county/states amateur radio repeater has been off air for years and i really want to get one up to replace it. its fitting to use a bulgarian computer to control it. im hoping thelinkbox will run eventually on the 233 micro but im going to try a13 first.

if there is a way to NOT alter the source code it will be even better so updates can go straight on.
also avoids forking the work of thelinkbox guys. forks are bad.

it can use pins of a paralel printer port but like most amateur radio software it can use the control lines on a serial port. sure i can plug a usb serial port and level converter but thats a silly duplication of hardware when all the signaling required is one logic input (is anyone using the radio?) and one logic output (better turn the transmitter on then).
if it wasnt for the fact that it needs to also connect to the internet conference echolink system (trunk to other counties/ international) i could just leave the computer out and link the radios via a couple of logic chips!

many thanks for coming back to me on this, i hope you can think of something.