parport0 OK, parport1 NADA

More
16 Dec 2019 00:45 - 16 Dec 2019 00:49 #152703 by FlashPackets
Running the Port Tester example in "PyVCP Examples" works great for parport0

making changes to the hal for parport1
loadrt hal_parport cfg="0xd010 out"
loadusr -Wn ptest pyvcp -c ptest ptest.xml
loadrt threads name1=porttest period1=1000000
addf parport.1.read porttest
addf parport.1.write porttest
net pin01 ptest.btn01 parport.1.pin-01-out ptest.led-01
net pin02 ptest.btn02 parport.1.pin-02-out ptest.led-02
net pin11 parport.1.pin-11-in ptest.led-11
net pin12 parport.1.pin-12-in ptest.led-12
start

No Joy . NADA That dang button doesn't magically change it's color to green. Didn't work for 0x0278 either.

I got the address by running
@dmesg -c # to clear the buffer
@shutdown -r now
Then on reboot
@dmesg}|grep parp*

Which gave
[    5.281772] ppdev: user-space parallel port driver
[    5.535134] parport_pc 00:06: reported by Plug and Play ACPI
[    5.535219] parport0: PC-style at 0x378, irq 5 [PCSPP,TRISTATE]
[    5.633889] lp0: using parport0 (interrupt-driven).
[    5.635397] PCI parallel port detected: 1415:c110, I/O at 0xd010(0xd000), IRQ 17
[    5.635486] parport1: PC-style at 0xd010 (0xd000), irq 17 [PCSPP,TRISTATE,EPP]
[    5.737992] lp1: using parport1 (interrupt-driven).

Very frustrating! Any ideas on what's required to make this work?

There is a clue from the command line ...
Note: Using POSIX realtime
config string '0xd010 out'
HAL: ERROR: function 'parport.1.read' not found
p1test.hal:4: addf failed

But of course I already know that because the dang button does not work.
Last edit: 16 Dec 2019 00:49 by FlashPackets.

Please Log in or Create an account to join the conversation.

More
16 Dec 2019 01:45 - 16 Dec 2019 01:47 #152704 by PCW
Replied by PCW on topic parport0 OK, parport1 NADA
Pretty sure that if you

loadrt hal_parport cfg="0xd010 out"

you will have only instantiated hal pins for parport.0

That is your port at 0xd010 will be accessed as parport.0

man hal_parport

for details
Last edit: 16 Dec 2019 01:47 by PCW.

Please Log in or Create an account to join the conversation.

More
16 Dec 2019 02:43 #152706 by FlashPackets
You're exactly correct.Using parport1's address of0xd010 with parport.0.pin-01-out
did generate some interest so then I tried

loadrt hal_parport cfg="0x0378 out 0xd010 out"
loadusr -Wn ptest pyvcp -c ptest ptest.xml
loadrt threads name1=porttest period1=1000000
addf parport.1.read porttest
addf parport.1.write porttest
net pin01 ptest.btn01 parport.1.pin-01-out ptest.led-01
net pin02 ptest.btn02 parport.1.pin-02-out ptest.led-02
net pin11 parport.1.pin-11-in ptest.led-11
net pin12 parport.1.pin-12-in ptest.led-12
start

That also works.
Apparently both ports must be instantiated to do a proper association.

And it's barely been an hour from my initial post and problem solved. Absolutely fabulous forum!

Please Log in or Create an account to join the conversation.

Time to create page: 0.088 seconds
Powered by Kunena Forum