connecting DIY glue logic to linuxCNC through HAL

More
04 Mar 2014 15:06 #44389 by ArcEye

src dir = /home/plasturo/linuxcnc-dev


Or, if you are using a RIP install as that dir name suggests, you must be in a shell session with the environment variables set before comp can be located.
ie
. ./scripts/rip-environment

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

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

More
07 Mar 2014 04:51 #44513 by plasturo
Hi ArcEye,

thanks a lot, ". ./scripts/rip-environment" was what I missed.

Now I start to play/program a little bit with the own driver.

bye,
Plasturo

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

More
10 Mar 2014 04:12 - 17 Mar 2014 03:25 #44614 by plasturo
Hi andypugh,

I start trying to understand the hm2_7i43 driver, but I think it is to haevy for me. So I follow your idea to try the PLUTO_P driver. I read the pluto_step.comp file and think, that this way is easier. Thanks for the tip.

I also used the comp --install and it worked with the right RIP-settings. Thanks to ArcEye.

But to understand the HAL component builder "comp" I need more background knowledge.

Can somebody tell me a good german web page where I can learn more about "comp"?
I try to read this: linuxcnc.org/docs/html/hal/comp.html, but in german it will be easier to read for me.

Thanks an bye,
Plasturo
Last edit: 17 Mar 2014 03:25 by plasturo.

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

More
10 Mar 2014 04:25 #44615 by andypugh

Can somebody tell me a good german web page where I can learn more about "comp"?
I try to read this: linuxcnc.org/docs/html/hal/comp.html, but in german it will be easier to read for me.


Unfortunately the german docs translation is almost non-existent. This should be it, you will see that almost nothing is translated.

linuxcnc.org/docs/html/index_de.html

I doubt that google translate would be much help either.
The following user(s) said Thank You: plasturo

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

More
16 Mar 2014 18:23 - 16 Mar 2014 18:39 #44876 by plasturo
Hi all,

I tried a little bit with the EPP-Mode of the parallel interface. in general it works for writing information to different addresses, so I am able to send the value 0x00 to 0xff for address 0x00, 0x04, ... to the hardware.
I used the pluto-step driver as basis to rewrite a new driver. The content of the part EXTRA_SETUP() I used to send some test scenarios:
EXTRA_SETUP() {
	rtapi_print_msg(RTAPI_MSG_ERR, "Performing EXTRA SETUP\n");
    return titan_setup();
}

One part of the titan_setup() is the following to check the READ function:
	rtapi_print_msg(RTAPI_MSG_ERR, "START OF TEST.\n");

	EPP_DIR_WRITE();
	EPP_ADDR(0);
	EPP_WRITE(0xf0);

	EPP_DIR_READ();
	input = EPP_READ();
	
	rtapi_print_msg(RTAPI_MSG_ERR, "read value is: 0x%x\n", input);

	EPP_DIR_WRITE();
	EPP_WRITE(0x0f);
	
	rtapi_print_msg(RTAPI_MSG_ERR, "END OF TEST.\n");
I make a picture of the signals. The yellow line (CH1)is one bit of the written signal. I use it to get the trigger point. The light blue line (CH2) is the /ASTR signal. The purple line (CH3) is /WRITE and the blue line (CH4) is /DSTR.
Now we can see that the event before the trigger point is the EPP_ADDR(0);
Then on the trigger point the bit is set with the command EPP_WRITE(0xf0);
In the space, there has to be the EPP_DIR_READ(); input = EPP_READ();, but it isn't.
And at the end we see EPP_DIR_WRITE(); EPP_WRITE(0x0f); because the bit is set to zero.

Why is there no /DSTR in the moment where I like to read the value from the hardware?
Do I need to add some code in the driver?

Additionally I can not understand why the EPP_DIR_xxx is empty:
static inline void EPP_DIR_WRITE(void) { }
static inline void EPP_DIR_READ(void) { }
Is it only a declaration? Where can I find the content?


Thanks for you ideas and help in advance,
bye,
Plasturo
Attachments:
Last edit: 16 Mar 2014 18:39 by plasturo.

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

More
16 Mar 2014 22:59 - 16 Mar 2014 23:01 #44882 by plasturo
I did it ....

... the solution is:
static inline void EPP_DIR_WRITE(void) {
	outb(inb(ioaddr+2) & 0xdf, ioaddr+2); // set direction bit(5) to 0 (write)
}

static inline void EPP_DIR_READ(void) {
	outb(inb(ioaddr+2) | 0x20, ioaddr+2); // set direction bit(5) to 1 (read)
}

bye,
Plasturo

PS.: I am suprised, that there is nothing in the pluto_step driver at this place ... how can the pluto_step driver read values from the hardware?
Last edit: 16 Mar 2014 23:01 by plasturo.

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

More
16 Mar 2014 23:27 #44883 by andypugh

I did it ....

That's good, I hadn't a clue.

I am suprised, that there is nothing in the pluto_step driver at this place ... how can the pluto_step driver read values from the hardware?

A stepper system might not read anything back from hardware?

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

More
17 Mar 2014 00:00 #44884 by plasturo
jip, it is clear that a stepper itself doesn't need a read-back, but what about the eStop, switches, ... ?
I thought that these things are included ...

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

More
17 Mar 2014 02:36 #44888 by PCW
Actually I'm pretty sure that the pluto stepgen _does_ need readback but whats odd is
this idea that you need to change the EPP direction to read or write. This only makes sense
if you are emulating EPP port hardware on a normal (PS2) type parallel port, EPP hardware does
all direction control and handshaking in hardware so no explicit direction change is needed.

Data or address read or writes with a working EPP parallel port are simply
inb and outb instructions to the proper addresses (assuming 8 bit access)
The following user(s) said Thank You: plasturo

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

More
17 Mar 2014 03:03 #44890 by plasturo
hmm, that means, that there is something wrong with my hardware, or not on the good way initialised.

I am using the foloowing:
plasturo@linux-CNC:~/linuxcnc-dev/src$ sudo lspci -vv
01:00.2 Parallel controller: NetMos Technology Device 9912 (prog-if 03)
        Subsystem: Device a000:2000
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0, Cache Line Size: 64 bytes
        Interrupt: pin C routed to IRQ 11
        Region 0: I/O ports at e010 [size=8]
        Region 1: I/O ports at e000 [size=8]
        Region 2: Memory at fea01000 (32-bit, non-prefetchable) [size=4K]
        Region 5: Memory at fea00000 (32-bit, non-prefetchable) [size=4K]
        Capabilities: [50] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable-
                Address: 0000000000000000  Data: 0000
        Capabilities: [78] Power Management version 3
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0-,D1-,D2-,D3hot+,D3cold+)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [80] Express (v1) Legacy Endpoint, MSI 00
                DevCap: MaxPayload 512 bytes, PhantFunc 0, Latency L0s <1us, L1 <2us
                        ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
                DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
                        RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+
                        MaxPayload 128 bytes, MaxReadReq 512 bytes
                DevSta: CorrErr+ UncorrErr- FatalErr- UnsuppReq+ AuxPwr- TransPend-
                LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 <64ns, L1 unlimited
                        ClockPM+ Suprise- LLActRep- BwNot-
                LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-
                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
        Capabilities: [100] Advanced Error Reporting <?>

I use the ioaddress 0xe010.

Is there anybody who knows about this parallel-port adapter?

bye,
Plasturo

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

Time to create page: 0.096 seconds
Powered by Kunena Forum