Kicad-to-HAL: Mesa Electronics 5I25 FPGA Card

The Mesa Electronics 5I25 FPGA card can put into effect an infinite collection of {hardware} I/O controllers, however I’ve handiest arrange the few Kicad symbols required for my easy Sherline mill. The (*11*)LinuxCNC hostmot2 document provides the main points.

The hm2_5i25.0 part (higher proper) carries the pins and purposes concerning the cardboard itself:

(*2*)
Servo Thread Hookup schematic

If in case you have two such playing cards, you’ll even have an hm2_5i25.1 part. Kicad will annotate each with a 0, which Kicad-to-HAL then strips off earlier than attaching the pin names.

The learn and write purposes will have to connect to the primary and final positions of the servo-thread part, respectively, to make the item paintings accurately.

The read_gpio and write_gpio purposes are generally no longer hooked up; the * prefix suppresses a Kicad-to-HAL message about unconnected named pins. The code will strip the asterisk earlier than connecting the pins, however that phase is … flippantly examined.

In a similar fashion, the schematic displays the watchdog output hooked up to one of the on-card LEDs. I’m no longer certain tips on how to take a look at that and wouldn’t see it within the PC case; it may paintings as described.

A hm2_5i25.0.gpio.000 Kicad image (heart) collects the entire HAL pins associated with a unmarried 5I25 GPIO pin; edit the three-digit pin identifier to compare the {hardware} pin. Even supposing the out and in names glance backwards, they point out the {hardware} route: you write to the out pin and learn from the in pin.

The Sherline makes use of four (*8*)stepgen blocks, in order that’s the one different Kicad image on be offering:

X Axis Joint PID Stepgen schematic
X Axis Joint PID Stepgen schematic

The nets connecting the ones three elements come immediately from the LinuxCNC pncconf configuration application. Fancier machines no doubt require extra consideration to the coefficient main points.

Connecting a true parameter to the step.invert_output and route.invert_output pins flips the polarity of the ones alerts. The pins are aliases of the corresponding GPIO invert_output pin, with the important thing benefit of no longer requiring you to determine which GPIO pin corresponds to the FPGA’s output pin for each and every axis.

The 5I25 card calls for a couple of loadrt elements to load the drivers and configure the FPGA:

(*4*)
Kicad-to-HAL Demo Schematic

The one-page demo schematic makes use of the similar 5I25 configuration because the Sherline, with the LEDs pushed through gamepad buttons to supply one thing to take a look at:

(*1*)
Mesa 5I25 card – LED task

I will have to force-fit an LED into the Sherline motive force field simply to have one thing more straightforward to peer.