(Copying this to the emc-users list.)

Eric H. Johnson wrote:
> I was wondering if that was what you meant. Here is the dmesg log following
> the loading of hostmot2 and hm_5i20.
> 
> Once I load hm_5i20 I can see the pins.

That's more like it :-)


Now that the driver's loaded, it can tell us what its pinout is.  (This 
should show up even without setting /proc/rtapi/debug.)  Here's the 
relevant bits from the dmesg2.txt file you sent me:

> [ 2485.811368] hm2/hm2_5i20.0: 72 I/O Pins used:
> [ 2485.811374] hm2/hm2_5i20.0:     I/O Pin P2.000: IOPort
> [ 2485.811381] hm2/hm2_5i20.0:     I/O Pin P2.001: IOPort
> [ 2485.811387] hm2/hm2_5i20.0:     I/O Pin P2.002: IOPort
> [ 2485.811393] hm2/hm2_5i20.0:     I/O Pin P2.003: IOPort
> [ 2485.811399] hm2/hm2_5i20.0:     I/O Pin P2.004: IOPort
> [ 2485.811405] hm2/hm2_5i20.0:     I/O Pin P2.005: IOPort
> [ 2485.811411] hm2/hm2_5i20.0:     I/O Pin P2.006: IOPort
> [ 2485.811420] hm2/hm2_5i20.0:     I/O Pin P2.007: PWMGen #0, pin Out0 (PWM 
> or Up) (Output)
> [ 2485.811427] hm2/hm2_5i20.0:     I/O Pin P2.008: IOPort
> [ 2485.811435] hm2/hm2_5i20.0:     I/O Pin P2.009: PWMGen #0, pin Out1 (Dir 
> or Down) (Output)
> [ 2485.811442] hm2/hm2_5i20.0:     I/O Pin P2.010: IOPort
> [ 2485.811450] hm2/hm2_5i20.0:     I/O Pin P2.011: PWMGen #0, pin Not-Enable 
> (Output)
> [ 2485.811457] hm2/hm2_5i20.0:     I/O Pin P2.012: IOPort
> [ 2485.811464] hm2/hm2_5i20.0:     I/O Pin P2.013: IOPort
> [ 2485.811470] hm2/hm2_5i20.0:     I/O Pin P2.014: IOPort
> [ 2485.811476] hm2/hm2_5i20.0:     I/O Pin P2.015: IOPort
> [ 2485.811482] hm2/hm2_5i20.0:     I/O Pin P2.016: IOPort
> [ 2485.811488] hm2/hm2_5i20.0:     I/O Pin P2.017: IOPort
> [ 2485.811495] hm2/hm2_5i20.0:     I/O Pin P2.018: IOPort
> [ 2485.811501] hm2/hm2_5i20.0:     I/O Pin P2.019: IOPort
> [ 2485.811507] hm2/hm2_5i20.0:     I/O Pin P2.020: IOPort
> [ 2485.811513] hm2/hm2_5i20.0:     I/O Pin P2.021: IOPort
> [ 2485.811519] hm2/hm2_5i20.0:     I/O Pin P2.022: IOPort
> [ 2485.811526] hm2/hm2_5i20.0:     I/O Pin P2.023: IOPort
> [ 2485.811532] hm2/hm2_5i20.0:     I/O Pin P3.024: IOPort
> [ 2485.811538] hm2/hm2_5i20.0:     I/O Pin P3.025: IOPort
> [ 2485.811544] hm2/hm2_5i20.0:     I/O Pin P3.026: IOPort
> [ 2485.811550] hm2/hm2_5i20.0:     I/O Pin P3.027: IOPort
> [ 2485.811557] hm2/hm2_5i20.0:     I/O Pin P3.028: IOPort
> [ 2485.811563] hm2/hm2_5i20.0:     I/O Pin P3.029: IOPort
> [ 2485.811569] hm2/hm2_5i20.0:     I/O Pin P3.030: IOPort
> [ 2485.811575] hm2/hm2_5i20.0:     I/O Pin P3.031: IOPort
> [ 2485.811581] hm2/hm2_5i20.0:     I/O Pin P3.032: IOPort
> [ 2485.811588] hm2/hm2_5i20.0:     I/O Pin P3.033: IOPort
> [ 2485.811594] hm2/hm2_5i20.0:     I/O Pin P3.034: IOPort
> [ 2485.811600] hm2/hm2_5i20.0:     I/O Pin P3.035: IOPort
> [ 2485.811606] hm2/hm2_5i20.0:     I/O Pin P3.036: IOPort
> [ 2485.811612] hm2/hm2_5i20.0:     I/O Pin P3.037: IOPort
> [ 2485.811619] hm2/hm2_5i20.0:     I/O Pin P3.038: IOPort
> [ 2485.811625] hm2/hm2_5i20.0:     I/O Pin P3.039: IOPort
> [ 2485.811631] hm2/hm2_5i20.0:     I/O Pin P3.040: IOPort
> [ 2485.811637] hm2/hm2_5i20.0:     I/O Pin P3.041: IOPort
> [ 2485.811643] hm2/hm2_5i20.0:     I/O Pin P3.042: IOPort
> [ 2485.811654] hm2/hm2_5i20.0:     I/O Pin P3.043: IOPort
> [ 2485.811660] hm2/hm2_5i20.0:     I/O Pin P3.044: IOPort
> [ 2485.811667] hm2/hm2_5i20.0:     I/O Pin P3.045: IOPort
> [ 2485.811673] hm2/hm2_5i20.0:     I/O Pin P3.046: IOPort
> [ 2485.811679] hm2/hm2_5i20.0:     I/O Pin P3.047: IOPort
> [ 2485.811686] hm2/hm2_5i20.0:     I/O Pin P4.048: StepGen #0, pin Step 
> (Output)
> [ 2485.811695] hm2/hm2_5i20.0:     I/O Pin P4.049: StepGen #0, pin Direction 
> (Output)
> [ 2485.811704] hm2/hm2_5i20.0:     I/O Pin P4.050: StepGen #0, pin (unused) 
> (Output)
> [ 2485.811712] hm2/hm2_5i20.0:     I/O Pin P4.051: StepGen #0, pin (unused) 
> (Output)
> [ 2485.811721] hm2/hm2_5i20.0:     I/O Pin P4.052: StepGen #0, pin (unused) 
> (Output)
> [ 2485.811729] hm2/hm2_5i20.0:     I/O Pin P4.053: StepGen #0, pin (unused) 
> (Output)
> [ 2485.811738] hm2/hm2_5i20.0:     I/O Pin P4.054: StepGen #1, pin Step 
> (Output)
> [ 2485.811746] hm2/hm2_5i20.0:     I/O Pin P4.055: StepGen #1, pin Direction 
> (Output)
> [ 2485.811755] hm2/hm2_5i20.0:     I/O Pin P4.056: StepGen #1, pin (unused) 
> (Output)
> [ 2485.811763] hm2/hm2_5i20.0:     I/O Pin P4.057: StepGen #1, pin (unused) 
> (Output)
> [ 2485.811772] hm2/hm2_5i20.0:     I/O Pin P4.058: StepGen #1, pin (unused) 
> (Output)
> [ 2485.811780] hm2/hm2_5i20.0:     I/O Pin P4.059: StepGen #1, pin (unused) 
> (Output)
> [ 2485.811788] hm2/hm2_5i20.0:     I/O Pin P4.060: IOPort
> [ 2485.811794] hm2/hm2_5i20.0:     I/O Pin P4.061: IOPort
> [ 2485.811800] hm2/hm2_5i20.0:     I/O Pin P4.062: IOPort
> [ 2485.811806] hm2/hm2_5i20.0:     I/O Pin P4.063: IOPort
> [ 2485.811812] hm2/hm2_5i20.0:     I/O Pin P4.064: IOPort
> [ 2485.811819] hm2/hm2_5i20.0:     I/O Pin P4.065: IOPort
> [ 2485.811825] hm2/hm2_5i20.0:     I/O Pin P4.066: IOPort
> [ 2485.811831] hm2/hm2_5i20.0:     I/O Pin P4.067: IOPort
> [ 2485.811837] hm2/hm2_5i20.0:     I/O Pin P4.068: IOPort
> [ 2485.811843] hm2/hm2_5i20.0:     I/O Pin P4.069: IOPort
> [ 2485.811850] hm2/hm2_5i20.0:     I/O Pin P4.070: IOPort
> [ 2485.811856] hm2/hm2_5i20.0:     I/O Pin P4.071: IOPort


First of all note that the pinout shows one pwmgen and two stepgens, and 
no encoders; this is as specified by your config string.

The way to read this pinout description is as follows:

Each line is preceeded by the somewhat cryptic string "hm2/hm2_5i20.0": 
the hm2 means hostmot2 of course, and the "5i20.0" means the first 5i20 
board discovered.  There's one line per I/O pin that that board has. 
Each line includes the name of the I/O pin as "Connector.PinNumber" and 
the use that the driver is making of the pin.

So for example, the very last line means "on connector P4, I/O pin 71 is 
used as IOPort".  IOPort is another somewhat cryptic thing that means 
GPIO.  So based on that, you'd expect to find some HAL objects with 
names like "hm2_5i20.0.gpio.P4.071.in", "hm2_5i20.0.gpio.P4.071.out", 
"hm2_5i20.0.gpio.P4.071.is-output", etc.

Another example is the block of pins P4.054 through P4.059, which are 
used for the second stepgen instance.  The "step" output is on P4.054, 
and the "direction" output is on P4.055.  (The other four stepgen 
outputs are used for table-driven steppers, which are very rare; there 
will be a mechanism to reclaim them as gpios in a future version of 
hostmot2 real soon now.)


hostmot2 will tell you each time it successfully initializes a board 
what that board's pinout is.  The pinout will be the same each time you 
load the same version of the driver with the same firmware and the same 
config string.  The firmware determines how many of each module 
(stepgen, pwmgen, and encoder) are available and which I/O pins each of 
those module instances are connected to.  The config string to the 
driver lets you optionally disable some module instances; the pins of 
the disabled module instances become GPIOs.  Does this make sense?


-- 
Sebastian Kuzminsky
Computer Science for life, that's my direction
Instead of b-balls, my homies throw exceptions  -- MC Plus+

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to