Author Topic: Input/Output through LPT1  (Read 4112 times)

Craptastic

  • Regular Poster
  • **
  • Posts: 22
    • View Profile
Input/Output through LPT1
« on: February 03, 2009, 04:55:54 am »
Just starting to piece together my first system and trying to understand what options currently exist.

Are there any options for accessing data via LPT1?

There are so many other integration options with port access and a microcontroller.

Thanks.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Input/Output through LPT1
« Reply #1 on: February 03, 2009, 05:03:38 am »
Can you be more specific as to what you want to do? There are a lot of possible answers, and I need you to be more specific.

-Thom

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Input/Output through LPT1
« Reply #2 on: February 03, 2009, 05:43:52 am »
There are parallel port drivers out there for Linux that allow you to control individual lines of a parallel port so that you could use them to control relays, etc... presumably some of these drivers would allow bidirectionality as well so that you could read states as well.

You would need to write a "wrapper" piece of code around the driver API to translate between the DCE protocol and the driver's API. But note that the expectation is that you present DCE commands to LMCE which are high level (like turn power on, set vol level x, arm PIR device y, dim light to 20%, etc) not primitives like set line 1 to true, line 8 to false, etc. This is so LMCE doesn't need to know what operations are needed to achieve a particular lighting, security, media, climate, etc outcome, it simply issues the appropriate high level command to the appropriate device(s), and those DCE devices (your wrapper) know how to translate these commands into the specific actions needed to achieve that outcome. Thus the wrapper is likely to need a considerable amount of logic in it even if you hard-build it for a specific purpose. The more you build it to be a generic interface, the more logic will need to be built in and configuration data to customise this logic (either through the UI wizard or through the admin site).

Ultimately, you could end up with an equivalent to the GSD for parallel. Where it is a generic parallel driver DCE device that accepts commands which it then translates into specific actions by reading chunks of Ruby code assigned to each DCE command and executes that code. The Ruby code in turn then provides the logic required to set/read the parallel lines to achieve the task.

Its a lot of work - you should be aware that parallel ports are a technilogical dead end. Nothing new comes out with parallel ports because they have reached the end of their usefulness in terms of data transfer rates. It is vastly easier and cheaper to achieve the same transfer rate with serial technologies. Consequently, it won't be long before you can't even find a mobo that has a parallel port (the same has already happened for 232 style serial ports!)

You are almost certainly better off looking at USB options instead, even if you have a legacy device you can probably set it up using a USB->parallel device....

Craptastic

  • Regular Poster
  • **
  • Posts: 22
    • View Profile
Re: Input/Output through LPT1
« Reply #3 on: February 04, 2009, 03:26:09 am »

Thanks for the great reply. And yes, the PP is certainly already dead. If it were not for some amount of legacy stuff there would ultimately be more USB connections in that space.

Any port would work just as well.

What I am looking at is using something like a Motorola MCH6811 type of MC as a front end to effectively integrate anything.

Thinking that one only because I have one and have done a reasonable amount of MASM programming.

Are there other options with other ports for more low level communication? Not sure about the MCH for interpretation of high level, but if I need to pursue different MC not a big deal either.

I don't have a specific application in mind, and acknowledge a lot of home automation is now readily available through Zwave enabled devices. Just trying to understand potential capabilities. I don't need to do it today.

Craptastic


ddamron

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 962
    • View Profile
    • My LinuxMCE User Page
Re: Input/Output through LPT1
« Reply #4 on: February 04, 2009, 03:29:35 am »
umm, direct communication via port... ie 378H or 3BCH, depending on how you have your pp configured.
I've done a ton of that, pretty simple, write to the port, and read it back :)
The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Input/Output through LPT1
« Reply #5 on: February 04, 2009, 03:33:08 am »
You have two possibilities for creating new drivers:

* GSD (written in Ruby)
* C++

-Thom

ddamron

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 962
    • View Profile
    • My LinuxMCE User Page
Re: Input/Output through LPT1
« Reply #6 on: February 04, 2009, 03:36:21 am »

Thanks for the great reply. And yes, the PP is certainly already dead. If it were not for some amount of legacy stuff there would ultimately be more USB connections in that space.

Any port would work just as well.

What I am looking at is using something like a Motorola MCH6811 type of MC as a front end to effectively integrate anything.

Thinking that one only because I have one and have done a reasonable amount of MASM programming.

Are there other options with other ports for more low level communication? Not sure about the MCH for interpretation of high level, but if I need to pursue different MC not a big deal either.

I don't have a specific application in mind, and acknowledge a lot of home automation is now readily available through Zwave enabled devices. Just trying to understand potential capabilities. I don't need to do it today.

Craptastic



There's a ton of good stuff on microchip.com if you like low level...
Very affordable ICSP (serial programming), programming PICs are a snap.

Hope that helps

Dan
The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.

ddamron

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 962
    • View Profile
    • My LinuxMCE User Page
Re: Input/Output through LPT1
« Reply #7 on: February 04, 2009, 03:38:31 am »
Also, there's 1 wire devices that are allready implemented.  If you need Temp sensors, etc.

(I'm just brainstorming here)

Dan
The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.

darrenmason

  • Addicted
  • *
  • Posts: 529
    • View Profile
Re: Input/Output through LPT1
« Reply #8 on: February 04, 2009, 07:46:38 am »
I have also integrated Phidgets which works quite well for sensors.