connecting DIY glue logic to linuxCNC through HAL

More
24 Feb 2014 00:04 - 24 Feb 2014 00:09 #44086 by plasturo
Hi to all outside in the world,

I build a DIY glue logic with a hand full of 74xx logic and try to get it in connection with linuxCNC running.

What I need to do, is sending an Address (example 0x00) and a data (example: 0x5A) through the LPT in EPP Mode (for test).
What do I need to tell LinuxCNC to send both values with the help of the HAL Interface?

I searched a lot in the web using www.linuxcnc.org, forum and Google, but it doesen't help.
I tried to set up the hm2_7i43, even if it doesn't fit my hardware. What I can see is, that my PCI-Card is set to ioaddr=0x0e10, because the control LED goes off after sending the 7i43 driver. So, the communication itself works.

Can somebody tell me where I can find the source code of the hostmot2 and the hm2_7i43?

[EDIT] @admin: Sorry, wrong Category, please move to General LinuxCNC Questions [/EDIT]
Thanks a lot,
bye,
Plasturo
Last edit: 24 Feb 2014 00:09 by plasturo.

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

More
24 Feb 2014 00:44 #44087 by ArcEye
Hi

You are probably going to have to write your own driver, so where you are already looking is along the right lines

Can somebody tell me where I can find the source code of the hostmot2 and the hm2_7i43?


sudo apt-get install git if not already installed

git clone git://git.linuxcnc.org/git/linuxcnc.git linuxcnc-dev will fetch the master sources

./linuxcnc-dev/src/hal/drivers/mesa_hostmot2/ will bring you to the sources

regards
The following user(s) said Thank You: plasturo

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

More
27 Feb 2014 06:00 - 27 Feb 2014 06:02 #44216 by plasturo
Hi to all outside in the world,

( I build a DIY glue logic with a hand full of 74xx logic and try to get it in connection with linuxCNC running.
What I need to do, is sending an Address (example 0x00) and a data (example: 0x5A) through the LPT in EPP Mode (for test).
To do so, I want to use the "hm2_7i43.c" file as an example and build my own driver. )

I installed "ubuntu-10.04-linuxcnc3-i386.iso" and set it up with "git" to get the sources like describled in
"wiki.linuxcnc.org/cgi-bin/wiki.pl?Instal..._or_8_04_from_source"

I performed the following:

plasturo@linux-CNC:~$ sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev
plasturo@linux-CNC:~$ sudo apt-get install git-core
plasturo@linux-CNC:~$ git config --global user.name "My Name"
plasturo@linux-CNC:~$ git config --global user.email "This email address is being protected from spambots. You need JavaScript enabled to view it."
plasturo@linux-CNC:~$ sudo apt-get install libpth-dev
plasturo@linux-CNC:~$ sudo apt-get install git-core gitk git-gui
plasturo@linux-CNC:~$ git clone git://git.linuxcnc.org/git/linuxcnc.git linuxcnc-dev

plasturo@linux-CNC:~$ cd linuxcnc-dev
plasturo@linux-CNC:~/linuxcnc-dev$ git checkout master
plasturo@linux-CNC:~/linuxcnc-dev$ git pull

plasturo@linux-CNC:~/linuxcnc-dev$ cd src
plasturo@linux-CNC:~/linuxcnc-dev/src$ sudo apt-get install libmodbus-dev
plasturo@linux-CNC:~/linuxcnc-dev/src$ sudo apt-get install libusb-1.0-0-dev
plasturo@linux-CNC:~/linuxcnc-dev/src$ sudo apt-get install python

plasturo@linux-CNC:~/linuxcnc-dev/src$ ./autogen.sh
plasturo@linux-CNC:~/linuxcnc-dev/src$ ./configure --enable-run-in-place

plasturo@linux-CNC:~/linuxcnc-dev/src$ make

Then I copied the files hm2_7i43.h and hm2_7i43.c to the file hm2titan.h and hm2titan.c and inclcude
this change in the Makefile.

After compiling the full kernel again, I god the object-file hm2titan.o as aspected.

But if I have a look into the files under /usr/realtime-2.6.32-122-rtai/modules/linuxcnc/
I can only find object-files with ending *.ko

Where is the misstake, what can I do to get the right *.ko file??

Is there a possiblility to compile only the needed file (and not the full kernel)?

Thanks for your help,
Plasturo
Last edit: 27 Feb 2014 06:02 by plasturo.

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

More
27 Feb 2014 15:27 #44227 by ArcEye

Is there a possiblility to compile only the needed file (and not the full kernel)?


From the shell within which you have set your RIP environment variables,
cd to the dir with your files in it and run
comp --install hm2titan.c

regards
The following user(s) said Thank You: plasturo

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

More
27 Feb 2014 20:45 #44233 by andypugh

Then I copied the files hm2_7i43.h and hm2_7i43.c to the file hm2titan.h and hm2titan.c and inclcude
this change in the Makefile.


hm2_7i43 is intended to work with the rest of the Hostmot2 driver, so I think you will struggle to make it work for your purpose.

Have a look at the Pluto-P drivers instead. Those are simple, standalone EPP device drivers.
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...e0c2259abfc1;hb=HEAD
They are even written in the "comp" format to make things even easier.
www.linuxcnc.org/docs/html/hal/comp.html
The following user(s) said Thank You: plasturo

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

More
28 Feb 2014 00:48 #44238 by andypugh
Thinking about this some more, are you sure you need EPP?
I can imagine a very simple component that simply sends address and data on alternate thread invocations.

At it's simplest parallel port access is a very simple outb instruction, though it is safer to use the rtapi version in realtime code.
www.linuxcnc.org/docs/html/man/man3/rtapi_outb.3rtapi.html
component simple_io "a very simple parallel port driver";
pin unsigned in address;
pin unsigned in data;
;;
static int s = 0;
static int old_address = 0;
switch s{
case 0:
    if (address != old_address)
        rtapi_outb(address, 0x378);
        s = 1;
        old_address = address;
    }
        break;
case 1:
    rtapi_outb(data, 0x378);
    break;
}
The following user(s) said Thank You: plasturo

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

More
28 Feb 2014 04:54 #44240 by plasturo
Thank you all for your answer an help,

@ArcEye: Thanks for the information, I start to read the documentation about "comp". I think that is what I am was looking for.

@andypugh: I try to use as much code as possible, and the philosophy of the "hostmot2" is nice, I think. That's why I am trying to change the "hm2_7i43" code to be able to drive my hardware. On the other hand, I had of course a look to the Pluto-P driver. I will see what will be the good starting point for me.

And yes, I am sure to use EPP mode (I hope), because it is much quicker then using the LPT in standard mode. So the "rtapi_outb" is not the right one for me. I will use a lot of input signals, too.

So, thanks a lot to all, I am looking forward to the weekend and hope I find the time to go on with my little project.

Bye,
Plasturo

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

More
28 Feb 2014 05:14 #44243 by plasturo
Hi,
to see what I have done until now, here is a picture

from left to right
1.) LPT board, includes 74xx245 for data and 74xx574 for address latching
The addresses are decode with a 74xx138 for reading and a 74xx238 for writing

2. and 3.) Two output-boards with 8 bit each. A 74xx573 is used as a driver for the LED's.

4.,5. and 6.) Three input-boards with 8 bit each. A74xx573 is used for the LED's, too

7.) Power-Supply +5V

bottom:) The "EPP-Bus" with 8bit Data plus selection bus for read and write.

All Boards (2..6) contain own optocopler behind the Connectors.

bye,
Plasturo
Attachments:

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

More
04 Mar 2014 05:24 - 04 Mar 2014 05:36 #44378 by plasturo
Hi all,
I start to play a little bit with "comp", but it doesn' work.
Can somebody tell me what is wrong?

Home directory = /home/plasturo
src dir = /home/plasturo/linuxcnc-dev

What I try is the following:

root@linux-CNC:/home/plasturo/linuxcnc-dev/src/hal/drivers/mesa-hostmot2# comp --install hm2titan.c

Answer from the program:

Das Programm »comp« ist in folgenden Paketen enthalten:
* mailutils-mh
* nmh
Versuchen Sie: apt-get install <ausgewähltes Paket>
root@linux-CNC:/home/plasturo/linuxcnc-dev/src/hal/drivers/mesa-hostmot2#

(first line: The Program "comp" is included in the following packages:)
(last line: Please try: apt-get install <selected package>)

Both, "apt-get install nmh" and "apt-get install mailutils-mh" doesn't help.

Can somebody help me?

Thanks and bye,
Plasturo
Last edit: 04 Mar 2014 05:36 by plasturo.

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

More
04 Mar 2014 07:13 #44384 by andypugh

Das Programm »comp« ist in folgenden Paketen enthalten:


sudo apt-get install build-essential
sudo apt-get install linuxcnc-dev

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

Time to create page: 0.082 seconds
Powered by Kunena Forum