Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

External buttons - LPT - 25.07.2007

Announcements of new plugins or updates.

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo

Szakalit
Posts: 11
Joined: October 17th, 2006, 8:47 pm

External buttons - LPT - 25.07.2007

Post by Szakalit »

Update: Buttons 1.2 (25.07.2007)

After update to 5.4 first function dont work properly,
instead of $dll(buttons,1,0,0) pls use $dll(buttons,2,$379,0)



Update: Buttons 1.2 (22.11.2006)

New:
- LED status on COM Port
- Writing to custom I/O port

Use:
LED status on COM Port:

$dll(buttons,3,COM1,1) - turn on D1 (pin 3)
$dll(buttons,3,COM1,10) - turn off D1 (pin 3)
$dll(buttons,3,COM1,2) - turn on D2 (pin 4)
$dll(buttons,3,COM1,20) - turn off D2 (pin 4)
$dll(buttons,3,COM1,3) - turn on D3 (pin 7)
$dll(buttons,3,COM1,30) - turn off D3 (pin 7)

You can also use COM2 - $dll(buttons,3,COM2,1)

Rx on schematic you have to chose by your self its depend on what type and colour of LED you are using, for example you can chose 1 Kohm.

Writing to custom I/O port:

$dll(buttons,4,$400,$45) - here you are writing value $45 on port $400, values are in hex.


If someone have other ideas how to upgrade this plugin or write something else pls write.



************************************************************

Update:

New:
- custom port function

Use:
$dll(buttons,2,$379,0) - you can change '$379' with port that you whant to use.


This is my first plugin :)
Its very simple.

Connection:
I used only 2 free pins of (10,11) but i think that you can use others too (12,13).

Plugin:
Copy buttons.dll to plugin folder.

Use:
$dll(buttons,1,0,0) this will give you result of reading at $379

Write $dll(buttons,1,0,0) at first line press apply and then pres one of your button's , this will show you the code of your button.
Now go to "actions" and add action like this:
$dll(buttons,1,0,0) = "code of your button" and the action.

If you have some problems/questions just write :)

(plugin hosted here on forums - login and download it)
You do not have the required permissions to view the files attached to this post.
Last edited by Szakalit on July 15th, 2007, 3:00 pm, edited 4 times in total.
santa8claws
Posts: 5
Joined: October 20th, 2006, 9:01 pm

Is there a dll file to download?

Post by santa8claws »

Hi, I was interested in this too, but didn't see any sources for attachment. Also would it be possible to add in an option to read from a custom I/O port for additional "button" logic inputs? That way I could use an extra digital input I/O port for keypad input.
Thanks again!
-- S8C
mihajlo
Posts: 3
Joined: October 23rd, 2006, 8:39 pm

Post by mihajlo »

Great idea, Szakalit!
Use:
$dll(buttons,1,0,0) this will give you result of reading at $379
Will it still work for a different port address?
Szakalit
Posts: 11
Joined: October 17th, 2006, 8:47 pm

Post by Szakalit »

mihajlo wrote:Great idea, Szakalit!
Thx
santa8claws wrote:Also would it be possible to add in an option to read from a custom I/O port for additional "button" logic inputs? That way I could use an extra digital input I/O port for keypad input.
mihajlo wrote:Will it still work for a different port address?
I will add "custom port function" today :)
twhyman
Posts: 19
Joined: October 20th, 2006, 8:10 am

Post by twhyman »

did any one tried connecting more buttons?

this one shows the use of pin 12 too.

Image

cause my lcd i got pins 10-13,15,17 free maybe we can use them for more buttons?

or using serial port fo buttons?

i would of tried but iam afraid to break somthing :oops:

thanks
Twhyman
Szakalit
Posts: 11
Joined: October 17th, 2006, 8:47 pm

Post by Szakalit »

twhyman wrote:did any one tried connecting more buttons?

this one shows the use of pin 12 too.


cause my lcd i got pins 10-13,15,17 free maybe we can use them for more buttons?

or using serial port fo buttons?

i would of tried but iam afraid to break somthing :oops:

thanks
Twhyman
Yes you can connect 12 and 13 - this will give you 4 buttons.

If someone need more buttons write and i will show how.
twhyman
Posts: 19
Joined: October 20th, 2006, 8:10 am

Post by twhyman »

ok so i just hook 4 buttons like the other 2 to pin 10-13, and use your plugin?

is thats it?


thanks alot
twhyman
Szakalit
Posts: 11
Joined: October 17th, 2006, 8:47 pm

Post by Szakalit »

twhyman wrote:ok so i just hook 4 buttons like the other 2 to pin 10-13, and use your plugin?

is thats it?
Yes :)
twhyman
Posts: 19
Joined: October 20th, 2006, 8:10 am

Post by twhyman »

Szakalit wrote:
twhyman wrote:ok so i just hook 4 buttons like the other 2 to pin 10-13, and use your plugin?

is thats it?
Yes :)
Man, you jusy made my day :)
wilbert
Posts: 2
Joined: November 16th, 2006, 6:27 pm

Buttons in a matrix with buttons.dll ?

Post by wilbert »

Szakalit tnx for riting this plugin.

Is it possible to conect the buttons in a matrix? I'm using a homemade keypad with 10 buttons and want to use them al.

Thanks!
Szakalit
Posts: 11
Joined: October 17th, 2006, 8:47 pm

Post by Szakalit »

Simple connection of 15 buttons.
You do not have the required permissions to view the files attached to this post.
Last edited by Szakalit on November 17th, 2006, 10:45 pm, edited 1 time in total.
mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Post by mattcro »

Check the schematic - shouldn't the diodes be the other way round?

For some parallel ports, it may be necessary to add pull-up resistors to +5V of around 10k ohms.
Szakalit
Posts: 11
Joined: October 17th, 2006, 8:47 pm

Post by Szakalit »

mattcro wrote:Check the schematic - shouldn't the diodes be the other way round?
Yes of course :oops: :oops: :oops: i have changed schematic.

mattcro wrote: For some parallel ports, it may be necessary to add pull-up resistors to +5V of around 10k ohms.
Yes you have right :D
santa8claws
Posts: 5
Joined: October 20th, 2006, 9:01 pm

How about LED outputs?

Post by santa8claws »

Hi,
I wanted to say thanks for this plugin. It has a great potential and seems very useful but I'd like to try a few other things.
Would it be possible to add an IO port output function for setting an output pin high so that you can read it back as an input?
For example to use pin 17 (SelectOutput)
write to port 0x37A with bit 3 set to output a high through open-collector outputs, which can then be pulled low and "read" using an input to port 0x37A
Additionally, would it be possible to perform an IO write to an alternate port address for setting some external LEDs such as a Red or Green status indicator.
How easy is it to change your code for this? Is this something you are willing to share?
Thanks!
IFR
Plugin Author
Posts: 201
Joined: April 6th, 2005, 12:59 am
Location: Canada
Contact:

Post by IFR »

hey I like the idea of an external LED support. :idea:

Maybe Szakalit can modify the code to add this extra feature.
limbo
Plugin Author
Posts: 1604
Joined: February 13th, 2005, 7:38 pm
Location: Athens - Greece
Contact:

Post by limbo »

IFR wrote:hey I like the idea of an external LED support. :idea:

Maybe Szakalit can modify the code to add this extra feature.
Yeah, something like GPO feature on Matrix Orbital. Using a pin and command it like an output
Szakalit
Posts: 11
Joined: October 17th, 2006, 8:47 pm

Re: How about LED outputs?

Post by Szakalit »

santa8claws wrote: Would it be possible to add an IO port output function for setting an output pin high so that you can read it back as an input?
For example to use pin 17 (SelectOutput)
write to port 0x37A with bit 3 set to output a high through open-collector outputs, which can then be pulled low and "read" using an input to port 0x37A
Hmm i think i don't know what exactly you want to do.
You want to put HI or LOW on Pin 17 (0x37A) and then read it back by 10,11,12,13 or 15 Pin (0x379) :?:

santa8claws wrote: Additionally, would it be possible to perform an IO write to an alternate port address for setting some external LEDs such as a Red or Green status indicator.
How easy is it to change your code for this? Is this something you are willing to share?
Thanks!
No its not hard to do that i think i will make this today with LPT and COM support :D
santa8claws
Posts: 5
Joined: October 20th, 2006, 9:01 pm

Re: How about LED outputs?

Post by santa8claws »

Szakalit wrote:
santa8claws wrote: Would it be possible to add an IO port output function for setting an output pin high so that you can read it back as an input?
For example to use pin 17 (SelectOutput)
write to port 0x37A with bit 3 set to output a high through open-collector outputs, which can then be pulled low and "read" using an input to port 0x37A
Hmm i think i don't know what exactly you want to do.
You want to put HI or LOW on Pin 17 (0x37A) and then read it back by 10,11,12,13 or 15 Pin (0x379) :?:
Some parallel parts require setting an output pin to a logic high before they can then be used as an "input" by reading back the status of the pin. If the port is EPP compatible, then the pin is an Input/Output and would be fine to just use as an input.

As a second idea, I was wondering about being able to perform basic output to set a bit and control an external LED. So for example, I could also just use a parallel pin as only an "output " and use it as a status indicator.
Szakalit wrote:
santa8claws wrote: Additionally, would it be possible to perform an IO write to an alternate port address for setting some external LEDs such as a Red or Green status indicator.
How easy is it to change your code for this? Is this something you are willing to share?
Thanks!
No its not hard to do that i think i will make this today with LPT and COM support :D

In thinking about the idea to make it more general purpose, I'm wondering if you can read or write to any IO port. For example I have a digital IO Port at address 0x140 that I can output 4 signals and read in 4 inputs. Wiring it up to a few keypad buttons and an LED indicator, I can use this plugin and it can control the LCD display pages and blink a few lights!
Szakalit
Posts: 11
Joined: October 17th, 2006, 8:47 pm

Re: How about LED outputs?

Post by Szakalit »

santa8claws wrote: Some parallel parts require setting an output pin to a logic high before they can then be used as an "input" by reading back the status of the pin. If the port is EPP compatible, then the pin is an Input/Output and would be fine to just use as an input.
Yes you have right, but in LPT only D0-D7 are bidirectional.
santa8claws wrote: As a second idea, I was wondering about being able to perform basic output to set a bit and control an external LED. So for example, I could also just use a parallel pin as only an "output " and use it as a status indicator.
I have started working on that but on standard LCD (2x16,2x20...) connection you have only 1 Pin free if you not using it to something else,
and that's why i want to add ComPort support, with COM you can add 3 LED's.
santa8claws wrote: In thinking about the idea to make it more general purpose, I'm wondering if you can read or write to any IO port. For example I have a digital IO Port at address 0x140 that I can output 4 signals and read in 4 inputs. Wiring it up to a few keypad buttons and an LED indicator, I can use this plugin and it can control the LCD display pages and blink a few lights!
Yes i can read or write to any IO port. But i need some information, in your example first 4 bytes are output or input? or output bytes are on 0x140 ind input on 0x140+1 ? If you will write me this information's i think i can help you :)


********************************************
Update:

Now i know that it's impossible to to control LED with the same LPT port that LCD is connected because Smartie always overwrite commands that i want to send :( So now it will be possible only with COM Ports or second LPT port but who wave 2 LPT ports in this times ?
santa8claws
Posts: 5
Joined: October 20th, 2006, 9:01 pm

Re: How about LED outputs?

Post by santa8claws »

Szakalit wrote:
santa8claws wrote: Some parallel parts require setting an output pin to a logic high before they can then be used as an "input" by reading back the status of the pin. If the port is EPP compatible, then the pin is an Input/Output and would be fine to just use as an input.
Yes you have right, but in LPT only D0-D7 are bidirectional.
santa8claws wrote: As a second idea, I was wondering about being able to perform basic output to set a bit and control an external LED. So for example, I could also just use a parallel pin as only an "output " and use it as a status indicator.
I have started working on that but on standard LCD (2x16,2x20...) connection you have only 1 Pin free if you not using it to something else,
and that's why i want to add ComPort support, with COM you can add 3 LED's.
Hmm, well presumably you could sacrifice a few parallel (button) inputs and make them outputs?
Szakalit wrote:
santa8claws wrote: In thinking about the idea to make it more general purpose, I'm wondering if you can read or write to any IO port. For example I have a digital IO Port at address 0x140 that I can output 4 signals and read in 4 inputs. Wiring it up to a few keypad buttons and an LED indicator, I can use this plugin and it can control the LCD display pages and blink a few lights!
Yes i can read or write to any IO port. But i need some information, in your example first 4 bytes are output or input? or output bytes are on 0x140 ind input on 0x140+1 ? If you will write me this information's i think i can help you :)


********************************************
Update:

Now i know that it's impossible to to control LED with the same LPT port that LCD is connected because Smartie always overwrite commands that i want to send :( So now it will be possible only with COM Ports or second LPT port but who wave 2 LPT ports in this times ?
That's too bad that Smartie takes over the LPT port.

Thanks for adding the function to output data over a specific IO port, whether it be serial com, second lpt, joystick port, or alternate digital io port. That seems to help the most since I'm looking to read/write to IO port 0x123 with an 8-bit value with 4 bits input and 4-bits output.

Happy Coding!
kostassite
Posts: 12
Joined: February 1st, 2007, 3:56 pm
Location: Athens
Contact:

Post by kostassite »

Hi,I just updated to 5.4 Lcd smartie and this plugin don't work
when I write $dll(buttons,1,0,0) and press apply the programm close.and if i open it again when it goes to that screen it closes again so i have to change the screen text through config.ini
Why???Whats wrong with the latest release???
shah81
Posts: 4
Joined: April 20th, 2006, 3:13 pm
Location: Malaysia

Post by shah81 »

kostassite wrote:Hi,I just updated to 5.4 Lcd smartie and this plugin don't work
when I write $dll(buttons,1,0,0) and press apply the programm close.and if i open it again when it goes to that screen it closes again so i have to change the screen text through config.ini
Why???Whats wrong with the latest release???
Got the same problem. Have to revert back to 5.3.2 for this plugin to work. Now I don't have that SSL option for email :(
kostassite
Posts: 12
Joined: February 1st, 2007, 3:56 pm
Location: Athens
Contact:

Post by kostassite »

Hi,I just updated to 5.4 Lcd smartie and this plugin don't work
when I write $dll(buttons,1,0,0) and press apply the programm close.and if i open it again when it goes to that screen it closes again so i have to change the screen text through config.ini
Why???Whats wrong with the latest release???

Can anyone answer me??????????????????????
shah81
Posts: 4
Joined: April 20th, 2006, 3:13 pm
Location: Malaysia

Post by shah81 »

kostassite wrote:Hi,I just updated to 5.4 Lcd smartie and this plugin don't work
when I write $dll(buttons,1,0,0) and press apply the programm close.and if i open it again when it goes to that screen it closes again so i have to change the screen text through config.ini
Why???Whats wrong with the latest release???

Can anyone answer me??????????????????????
I've pm Szakalit about this problem and he gave me a solutio
Hi

if you are using function $dll(buttons,1,0,0) and program is closing
use this function $dll(buttons,2,$379,0) and it will work
I've tried it and it worked for me. Now I can use version 5.4 :D
kostassite
Posts: 12
Joined: February 1st, 2007, 3:56 pm
Location: Athens
Contact:

Post by kostassite »

thanks
I will try it
Post Reply