On Sunday 10 August 2014 11:19:56 Schooner did opine And Gene did reply: > Hi > > Dipping my toes in the FPGA pool, there may be more queries after this. > > Is the 5i25 supposed to have its GPIO pins mapped in dmesg when > hostmot2 / hm2_pci are loaded? > (as per http://linuxcnc.org/docs/html/drivers/hostmot2.html#_gpio ) > > The manual page states that the 5i25 is pre-programmed so does not use > firmware files, but is not clear as to whether the > printout is a part of the firmware loading process or common to all > boards > > If I run dmesg after starting Lcnc, all I get are a couple of RTAI > messages and something like 'hm2_pci: - 5i25 found on IRQ11' > but no pinout print for GPIO. > > I have found the pin I was looking for by trial and error triggering > signals on the corresponding 7i76 input > but a print out would have been handy, to see which were already mapped > to inputs etc > > regards > That sounds like a funkity dmesg. Here, I don't use everything my 5i25 is loaded with, restricting it with this loadrt line:
loadrt hostmot2 loadrt hm2_pci config="num_encoders=1 num_pwmgens=1 num_stepgens=2" And that results in this dmesg output: [241249.130840] hm2: loading Mesa HostMot2 driver version 0.15 [241249.138098] hm2_pci: loading Mesa AnyIO HostMot2 driver version 0.7 [241249.138158] hm2_pci 0000:05:00.0: PCI INT A -> GSI 20 (level, low) -> IRQ 20 [241249.138166] hm2_pci: discovered 5i25 at 0000:05:00.0 [241249.141894] hm2/hm2_5i25.0: 34 I/O Pins used: [241249.141902] hm2/hm2_5i25.0: IO Pin 000 (P3-01): IOPort [241249.141910] hm2/hm2_5i25.0: IO Pin 001 (P3-14): PWMGen #0, pin Out0 (PWM or Up) (Output) [241249.141917] hm2/hm2_5i25.0: IO Pin 002 (P3-02): StepGen #0, pin Step (Output) [241249.141923] hm2/hm2_5i25.0: IO Pin 003 (P3-15): IOPort [241249.141931] hm2/hm2_5i25.0: IO Pin 004 (P3-03): StepGen #0, pin Direction (Output) [241249.141939] hm2/hm2_5i25.0: IO Pin 005 (P3-16): PWMGen #0, pin Out1 (Dir or Down) (Output) [241249.141946] hm2/hm2_5i25.0: IO Pin 006 (P3-04): StepGen #1, pin Step (Output) [241249.141952] hm2/hm2_5i25.0: IO Pin 007 (P3-17): IOPort [241249.141959] hm2/hm2_5i25.0: IO Pin 008 (P3-05): StepGen #1, pin Direction (Output) [241249.141965] hm2/hm2_5i25.0: IO Pin 009 (P3-06): IOPort [241249.141970] hm2/hm2_5i25.0: IO Pin 010 (P3-07): IOPort [241249.141976] hm2/hm2_5i25.0: IO Pin 011 (P3-08): IOPort [241249.141983] hm2/hm2_5i25.0: IO Pin 012 (P3-09): IOPort [241249.141988] hm2/hm2_5i25.0: IO Pin 013 (P3-10): IOPort [241249.141995] hm2/hm2_5i25.0: IO Pin 014 (P3-11): Encoder #0, pin A (Input) [241249.142002] hm2/hm2_5i25.0: IO Pin 015 (P3-12): Encoder #0, pin B (Input) [241249.142009] hm2/hm2_5i25.0: IO Pin 016 (P3-13): Encoder #0, pin Index (Input) [241249.142015] hm2/hm2_5i25.0: IO Pin 017 (P2-01): IOPort [241249.142021] hm2/hm2_5i25.0: IO Pin 018 (P2-14): IOPort [241249.142026] hm2/hm2_5i25.0: IO Pin 019 (P2-02): IOPort [241249.142033] hm2/hm2_5i25.0: IO Pin 020 (P2-15): IOPort [241249.142039] hm2/hm2_5i25.0: IO Pin 021 (P2-03): IOPort [241249.142044] hm2/hm2_5i25.0: IO Pin 022 (P2-16): IOPort [241249.142050] hm2/hm2_5i25.0: IO Pin 023 (P2-04): IOPort [241249.142056] hm2/hm2_5i25.0: IO Pin 024 (P2-17): IOPort [241249.142061] hm2/hm2_5i25.0: IO Pin 025 (P2-05): IOPort [241249.142067] hm2/hm2_5i25.0: IO Pin 026 (P2-06): IOPort [241249.142072] hm2/hm2_5i25.0: IO Pin 027 (P2-07): IOPort [241249.142079] hm2/hm2_5i25.0: IO Pin 028 (P2-08): IOPort [241249.142085] hm2/hm2_5i25.0: IO Pin 029 (P2-09): IOPort [241249.142090] hm2/hm2_5i25.0: IO Pin 030 (P2-10): IOPort [241249.142096] hm2/hm2_5i25.0: IO Pin 031 (P2-11): IOPort [241249.142102] hm2/hm2_5i25.0: IO Pin 032 (P2-12): IOPort [241249.142107] hm2/hm2_5i25.0: IO Pin 033 (P2-13): IOPort [241249.142236] hm2/hm2_5i25.0: registered [241249.142241] hm2_5i25.0: initialized AnyIO board at 0000:05:00.0 >From that I can determine what the 3 digit module address is for a given pin, 007 being the same as P3, pin 17. What dmesg doesn't tell you is the input vs output status of that pin. They, gpio pins, all default to inputs, so to use one as an output needs at least one, and maybe two lines per used gpio pin in your .hal file to make one of them a usable output. So, to use p3-17 as a spindle enable signal, needs something like this: # enable run/brake relay # required setp hm2_5i25.0.gpio.007.is_output true # optional to invert logic setp hm2_5i25.0.gpio.007.invert_output true net spindle-switch hm2_5i25.0.gpio.007.out Setting the .invert_ouput false reverses the logic for that pin. That is also the default. Does this help? Cheers, Gene Heskett -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) Genes Web page <http://geneslinuxbox.net:6309/gene> US V Castleman, SCOTUS, Mar 2014 is grounds for Impeaching SCOTUS ------------------------------------------------------------------------------ _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
