8255 Based IO cards

More
20 Sep 2013 03:20 #39039 by macona
8255 Based IO cards was created by macona
I am setting up IO for my laser welder, the laser itself wants about 30 inputs to make it work and runs on 15v logic so I am looking at using some of the opto-22 modules I have. To drive that I have a Advantech PCL-722 ISA card that has the 50 pin headers that will hook right up to it.

I looked up support for it under linuxcnc and didnt find anything specific. I see there is support for the AX5214H board which is listed as a ISA 8255 Mode 0 board and one site lists the ACL-7122 as a replacment for that. The ACL-7122 is what appears to be another brand's version of the PCL-722. Both these boards are 8255 Mode 0 boards.

So, can the AX5214H driver run these boards? Also in some of the documentation I saw a reference to a "generic8255" hal driver. Any ideas?

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

More
20 Sep 2013 04:25 - 20 Sep 2013 04:26 #39040 by andypugh
Replied by andypugh on topic 8255 Based IO cards

I am setting up IO for my laser welder, the laser itself wants about 30 inputs to make it work and runs on 15v logic so I am looking at using some of the opto-22 modules I have. To drive that I have a Advantech PCL-722 ISA card that has the 50 pin headers that will hook right up to it.


Have you seen: www.linuxcnc.org/docs/html/man/man9/pcl720.9.html
Last edit: 20 Sep 2013 04:26 by andypugh.

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

More
20 Sep 2013 06:17 #39051 by macona
Replied by macona on topic 8255 Based IO cards
Yes, I did. The 720 is based of a 8254 instead of a 8255. Even though the driver does not support the timer functions os the 8254 I am not sure if the driver will run it.

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

More
20 Sep 2013 07:08 #39053 by andypugh
Replied by andypugh on topic 8255 Based IO cards

Yes, I did. The 720 is based of a 8254 instead of a 8255. Even though the driver does not support the timer functions os the 8254 I am not sure if the driver will run it.


I think the chances are extremely good that it will.

Why not try it? It only takes a few minutes to find out.

The driver component is ver simple, even if it isn't quite right I suspect that a few changes to register addresses in the .comp file will make it work.

Have you looked at the driver file? It is very short:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...f91d011eb2db;hb=HEAD

You can ignore the reset function, that is just for software step generation.

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

More
23 Sep 2013 13:36 #39126 by macona
Replied by macona on topic 8255 Based IO cards
I will give it a try. I have had a cold since friday and have not felt like doing anything but sleep. Ugh.

I need to rig up power to the external I/O Boards I got with the PCL-722, it wants +5 and 12, I should have a brick around that can put that out.

What is the best way to toggle an output to the board through the HAL to see if it works?

-Jerry

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

More
23 Sep 2013 17:41 #39131 by andypugh
Replied by andypugh on topic 8255 Based IO cards

What is the best way to toggle an output to the board through the HAL to see if it works?


I do all this sort of stuff from the halcmd interface (command line). It removes a lot of the other variables.

open a terminal window, and type
halrun
This will start the realtime environment and the command prompt will change.
Hal functions need to be added to a thread before anything happens, so first start a thread.
loadrt threads
start
.You can check that has worked:
show thread
Now you need to load the PCL720 driver, and this probably requires you to know the port used by the board.
loadrt pcl720 ioaddr=0x200
Then the read/write functions need to be added to the thread
addf pcl720.0.read thread1
addf pcl720.write thread1
Now you can try reading pins. To list them all
show pin
And to see a particular pin
getp pcl720.0.pin-00-in
To set the value of a pin
setp pcl720.0.pin-00-out 1
When you have finished in the halcmd prompt
exit


The PCL720 is a 32 bit input + 32 bit output board, with a single port, whereas the PCL722 has 6 x 24-bit ports that appear to be configurable at the port level for input or output.
Looking at the manuals and the PCL720 driver, you should be able to treat the PCL722 as a set of 6 pcl720 boards. However you can't use pins >23 for IO, those become config setting pins.
Specifically, on any one port setp pcl720.N.pin-24-out 1 sets pins 16 to 19 as input (setp ... 0 for output). pin-25-out controls the direction of pins 8 to 15. pin-27-out controls pins 20 to 23, and pin-28-out sets the direction of pins 0 to 7. (I might have pins 24 and 27 switched, there is a typo in the documentation....)

So, if the code above worked for a single port on the board, you should be able to access all the other ports by pretending they are multiple pcl720s.
loadrt pcl20 ioaddr=0x200,0x204,0x208,0x20c,0x210,0x214

It wouldn't be hard to modify the pcl720.comp file to be specific to the pcl722. The only difficulty I see is that the code would have to be rather clever to remove the output pins in HAL when the ports were set to input. (outputs can still be read as inputs, so those pins would stay).

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

More
30 Sep 2013 11:49 #39378 by macona
Replied by macona on topic 8255 Based IO cards
OK, I finally got around to trying it. The 720 driver did nothing. I decided to try the ax5214h driver since it is supposed to be a 8255 compatible card. I coudnt get that working either. I just set everything to output but never got any response out of the relay card for the board.

Here is my terminal stuff, I had to guess on the commands, maybe I got them wrong?

-Jerry
macona@laser-welder:~$ halrun
halcmd: loadrt threads
halcmd: start
halcmd: show thread
Realtime Threads:
     Period  FP     Name               (     Time, Max-Time )
     999967  YES               thread1 (        0,        0 )

halcmd: loadrt hal_ax5214h cfg="0x200 OOOOOOOO"
halcmd: addf ax5214h.0.write thread1
halcmd: show pin
Component Pins:
Owner   Type  Dir         Value  Name
     5  bit   IN          FALSE  ax5214h.0.out-00
     5  bit   IN          FALSE  ax5214h.0.out-01
     5  bit   IN          FALSE  ax5214h.0.out-02
     5  bit   IN          FALSE  ax5214h.0.out-03
     5  bit   IN          FALSE  ax5214h.0.out-04
     5  bit   IN          FALSE  ax5214h.0.out-05
     5  bit   IN          FALSE  ax5214h.0.out-06
     5  bit   IN          FALSE  ax5214h.0.out-07
     5  bit   IN          FALSE  ax5214h.0.out-08
     5  bit   IN          FALSE  ax5214h.0.out-09
     5  bit   IN          FALSE  ax5214h.0.out-10
     5  bit   IN          FALSE  ax5214h.0.out-11
     5  bit   IN          FALSE  ax5214h.0.out-12
     5  bit   IN          FALSE  ax5214h.0.out-13
     5  bit   IN          FALSE  ax5214h.0.out-14
     5  bit   IN          FALSE  ax5214h.0.out-15
     5  bit   IN          FALSE  ax5214h.0.out-16
     5  bit   IN          FALSE  ax5214h.0.out-17
     5  bit   IN          FALSE  ax5214h.0.out-18
     5  bit   IN          FALSE  ax5214h.0.out-19
     5  bit   IN          FALSE  ax5214h.0.out-20
     5  bit   IN          FALSE  ax5214h.0.out-21
     5  bit   IN          FALSE  ax5214h.0.out-22
     5  bit   IN          FALSE  ax5214h.0.out-23
     5  bit   IN          FALSE  ax5214h.0.out-24
     5  bit   IN          FALSE  ax5214h.0.out-25
     5  bit   IN          FALSE  ax5214h.0.out-26
     5  bit   IN          FALSE  ax5214h.0.out-27
     5  bit   IN          FALSE  ax5214h.0.out-28
     5  bit   IN          FALSE  ax5214h.0.out-29
     5  bit   IN          FALSE  ax5214h.0.out-30
     5  bit   IN          FALSE  ax5214h.0.out-31
     5  bit   IN          FALSE  ax5214h.0.out-32
     5  bit   IN          FALSE  ax5214h.0.out-33
     5  bit   IN          FALSE  ax5214h.0.out-34
     5  bit   IN          FALSE  ax5214h.0.out-35
     5  bit   IN          FALSE  ax5214h.0.out-36
     5  bit   IN          FALSE  ax5214h.0.out-37
     5  bit   IN          FALSE  ax5214h.0.out-38
     5  bit   IN          FALSE  ax5214h.0.out-39
     5  bit   IN          FALSE  ax5214h.0.out-40
     5  bit   IN          FALSE  ax5214h.0.out-41
     5  bit   IN          FALSE  ax5214h.0.out-42
     5  bit   IN          FALSE  ax5214h.0.out-43
     5  bit   IN          FALSE  ax5214h.0.out-44
     5  bit   IN          FALSE  ax5214h.0.out-45
     5  bit   IN          FALSE  ax5214h.0.out-46
     5  bit   IN          FALSE  ax5214h.0.out-47

halcmd: setp ax5214h.0.out-00 1
halcmd: setp ax5214h.0.out-12 1
halcmd: setp ax5214h.0.out-24 1
halcmd: setp ax5214h.0.out-47 1
halcmd: show pin
Component Pins:
Owner   Type  Dir         Value  Name
     5  bit   IN           TRUE  ax5214h.0.out-00
     5  bit   IN          FALSE  ax5214h.0.out-01
     5  bit   IN          FALSE  ax5214h.0.out-02
     5  bit   IN          FALSE  ax5214h.0.out-03
     5  bit   IN          FALSE  ax5214h.0.out-04
     5  bit   IN          FALSE  ax5214h.0.out-05
     5  bit   IN          FALSE  ax5214h.0.out-06
     5  bit   IN          FALSE  ax5214h.0.out-07
     5  bit   IN          FALSE  ax5214h.0.out-08
     5  bit   IN          FALSE  ax5214h.0.out-09
     5  bit   IN          FALSE  ax5214h.0.out-10
     5  bit   IN          FALSE  ax5214h.0.out-11
     5  bit   IN           TRUE  ax5214h.0.out-12
     5  bit   IN          FALSE  ax5214h.0.out-13
     5  bit   IN          FALSE  ax5214h.0.out-14
     5  bit   IN          FALSE  ax5214h.0.out-15
     5  bit   IN          FALSE  ax5214h.0.out-16
     5  bit   IN          FALSE  ax5214h.0.out-17
     5  bit   IN          FALSE  ax5214h.0.out-18
     5  bit   IN          FALSE  ax5214h.0.out-19
     5  bit   IN          FALSE  ax5214h.0.out-20
     5  bit   IN          FALSE  ax5214h.0.out-21
     5  bit   IN          FALSE  ax5214h.0.out-22
     5  bit   IN          FALSE  ax5214h.0.out-23
     5  bit   IN           TRUE  ax5214h.0.out-24
     5  bit   IN          FALSE  ax5214h.0.out-25
     5  bit   IN          FALSE  ax5214h.0.out-26
     5  bit   IN          FALSE  ax5214h.0.out-27
     5  bit   IN          FALSE  ax5214h.0.out-28
     5  bit   IN          FALSE  ax5214h.0.out-29
     5  bit   IN          FALSE  ax5214h.0.out-30
     5  bit   IN          FALSE  ax5214h.0.out-31
     5  bit   IN          FALSE  ax5214h.0.out-32
     5  bit   IN          FALSE  ax5214h.0.out-33
     5  bit   IN          FALSE  ax5214h.0.out-34
     5  bit   IN          FALSE  ax5214h.0.out-35
     5  bit   IN          FALSE  ax5214h.0.out-36
     5  bit   IN          FALSE  ax5214h.0.out-37
     5  bit   IN          FALSE  ax5214h.0.out-38
     5  bit   IN          FALSE  ax5214h.0.out-39
     5  bit   IN          FALSE  ax5214h.0.out-40
     5  bit   IN          FALSE  ax5214h.0.out-41
     5  bit   IN          FALSE  ax5214h.0.out-42
     5  bit   IN          FALSE  ax5214h.0.out-43
     5  bit   IN          FALSE  ax5214h.0.out-44
     5  bit   IN          FALSE  ax5214h.0.out-45
     5  bit   IN          FALSE  ax5214h.0.out-46
     5  bit   IN           TRUE  ax5214h.0.out-47

halcmd: 

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

More
30 Sep 2013 18:58 #39388 by andypugh
Replied by andypugh on topic 8255 Based IO cards
Are you sure that the card base address is 0x200?

Has the card ever worked for you in the current machine?

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

More
30 Sep 2013 22:35 #39404 by macona
Replied by macona on topic 8255 Based IO cards
According to the manual I have the dip switches at 200. It says the same for 220 so I tried that too and it didn't work either.

I have never tried this card before. It was sent to me by a friend with the io boards and I never used it. I had nothing I needed it for until now.

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

More
30 Sep 2013 22:57 #39405 by andypugh
Replied by andypugh on topic 8255 Based IO cards

According to the manual I have the dip switches at 200. It says the same for 220 so I tried that too and it didn't work either.


How are you testing it? Do you have the opto22 racks attached, or are you using a multimeter?

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

Time to create page: 0.113 seconds
Powered by Kunena Forum