LPT ->LCD + LED... how?

obbelix

Aug 1, 2004
7
Joined
Aug 1, 2004
Messages
7
Hi!

I'm trying to build a "remote-control" to my software (written in Delphi 6) with a LCD display, some keys and a LED.

What I want is:
When I press a button (on my circuit) I read that value from the LPT port and start a process in my application. The application now shows some info on the LCD (via LPT) and a LED should light.
And when I press another button, the process will stop and the LED goes off.

The buttons and LCD is working. How I write/read to/from LPT is not a problem. It is just how I should wire the hardware so I also (with some code) can light up an LED.
To light up a led without having an LCD connected at the same port is easy but because the LCD uses all the data-pins (2-9) of the LPT there is a huge problem (for me).

Schematics for the LCD and buttons that I use (not made by me) :
http://mitglied.lycos.de/MASE5/linux/lcdenglish/lcd-mit-tastatur-harware.html

I also found the attached jpg on the web... Is this useful?

View attachment 35642

 
Last edited by a moderator:

harsh2

Jul 29, 2004
90
Joined
Jul 29, 2004
Messages
90
hmmm
the circuit may not work as planned,because when u optput a logic one to the LS373 the output will be high , which in effect will turn OFF the LED.

 

obbelix

Aug 1, 2004
7
Joined
Aug 1, 2004
Messages
7
hmmm
the circuit may not work as planned,because when u optput a logic one to the LS373 the output will be high , which in effect will turn OFF the LED.
Ok... Is there any other way to do this?

If not, is it possible to have the led turned on/off with key 1/2 without the LPT do this? So, if i press "key 1" it both sends signal to LPT and maybe to an IC that turns the led on. And when "key 2" is pressed the LED goes off.
 

AJB2K3

Jun 26, 2004
185
Joined
Jun 26, 2004
Messages
185
look for a mag called EPE(Everyday Practical Electronics) they have a win dll made to help with LPT interfacing.
Split the led/lcd circuits.
the leds can be set up to light when data travels between the pc and the lcd using a PORT MONITOR which is nothing more then a M&F D25 with a risistor and led connected to D0-D7, at its most complicated it can contain a transistor.

 
Last edited by a moderator:

MP1

Dec 7, 2003
3,399
Joined
Dec 7, 2003
Messages
3,399
obbelix,
You can use the other pins of the parallel port to send data. Another way is to use one of the data bits to also light the LED. The data is sent at such a high frequency that an LED will look like a steady light. However, the LED will draw too much current from the data line unless you buffer it. I do not mean an inverting buffer such as 7404, but if that is more readily available, you can use two sections of the same chip so that it inverts twice. If you are limited with space, you can use an op-amp to buffer the signal. In fact, a simple bipolar transistor such as 2n3904 used as a switch should work as well. You would use the data line to trigger the base.

MP

 

harsh2

Jul 29, 2004
90
Joined
Jul 29, 2004
Messages
90
Obbelix,Please note :: i did not say that it would not work..

just that it may not work as planned..

also i see no problem wiring the circuit as you have it above...

The buttons and LCD is working.
Great :)
To light up a led without having an LCD connected at the same port is easy
also good.. :)
but because the LCD uses all the data-pins (2-9) of the LPT there is a huge problem
why? .. the chips that drive the LPT can easily handle two inputs each..
 

obbelix

Aug 1, 2004
7
Joined
Aug 1, 2004
Messages
7
->harsh

also i see no problem wiring the circuit as you have it above...
Do you mean as the link or the attached picture?

the chips that drive the LPT can easily handle two inputs each..
Ok... how? is it a programming thing?

- - - - - - - - - - - - - - - -

->MP

You can use the other pins of the parallel port to send data.
Are you shure?
The LCD has 14/16 pins where 10 of them are connected to the LPT (pin 1-9 + 16). Pin 10-13 + 15 of the LPT is for input. Pin 18-25 i ground. That makes only pin 14 and 17 free. But those pins are "Control"... Can I send data to, for example, pin 17 so the LED could light?

- - - - - - - - - - - - - - - -
 

MP1

Dec 7, 2003
3,399
Joined
Dec 7, 2003
Messages
3,399
The 8 data bits of the LPT port are accessed with the port address or otherwise known as the base address. The other pins are accessed as Base +1 and Base +2 address. The LPT port address you are using of course is the base address. i.e.- LPT1, &H378, etc.
I am doing this from memory, so I am not sure exactly which pins are which for base + 1 or base + 2, but I have a chart somewhere if you cannot figure it out with a little test code and an LED.

MP

 

harsh2

Jul 29, 2004
90
Joined
Jul 29, 2004
Messages
90
yes in the attached circuit...


*sigh*
ok all i was saying was the circuit will work as pictured.

 

obbelix

Aug 1, 2004
7
Joined
Aug 1, 2004
Messages
7
I am doing this from memory, so I am not sure exactly which pins are which for base + 1 or base + 2, but I have a chart somewhere if you cannot figure it out with a little test code and an LED.
Base + 1 = inputs (pin 10,11,12,13,15)
Base + 2 = contol (pin 0,14,16,17)

I was testing some yesterday and it seems that I could use pin 17 to control the led.. Haven't tested with a LED yet, but will do that later today.
 
Last edited by a moderator:

obbelix

Aug 1, 2004
7
Joined
Aug 1, 2004
Messages
7
Yes! it seems to work with pin 17.
Now I just have to assamble all the components.

Thanks!

 

MP1

Dec 7, 2003
3,399
Joined
Dec 7, 2003
Messages
3,399
Glad to hear you made it work! Yes, those are the correct pin assignments for the port, with the exception that base +2 is with pin #1. I think you have a typo with pin #0.
Good luck with your project!

MP

 

obbelix

Aug 1, 2004
7
Joined
Aug 1, 2004
Messages
7
Now I have assambled all the components and it works!

The LED is connected to pin 17 and all I had do to was to modify the script so if I want the LED "on" I change the "control" value that is sent to the LPT.

Maybe I will make a schematics for my unit. If so, I upload it here.

 
Top