MESA 7i92 Disable Encoder Index Pin

More
4 years 8 months ago #233773 by Ralfh
Hi,
i have a fine running system and currently looking for a method to crash it. :) 
I have currently 3 glasscales for XYZ where i dont use the index signal, because my connectors on my electrical case didnt had enough pins. The readhmid shows me: 
Code:
 1      0   IOPort       PWM              0        PWM             (Out) 14      1   IOPort       None                                               Spindle on  2      2   IOPort       StepGen          0        Step/Table1     (Out) 15      3   IOPort       None                                               Z Home  3      4   IOPort       StepGen          0        Dir/Table2      (Out) 16      5   IOPort       StepGen          4        Step/Table1     (Out)  4      6   IOPort       StepGen          1        Step/Table1     (Out) 17      7   IOPort       StepGen          4        Dir/Table2      (Out)  5      8   IOPort       StepGen          1        Dir/Table2      (Out)  6      9   IOPort       StepGen          2        Step/Table1     (Out)  7     10   IOPort       StepGen          2        Dir/Table2      (Out)  8     11   IOPort       StepGen          3        Step/Table1     (Out)  9     12   IOPort       StepGen          3        Dir/Table2      (Out) 10     13   IOPort       None                                                  GoHome      11     14   IOPort       None           **************************************FREI 12     15   IOPort       None                                               XHome 13     16   IOPort       None                                               YHome IO Connections for P1 Pin#  I/O   Pri. func    Sec. func       Chan      Pin func        Pin Dir  1     17   IOPort       None            14     18   IOPort       QCount           2        Quad-IDX        (In)  2     19   IOPort       None                                               ProgramRun 15     20   IOPort       None                                               EStop  3     21   IOPort       QCount           0        Quad-A          (In) 16     22   IOPort       None                                               ZStopMacro  4     23   IOPort       QCount           0        Quad-B          (In) 17     24   IOPort       None             5     25   IOPort       QCount           0        Quad-IDX        (In)  6     26   IOPort       None                                               ProgramPause  7     27   IOPort       None                                               3DProbe  8     28   IOPort       PWM              1        PWM             (Out)  9     29   IOPort       QCount           1        Quad-A          (In) 10     30   IOPort       QCount           1        Quad-B          (In) 11     31   IOPort       QCount           1        Quad-IDX        (In) 12     32   IOPort       QCount           2        Quad-A          (In) 13     33   IOPort       QCount           2        Quad-B          (In)

Now i'm running out of GPIO's and wondered if i can reuse my useless encoder-index pins as such GPIO's.
I thought about: 
  1. Just net-ing the pins to my signals, but that would probably crash linuxcnc.
  2. Deleting the Quad-IDX out of my bitfile. Would that compile or would that crash also?
I may try both methods i nobody stops me messing around. 

Please Log in to join the conversation.

More
4 years 8 months ago #233815 by D.L.
Use only the second method, the encoder counter can work correctly without index pin.
For this replace strings in your PIN_*.vhd file:
Code:
IOPortTag & x"0*" & QCountTag & QCountIdxPin to IOPortTag & x"00" & NullTag & NullPin
and recompile sources.

Please Log in to join the conversation.

More
4 years 8 months ago #233816 by PCW
You can use an index pin as a GPIO input with no firmware changes
as long as you don't set index_enable true

If you want to use the pin as a GPIO output you need to use method 2
as D.L. showed.

Please Log in to join the conversation.

More
4 years 8 months ago #233862 by Ralfh

Use only the second method, the encoder counter can work correctly without index pin.
For this replace strings in your PIN_*.vhd file:IOPortTag & x"0*" & QCountTag & QCountIdxPin
to
IOPortTag & x"00" & NullTag & NullPin
and recompile sources.

That was exactly what i did, and it compiled to my surprise. I also removed the B-Axis part to get antoher 2 GPIOs. Yeah i know i already could have them whith disabling the stepgen in hal, but i was renovating my BIT file anyway. If anyone is interested, the readhmid and the corresponding BIT file are attacched. 
Code:
IO Connections for P2 Pin#  I/O   Pri. func    Sec. func       Chan      Pin func        Pin Dir  1      0   IOPort       PWM              0        PWM             (Out) 14      1   IOPort       None             2      2   IOPort       StepGen          0        Step/Table1     (Out) 15      3   IOPort       None             3      4   IOPort       StepGen          0        Dir/Table2      (Out) 16      5   IOPort       None             4      6   IOPort       StepGen          1        Step/Table1     (Out) 17      7   IOPort       None             5      8   IOPort       StepGen          1        Dir/Table2      (Out)  6      9   IOPort       StepGen          2        Step/Table1     (Out)  7     10   IOPort       StepGen          2        Dir/Table2      (Out)  8     11   IOPort       StepGen          3        Step/Table1     (Out)  9     12   IOPort       StepGen          3        Dir/Table2      (Out) 10     13   IOPort       None            11     14   IOPort       None            12     15   IOPort       None            13     16   IOPort       None            IO Connections for P1 Pin#  I/O   Pri. func    Sec. func       Chan      Pin func        Pin Dir  1     17   IOPort       None            14     18   IOPort       None             2     19   IOPort       None            15     20   IOPort       None             3     21   IOPort       QCount           0        Quad-A          (In) 16     22   IOPort       None             4     23   IOPort       QCount           0        Quad-B          (In) 17     24   IOPort       None             5     25   IOPort       None             6     26   IOPort       PWM              1        PWM             (Out)  7     27   IOPort       None             8     28   IOPort       None             9     29   IOPort       QCount           1        Quad-A          (In) 10     30   IOPort       QCount           1        Quad-B          (In) 11     31   IOPort       None            12     32   IOPort       QCount           2        Quad-A          (In) 13     33   IOPort       QCount           2        Quad-B          (In)

Please Log in to join the conversation.

Time to create page: 4.249 seconds
Powered by Kunena Forum