7i95 sserial port as gpio
06 Sep 2024 04:49 #309484
by ekbiker
7i95 sserial port as gpio was created by ekbiker
I'm using the Mesa 7i95t, and I just need a few simple output pins. So, I wanted to disable the smart serial port to gain those pins as GPIO.
In my hal file, I have...
loadrt [HM2](DRIVER) board_ip=[HM2](ADDRESS) config="num_encoders=6 num_stepgens=6 sserial_port_0=xxxxxxxx"
However, at start up I get errors...HAL: ERROR: pin_new(hm2_7i95.0.stepgen.00.counts) called with already-initialized memory
HAL: ERROR: pin_new(hm2_7i95.0.stepgen.00.velocity-fb) called with already-initialized memory
Why does unloading the sserial module cause stepgen errors?
Also, where do I find the .pin file mentioned by members of the forum - where the gpio pin numbering lives.
Note: if I change the last "x" to "0", like this ....
loadrt [HM2](DRIVER) board_ip=[HM2](ADDRESS) config="num_encoders=6 num_stepgens=6 sserial_port_0=xxxxxxx0"
Then the errors go away.
Thanks all.p, li { white-space: pre-wrap; }
In my hal file, I have...
loadrt [HM2](DRIVER) board_ip=[HM2](ADDRESS) config="num_encoders=6 num_stepgens=6 sserial_port_0=xxxxxxxx"
However, at start up I get errors...HAL: ERROR: pin_new(hm2_7i95.0.stepgen.00.counts) called with already-initialized memory
HAL: ERROR: pin_new(hm2_7i95.0.stepgen.00.velocity-fb) called with already-initialized memory
Why does unloading the sserial module cause stepgen errors?
Also, where do I find the .pin file mentioned by members of the forum - where the gpio pin numbering lives.
Note: if I change the last "x" to "0", like this ....
loadrt [HM2](DRIVER) board_ip=[HM2](ADDRESS) config="num_encoders=6 num_stepgens=6 sserial_port_0=xxxxxxx0"
Then the errors go away.
Thanks all.p, li { white-space: pre-wrap; }
Please Log in or Create an account to join the conversation.
06 Sep 2024 07:39 #309489
by cornholio
Replied by cornholio on topic 7i95 sserial port as gpio
OK smart serial if it detects no devices it reverts to gpio.
To work out the pins v gpio
mesaflash --device 7I95T --addr <ip address of card> --readhimd
Warning:
Just beware that you will gain 1 Input & 1 output due to the RS422 chip on board, ie they wont be the same as a normal GPIO pin. I'd wait for Pete from Mesa to chime in regrading voltage levels, current draw and whether this is a good idea.
To work out the pins v gpio
mesaflash --device 7I95T --addr <ip address of card> --readhimd
Warning:
Just beware that you will gain 1 Input & 1 output due to the RS422 chip on board, ie they wont be the same as a normal GPIO pin. I'd wait for Pete from Mesa to chime in regrading voltage levels, current draw and whether this is a good idea.
The following user(s) said Thank You: ekbiker
Please Log in or Create an account to join the conversation.
06 Sep 2024 15:56 - 06 Sep 2024 16:01 #309508
by PCW
Replied by PCW on topic 7i95 sserial port as gpio
Yes, you will only gain 1 differential input and 1 differential output
Why does unloading the sserial module cause stepgen errors?
Probably a driver bug and the 0 enabled sserial channels string
corner condition that causes a memory allocation error was missed.
The xxxxxx0 string will accomplish the same thing without triggering the error
The pins will always revert to GPIO if no sserial device is found, but
the advantage of the xxxxxx0 string is disabling the initial sserial device probe.
If you need TTL level inputs, spare encoder pins can be used
Is P1 being used? that gives you 17 GPIO pins if available.
Why does unloading the sserial module cause stepgen errors?
Probably a driver bug and the 0 enabled sserial channels string
corner condition that causes a memory allocation error was missed.
The xxxxxx0 string will accomplish the same thing without triggering the error
The pins will always revert to GPIO if no sserial device is found, but
the advantage of the xxxxxx0 string is disabling the initial sserial device probe.
If you need TTL level inputs, spare encoder pins can be used
Is P1 being used? that gives you 17 GPIO pins if available.
Last edit: 06 Sep 2024 16:01 by PCW.
The following user(s) said Thank You: ekbiker
Please Log in or Create an account to join the conversation.
06 Sep 2024 16:19 #309509
by ekbiker
Replied by ekbiker on topic 7i95 sserial port as gpio
No, P1 is not used. I don't see a config modparam to disable P1 in the man pages. So, does that mean if by virtue of P1 not connected it is disabled and I can use the GPIO pins. I'd rather use P1 because it seem sserial is more problematic.
Can you tell me how exactly to use P1 pins for GPIO? Thanks.
Can you tell me how exactly to use P1 pins for GPIO? Thanks.
Please Log in or Create an account to join the conversation.
06 Sep 2024 18:23 #309517
by ekbiker
Replied by ekbiker on topic 7i95 sserial port as gpio
I need 5V outputs. I'll drive some low power relays using these GPIO's.
Please Log in or Create an account to join the conversation.
06 Sep 2024 18:26 #309518
by PCW
Replied by PCW on topic 7i95 sserial port as gpio
With standard firmware P1 is all GPIO regardless of driver settings
man hostmot2
For GPIO setup information
(GPIO starts up as inputs so pins used for outputs
must be set into output mode)
Note that the P1 pins are 5V tolerant but have 3.3V output levels
Suggest using a cheap parallel port breakout if you want buffered 5V levels
man hostmot2
For GPIO setup information
(GPIO starts up as inputs so pins used for outputs
must be set into output mode)
Note that the P1 pins are 5V tolerant but have 3.3V output levels
Suggest using a cheap parallel port breakout if you want buffered 5V levels
The following user(s) said Thank You: ekbiker
Please Log in or Create an account to join the conversation.
07 Sep 2024 20:06 #309601
by ekbiker
Replied by ekbiker on topic 7i95 sserial port as gpio
I decided to go with a buffered parallel port BOB to get more GPIO (Mesa 7i75 Breakout/FPGA protection card). But I also need a pwmgen to drive a Mesa SPINx1A for the VFD. I plans to use all 6 step/direction and encoder channels eventually, so I don't want to use one of those for VFD speed control if I don't have to. Leaving the sserial as is for future expansion.
So I need firmware which adds 1 pwngen to the P1.
Would 7i95t_5abobd.bin in the MesaCT do this? I assume it would make 5 pwmgen's available; and for those pins I want to use as I/O, I just declare them in HAL as GPIO. Is this correct?
Or do I need special firmware?
So I need firmware which adds 1 pwngen to the P1.
Would 7i95t_5abobd.bin in the MesaCT do this? I assume it would make 5 pwmgen's available; and for those pins I want to use as I/O, I just declare them in HAL as GPIO. Is this correct?
Or do I need special firmware?
Please Log in or Create an account to join the conversation.
07 Sep 2024 20:38 #309604
by PCW
Replied by PCW on topic 7i95 sserial port as gpio
7i95t_5abobd.bin has 1 PWMgen and I think 4 or or 5 additional stepgen channels
Its designed for the common "Sainsmart Mach 5 Axis breakout"
Its designed for the common "Sainsmart Mach 5 Axis breakout"
Please Log in or Create an account to join the conversation.
07 Sep 2024 21:11 - 07 Sep 2024 21:11 #309609
by ekbiker
Replied by ekbiker on topic 7i95 sserial port as gpio
Do I need special firmware? Can you please make one for me?
Last edit: 07 Sep 2024 21:11 by ekbiker.
Please Log in or Create an account to join the conversation.
07 Sep 2024 21:44 #309614
by PCW
Replied by PCW on topic 7i95 sserial port as gpio
No, 7i95t_5abobd.bin should work.
The following user(s) said Thank You: ekbiker
Please Log in or Create an account to join the conversation.
Time to create page: 0.095 seconds