How do PnCConf's Mesa Card 0 I/O tabs' pin numbers correspond to stepconf's?

More
02 Sep 2022 13:47 - 02 Sep 2022 13:48 #251003 by PCW
The numbers shown on pncconf (and in the hal file) are the GPIO or channel numbers,
not the DB25 numbers, so for example GPIO 7 corresponds to DB25 pin 17 and
GPIO 14,15 correspond to DB25 pins 11,12:

The numbers shown on pncconf (and in the hal file) are the GPIO or channel numbers,
not the DB25 numbers, so for example GPIO 7 corresponds to DB25 pin 17 and
GPIO 14,15 correspond to DB25 pins 11,12:

IO Connections for P3
Pin#  I/O   Pri. func    Sec. func       Chan      Pin func        Pin Dir

 1      0   IOPort       PWMGen           0        PWM             (Out)
14      1   IOPort       None
 2      2   IOPort       StepGen          0        Step            (Out)
15      3   IOPort       None
 3      4   IOPort       StepGen          0        Dir             (Out)
16      5   IOPort       StepGen          8        Step            (Out)
 4      6   IOPort       StepGen          1        Step            (Out)
17      7   IOPort       StepGen          8        Dir             (Out)
 5      8   IOPort       StepGen          1        Dir             (Out)
 6      9   IOPort       StepGen          2        Step            (Out)
 7     10   IOPort       StepGen          2        Dir             (Out)
 8     11   IOPort       StepGen          3        Step            (Out)
 9     12   IOPort       StepGen          3        Dir             (Out)
10     13   IOPort       None
11     14   IOPort       QCount           0        Quad-A          (In)
12     15   IOPort       QCount           0        Quad-B          (In)
13     16   IOPort       QCount           0        Quad-IDX        (In)

 
Last edit: 02 Sep 2022 13:48 by PCW.

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

More
03 Sep 2022 12:13 - 04 Sep 2022 12:21 #251098 by clunc
The numbers shown on pncconf (and in the hal file) are the GPIO or channel numbers,
not the DB25 numbers, so for example GPIO 7 corresponds to DB25 pin 17 and
GPIO 14,15 correspond to DB25 pins 11,12:

The numbers shown on pncconf (and in the hal file) are the GPIO or channel numbers,
not the DB25 numbers, so for example GPIO 7 corresponds to DB25 pin 17 and
GPIO 14,15 correspond to DB25 pins 11,12:



IO Connections for P3
Pin#  I/O   Pri. func    Sec. func       Chan      Pin func        Pin Dir

 1      0   IOPort       PWMGen           0        PWM             (Out)
14      1   IOPort       None
 2      2   IOPort       StepGen          0        Step            (Out)
15      3   IOPort       None
 3      4   IOPort       StepGen          0        Dir             (Out)
16      5   IOPort       StepGen          8        Step            (Out)
 4      6   IOPort       StepGen          1        Step            (Out)
17      7   IOPort       StepGen          8        Dir             (Out)
 5      8   IOPort       StepGen          1        Dir             (Out)
 6      9   IOPort       StepGen          2        Step            (Out)
 7     10   IOPort       StepGen          2        Dir             (Out)
 8     11   IOPort       StepGen          3        Step            (Out)
 9     12   IOPort       StepGen          3        Dir             (Out)
10     13   IOPort       None
11     14   IOPort       QCount           0        Quad-A          (In)
12     15   IOPort       QCount           0        Quad-B          (In)
13     16   IOPort       QCount           0        Quad-IDX        (In) 

I believe I have it now. [EDIT: I almost had it--see EDITs]

The answer to the original question:
"Q. How do PnConf's Mesa Card 0 I/O tabs' pin numbers correspond to stepconf's?"
"A. It depends."
  • "It depends on what firmware has been flashed into the Mesa card, and reloaded, and what pin information is in the .hal file."
  • "mesaflash --readhmid --device <cardtype> (in .pin file format) will show how GPIO numbers (in the 'I/O' column of the .pin file) correspond to the DB25 pins (the 'Pin#' column). [the core answer]"
  • "The .hal file, typically initially created by newusers with PnCConf, can be edited to change the DB25 pin numbers ('pin#') to which inputs or outputs have been/will be assigned." b]EDIT:[/b] [b][i]GPIO numbers[/i][/b
  • "The lines-of-interest to be changed look like, for example, 'net probe-in     <=  hm2_5i25.0.gpio.011.in'."
  • "Unfortunately, the lines contain the word 'gpio' although the number is a DB25 'pin#'." [EDIT: Wrong. Numbers in lines like that are, always, and only, GPIO numbers. Edit carefully accordingly.]
  • "Another line of particular interest--'loadrt hm2_pci config=" num_encoders=0 num_pwmgens=1 num_stepgens=4"'--determines when more 'gpio' pins are available when they are freed from use for encoders, stepgens, etc."
  • "In the .pin file listing above for example, 'pin#-I/O' 11-14, 12-15, and 13-16 will be available to be assigned as input or output pins in the .hal file IF 'num_encoders=0' is also specified therein."
From the .pin file listing above, and my .hal file previously attached then, the DB25 pinout will be,
sorted by DB25 pin#: [EDIT: It's okay to sort by DB25 pin#, BUT the numbers to focus on are the GPIO#s, the ones that need to be changed in the .hal file]
IO Connections for P3[DB25]
DB25 GPIO MY.HAL
Pin# I/O                 Pri. func    Sec. func       Chan     Pin func        Pin Dir
 1      0   Spindle     IOPort       PWMGen          0        PWM             (Out)
 2      2   Xstep        IOPort       StepGen          0        Step            (Out)
 3      4   Xdir           IOPort       StepGen          0        Dir             (Out)
 4      6   Ystep        IOPort       StepGen          1        Step            (Out)
 5      8   Ydir           IOPort       StepGen          1        Dir             (Out)
 6      9   Zstep        IOPort       StepGen          2        Step            (Out)
 7     10   Zdir          IOPort       StepGen          2        Dir             (Out)
 8     11   Astep       IOPort       StepGen          3        Step            (Out)
 9     12   Adir          IOPort       StepGen          3        Dir             (Out)
10     13  N/A          IOPort       None
11     14  Probe-in                  IOPort       QCount           0        Quad-A          (In) [EDIT: example follows]
12     15  Both-home-X-in      IOPort       QCount           0        Quad-B          (In)
13     16  Both-home-Y-in       IOPort       QCount           0        Quad-IDX        (In)
14      1   N/A                         IOPort       None
15      3   Both-home-Z-in      IOPort       None
16      5   N/A                         IOPort       StepGen          8        Step            (Out)
17      7   Spindle-enable-out IOPort       StepGen          8        Dir             (Out)

[EDIT: one example: DB-25 pin11, I want to be "probe-in".  I find it referenced in the .hal as:

net probe-in     <=  hm2_5i25.0.gpio.003.in
I edit it, using the GPIO# corresponding to the DB25 pin# I want to see it on, 014 from the table:
net probe-in     <=  hm2_5i25.0.gpio.014.in
Simple.]

Thank you very much for your patience in helping me, even as I mis-read and mis-interpreted and mis-understood, and now state the obvious, to veterans. I have to say that there are enough curve-balls in the process that it's understandable to me that a bush-leaguer's likely to strikeout the first several times at the plate in the majors. (I'll characterize my case perhaps as an intentional walk after a few beanballs that sent me out or the game to recover.)

[EDIT: That goes double for me.]
Last edit: 04 Sep 2022 12:21 by clunc. Reason: Correct. Clarify for following readers.
The following user(s) said Thank You: tommylight

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

More
03 Sep 2022 14:54 #251104 by PCW
A couple notes:

1. Mesa hal files only use GPIO numbers, _never_ pin numbers.

2. Pins with secondary input function are still available
as inputs even if the secondary function is enabled
(so you could still use GPIO 14,15,16 as inputs with
the encoder enabled)

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

More
04 Sep 2022 11:49 #251163 by clunc

A couple notes:

1. Mesa hal files only use GPIO numbers, _never_ pin numbers.

Okay, but that means I still don't grasp how to get DB25/P3 pin numbers out of the hal file.

2. Pins with secondary input function are still available
as inputs even if the secondary function is enabled
(so you could still use GPIO 14,15,16 as inputs with
the encoder enabled)

I am not able to imagine a setup that would need this--BUT I think I've documented that I am not imaginative.

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

More
04 Sep 2022 12:00 - 04 Sep 2022 12:27 #251164 by clunc
(Slowing down, taking a breath... reading what I wrote.)

...I still don't grasp how to get DB25/P3 pin numbers out of the hal file.

Not true.

The .pin file (and output of mesaflash --readhmid --device 5i25) show the correlation between DB25 pin# and GPIO#; I just mis-edited the .hal file assuming that I was changing DB25 pin#s when I was really changing GPIO#.

So, I need to edit the .hal again to correct my misunderstanding.

Now, I have it!

[EDIT: I've gone back to edit my summary post to include Peter's correction.]
[EDIT: I've edited this post to complain about the forum-software's pernicious "auto-formatting 'feature'" that arbirtrarily corrupts existing format when Edit Post is selecting, requiring considerable effort to put-it-back-the-way-it-was.]
Last edit: 04 Sep 2022 12:27 by clunc.

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

More
06 Sep 2022 10:14 #251274 by clunc
When linuxcnc is run from a console terminal, the pinouts of the Mesa card appear in the listing; for example in my case:
--clip--
hm2/hm2_5i25.0: IO Pin 000 (P3-01): PWMGen #0, pin Out0 (PWM or Up) (Output)
hm2/hm2_5i25.0: IO Pin 001 (P3-14): IOPort
hm2/hm2_5i25.0: IO Pin 002 (P3-02): StepGen #0, pin Step (Output)
hm2/hm2_5i25.0: IO Pin 003 (P3-15): IOPort
hm2/hm2_5i25.0: IO Pin 004 (P3-03): StepGen #0, pin Direction (Output)
hm2/hm2_5i25.0: IO Pin 005 (P3-16): IOPort
hm2/hm2_5i25.0: IO Pin 006 (P3-04): StepGen #1, pin Step (Output)
hm2/hm2_5i25.0: IO Pin 007 (P3-17): IOPort
hm2/hm2_5i25.0: IO Pin 008 (P3-05): StepGen #1, pin Direction (Output)
hm2/hm2_5i25.0: IO Pin 009 (P3-06): StepGen #2, pin Step (Output)
hm2/hm2_5i25.0: IO Pin 010 (P3-07): StepGen #2, pin Direction (Output)
hm2/hm2_5i25.0: IO Pin 011 (P3-08): StepGen #3, pin Step (Output)
hm2/hm2_5i25.0: IO Pin 012 (P3-09): StepGen #3, pin Direction (Output)
hm2/hm2_5i25.0: IO Pin 013 (P3-10): IOPort
hm2/hm2_5i25.0: IO Pin 014 (P3-11): IOPort
hm2/hm2_5i25.0: IO Pin 015 (P3-12): IOPort
hm2/hm2_5i25.0: IO Pin 016 (P3-13): IOPort
--/clip--

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

Moderators: cmorley
Time to create page: 0.077 seconds
Powered by Kunena Forum