SSERIAL(9)
π NAME π
hostmot2 β Smart Serial LinuxCNC HAL driver for the Mesa Electronics HostMot2 Smart-Serial remote cards
ok so hi bestie, welcome to SSERIAL(9), aka the HAL Component page for the Mesa Smart-Serial stuff πΈ this one is long so grab a snack, we're doing this in parts.
β¨ SYNOPSIS β¨
So like. The Mesa Smart-Serial interface is a 2.5Mbs proprietary interface between the Mesa Anything-IO cards and a whole little family of subsidiary devices we call "smart-serial remotes" π¦
Those remote cards do a bunch of different jobs, but typically they combine various classes of IO. And here's the slay part: the remote cards are self-configuring β they literally tell the main LinuxCNC Hostmot2 driver what their pin functions are and what they should be named. main character energy fr fr π
Many sserial remotes offer different pinouts depending on the mode they are started up in. That's set with the sserial_port_N= option in the hm2_pci modparam. See the hostmot2 manpage for further details π
It is likely that this documentation will be permanently out of date. π
Each Anything-IO board can attach up to 8 sserial remotes to each header β either the 50-pin headers on the 5I20/5I22/5I23/7I43 or the 25-pin connectors on the 5I25, 6I25 and 7I80. The remotes are grouped into "ports" of up to 8 "channels". Typically each header will be a single 8 channel port, but this is not necessarily always the case. no cap π«Ά
π PORTS π
In addition to the per-channel/device pins detailed below there are three per-port pins and three parameters.
Pins
(bit, in) .sserial.port-N.runβ Enables the specific Smart Serial module. Setting this pin low will disable all boards on the port and puts the port in a pass-through mode where device parameter setting is possible. It is necessary to toggle the state of this pin if there is a requirement to alter a remote parameter on a live system. This pin defaults toTRUEand can be left unconnected. However, toggling the pin low-to-high will re-enable a faulted drive, so the pin could usefully be connected to theiocontrol.0.user-enable-outpin. β¨(u32, ro) .run_stateβ Shows the state of the sserial communications state-machine. This pin will generally show a value of0x03in normal operation,0x07in setup mode and0x00when the "run" pin is false. π§(u32, ro) .error-countβ Indicates the state of the Smart Serial error handler, see the parameters section for more details.
Parameters
(u32 r/w) .fault-incβ Any over-run or handshaking error in the SmartSerial communications will increment the.fault-countpin by the amount specified by this parameter. Default = 10.(u32 r/w) .fault-decβ Every successful read/write cycle decrements the fault counter by this amount. Default = 1.(u32 r/w) .fault-limβ When the fault counter reaches this threshold the Smart Serial interface on the corresponding port will be stopped and an error printed indmesg. Together these three pins allow for control over the degree of fault-tolerance allowed in the interface. The default values mean that if more than one transaction in ten fails, more than 20 times, then a hard error will be raised. If the increment were to be set to zero then no error would ever be raised, and the system would carry on regardless. Conversely setting decrement to zero, threshold to 1 and limit to 1 means that absolutely no errors will be tolerated. (This structure is copied directly from vehicle ECU practice.) π
Any other parameters than the ones above are created by the card istelf from data in the remote firmware. They may be set in the HAL file using "setp" in the usual way.
NOTE: Because a Smart-Serial remote can only communicate non-process data to the host card in setup mode, it is necessary to stop and re-start the smart-serial port associated with the card to alter the value of a parameter. π
ALSO NOTE: in the case of parameters beginning with "nv" (which are stored in non-volatile memory) the effect will not be seen until after the next power cycle of the drive. π
Unchanged values will not be re-written, so it is safe to leave the "setp" commands in the HAL file or delete them as you see fit. lowkey convenient π
π DEVICES π
The other pins and parameters created in HAL depend on the devices detected. The following list of Smart Serial devices is by no means exhaustive. (iykyk)
8I20
The 8I20 is a 2.2 kW three-phase drive for brushless DC motors and AC servo motors. π₯ 8I20 pins and parameters have names like "hm2_<BoardType>.<BoardNum>.8i20.<PortNum>.<ChanNum>.<Pin>", for example "hm2_5i23.0.8i20.1.3.current" would set the phase current for the drive connected to the fourth channel of the second sserial port of the first 5I23 board. Note that the sserial ports do not necessarily correlate in layout or number to the physical ports on the card. π
Pins
(float in) angleβ The rotor angle of the motor in fractions of a full phase revolution. An angle of0.5indicates that the motor is half a turn / 180 degrees / Ο radians from the zero position. The zero position is taken to be the position that the motor adopts under no load with a poitive voltage applied to the A (or U) phase and both B and C (or V and W) connected to-Vor0 V. A 6 pole motor will have 3 zero positions per physical rotation. Note that the8I20drive automatically adds the phase lead/lag angle, and that this pin should see the raw rotor angle. There is a HAL module (bldc) which handles the complexity of differing motor and drive types. π(float, in) currentβ The phase current command to the drive. This is scaled from-1to+1for forwards and reverse maximum currents. The absolute value of the current is set by themax_currentparameter.(float, ro) bus-voltageβ The drive bus voltage in V. This will tend to show25.6 Vwhen the drive is unpowered and the drive will not operate below about50 V. β‘(float, ro) tempβ The temperature of the driver in degrees C. π‘οΈ(u32, ro) commsβ The communication status of the drive. See the manual for more details.(bit, ro) statusandfaultβ The following fault/status bits are exported. For further details see the8I20manual.
fault.U-current / fault.U-current-not
fault.V-current / fault.V-current-not
fault.W-current / fault.W-current-not
fault.bus-high / fault.bus-high-not
fault.bus-overv / fault.bus-overv-not
fault.bus-underv / fault.bus-underv-not
fault.framingr / fault.framingr-not
fault.module / fault.module-not
fault.no-enable / fault.no-enable-not
fault.overcurrent / fault.overcurrent-not
fault.overrun / fault.overrun-not
fault.overtemp / fault.overtemp-not
fault.watchdog / fault.watchdog-not
status.brake-old / status.brake-old-not
status.brake-on / status.brake-on-not
status.bus-underv / status.bus-underv-not
status.current-lim / status.current-lim-no
status.ext-reset / status.ext-reset-not
status.no-enable / status.no-enable-not
status.pid-on / status.pid-on-not
status.sw-reset / status.sw-reset-not
status.wd-reset / status.wd-reset-not
Parameters
The following parameters are exported. See the PDF documentation downloadable from Mesa for further details. π
hm2_5i25.0.8i20.0.1.angle-maxlim
hm2_5i25.0.8i20.0.1.angle-minlim
hm2_5i25.0.8i20.0.1.angle-scalemax
hm2_5i25.0.8i20.0.1.current-maxlim
hm2_5i25.0.8i20.0.1.current-minlim
hm2_5i25.0.8i20.0.1.current-scalemax
hm2_5i25.0.8i20.0.1.nvbrakeoffv
hm2_5i25.0.8i20.0.1.nvbrakeonv
hm2_5i25.0.8i20.0.1.nvbusoverv
hm2_5i25.0.8i20.0.1.nvbusundervmax
hm2_5i25.0.8i20.0.1.nvbusundervmin
hm2_5i25.0.8i20.0.1.nvkdihi
hm2_5i25.0.8i20.0.1.nvkdil
hm2_5i25.0.8i20.0.1.nvkdilo
hm2_5i25.0.8i20.0.1.nvkdp
hm2_5i25.0.8i20.0.1.nvkqihi
hm2_5i25.0.8i20.0.1.nvkqil
hm2_5i25.0.8i20.0.1.nvkqilo
hm2_5i25.0.8i20.0.1.nvkqp
hm2_5i25.0.8i20.0.1.nvmaxcurrent
hm2_5i25.0.8i20.0.1.nvrembaudrate
hm2_5i25.0.8i20.0.1.swrevision
hm2_5i25.0.8i20.0.1.unitnumber
(float, rw) max_currentβ Sets the maximum drive current in Amps. The default value is the maximum current programmed into the drive EEPROM. The value must be positive, and an error will be raised if a current in excess of the drive maximum is requested. π¨(u32, ro) serial_numberβ The serial number of the connected drive. This is also shown on the label on the drive. π·οΈ
7I64
The 7I64 is a 24-input 24-output IO card. 7I64 pins and parameters have names like "hm2_<BoardType>.<BoardNum>.7i64.<PortNum>.<ChanNum>.<Pin>", for example hm2_5i23.0.7i64.1.3.output-01 . π―
Pins
(bit, in) 7i64.0.0.output-NNβ Writing a1orTRUEto this pin will enable output driverNN. Note that the outputs are drivers (switches) rather than voltage outputs. The LED adjacent to the connector on the board shows the status. The output can be inverted by setting a parameter. π‘(bit, out) 7i64.0.0.input-NNβ The value of inputNN. Note that the inputs are isolated and both pins of each input must be connected, typically to signal and the ground of the signal. (This need not be the ground of the board.) π«Ά(bit, out) 7i64.0.0.input-NN-notβ An inverted copy of the corresponding input.(float, out) 7i64.0.0.analog0&7i64.0.0.analog1β The two analogue inputs (0to3.3 V) on the board.
Parameters
(bit, rw) 7i64.0.0.output-NN-invertβ Setting this parameter to1/TRUEwill invert the output value, such that writing0to.gpio.NN.outwill enable the output and vice-versa. π
7I76
The 7I76 is not really a smart-serial device. It serves as a breakout for a number of other Hostmot2 functions. There are connections for 5 step generators (for which see the main hostmot2 manpage). The stepgen pins are associated with the 5I25 (hm2_5i25.0.stepgen.00....) whereas the smart-serial pins are associated with the 7I76 (hm2_5i25.0.7i76.0.0.output-00). π¦
Pins
(float out) .7i76.0.0.analogN(modes 1 and 2 only) β Analogue input values.(float out) .7i76.0.0.fieldvoltage(mode 2 only) β Field voltage monitoring pin.(bit in) .7i76.0.0.spindirβ This pin provides a means to drive the spindle VFD direction terminals on the7I76board. π(bit in) .7i76.0.0.spinenaβ This pin drives the spindle-enable terminals on the7I76board. β(float in) .7i76.0.0.spinoutβ This controls the analogue output of the7I76. This is intended as a speed control signal for a VFD. ποΈ(bit out) .7i76.0.0.output-NNβ (NN = 0to15). 16 digital outputs. The sense of the signal can be set via a parameter.(bit out) .7i76.0.0.input-NNβ (NN = 0to31) 32 digital inputs.(bit in).7i76.0.0.input-NN-notβ (NN = 0 to 31) an inverted copy of the inputs, handed to you purely out of convenience π. The two complementary pins may be connected to different signal nets, so you don't have to wire them to the same thing, no cap.
β¨ Parameters β¨
(u32 ro).7i76.0.0.nvbaudrateβ tells you the vbaud rate. This probably should not be altered π.(u32 ro).7i76.0.0.nvunitnumberβ the serial number of the device, and it should match a sticker on the card π·οΈ. This can be useful for working out which card is which, and honestly that's such a lifesaver when you've got a whole pile of them.(u32 ro).7i76.0.0.nvwatchdogtimeoutβ the sserial remote watchdog timeout. This is separate from the Anything-IO card timeout. It's unlikely to need to be changed, bestie.(bit rw).7i76.0.0.output-NN-invertβ invert the sense of the corresponding output pin π.(bit rw).7i76.0.0.spindir-invertβ invert the sense of the spindle direction pin.(bit rw).7i76.0.0.spinena-invertβ invert the sense of the spindle-enable pin.(float rw).7i76.0.0.spinout-maxlimβ the maximum speed request allowable.(float rw).7i76.0.0.spinout-minlimβ the minimum speed request.(float rw).7i76.0.0.spinout-scalemaxβ the spindle speed scaling πΈ. This is the speed request which would correspond to full-scale output from the spindle control pin. So for example, with a10 Vdrive voltage and a10000 RPMscalemax, a value of10,000 RPMon thespinoutpin would produce10 Voutput. However, ifspinout-maxlimwere set to5,000 RPMthen no voltage above 5 V would be output. π(u32 ro).7i76.0.0.swrevisionβ the onboard firmware revision number. Utilities (seeman setsserialfor details) exist to update and change this firmware π§.
π¦ 7I77 π¦
The 7I77 is an 6-axis servo control card. The analogue outputs are smart-serial devices, but the encoders are conventional hostmot2 encoders, and further details of them may be found in the hostmot2 manpage π.
Pins π
(bit out).7i77.0.0.input-NNβ (NN = 0 to 31) 32 digital inputs.(bit in).7i77.0.0.input-NN-notβ (NN = 0 to 31) an inverted copy of the inputs, provided for convenience π. The two complementary pins may be connected to different signal nets.(bit out).7i77.0.0.output-NNβ (NN = 0 to 15). 16 digital outputs. The sense of the signal can be set via a parameter.(bit in).7i77.0.0.spindirβ this pin provides a means to drive the spindle VFD direction terminals on the7I76board.(bit in).7i77.0.0.spinenaβ this pin drives the spindle-enable terminals on the7I76board.(float in).7i77.0.0.spinoutβ this controls the analog output of the7I77. It's intended as a speed control signal for a VFD π.(bit in).7i77.0.1.analogenaβ this pin drives the analog enable terminals on the7I77board.(float in).7i77.0.1.analogoutNβ (N = 0 to 5) this controls the analog output of the7I77.
Parameters β¨
(bit rw).7i77.0.0.output-NN-invertβ invert the sense of the corresponding output pin π.(bit rw).7i77.0.0.spindir-invertβ invert the sense of the spindle direction pin.(bit rw).7i77.0.0.spinena-invertβ invert the sense of the spindle-enable pin.(float rw).7i77.0.0.spinout-maxlimβ the maximum speed request allowable.(float rw).7i77.0.0.spinout-minlimβ the minimum speed request.(float rw).7i77.0.0.spinout-scalemaxβ the spindle speed scaling πΈ. This is the speed request which would correspond to full-scale output from the spindle control pin. For example, with a10 Vdrive voltage and a10000 RPMscalemax, a value of10,000 RPMon thespinoutpin would produce10 Voutput. However, ifspinout-maxlimwere set to5,000 RPMthen no voltage above 5 V would be output. π(float rw).7i77.0.0.analogoutN-maxlimβ (N = 0 to 5) the maximum speed request allowable.(float rw).7i77.0.0.analogoutN-minlimβ (N = 0 to 5) the minimum speed request.(float rw).7i77.0.0.analogoutN-scalemaxβ (N = 0 to 5) the analog speed scaling πΈ. This is the speed request which would correspond to full-scale output from the spindle control pin. For example, with a10 Vdrive voltage and a10000 RPMscalemax, a value of10,000 RPMon thespinoutpin would produce10 Voutput. However, ifspinout-maxlimwere set to5,000 RPMthen no voltage above5 Vwould be output.
π§ 7I69 π§
The 7I69 is a 48 channel digital IO card. It can be configured in four different modes:
- MODE 0: Bidirectional mode (48 bits in 48 bits out)
- MODE 1: Input only mode (48 bits in)
- MODE 2: Output only mode (48 bits out)
- MODE 3: 24/24 mode (24 bits in = bits 0..23 and 24 bits out = bits 24..47)
- MODE 4: Bidirectional mode (48 bits in 48 bits out) plus 4 MPG encoder channels on inputs 0 through 7
Pins π
(bit in).7i69.0.0.output-NNβ digital output. The sense can be inverted with the corresponding Parameter.(bit out).7i69.0.0.input-NNβ digital input.(bit out).7i69.0.0.input-NN-notβ digital input, inverted.
Parameters β¨
(u32 ro).7i69.0.0.nvbaudrateβ indicates the vbaud rate. This probably should not be altered π.(u32 ro).7i69.0.0.nvunitnumberβ indicates the serial number of the device and should match a sticker on the card π·οΈ. This can be useful for working out which card is which.(u32 ro).7i69.0.0.nvwatchdogtimeoutβ the sserial remote watchdog timeout. This is separate from the Anything-IO card timeout. This is unlikely to need to be changed.(bit rw).7i69.0.0.output-NN-invertβ invert the sense of the corresponding output pin π.(u32 ro).7i69.0.0.swrevisionβ the onboard firmware revision number. Utilities exist to update and change this firmware π§.
π 7I70 π
The 7I70 is a remote isolated 48 input card. The 7I70 inputs sense positive inputs relative to a common field ground β‘. Input impedance is 10 kΞ© and input voltage can range from 5 VDC to 32 VDC. All inputs have LED status indicators β¨. The input common field ground is galvanically isolated from the communications link.
The 7I70 has three software selectable modes. These different modes select different sets of 7I70 data to be transferred between the host and the 7I70 during real time process data exchanges. For high speed applications, choosing the correct mode can reduce the data transfer sizes, resulting in higher maximum update rates π.
- MODE 0: Input mode (48 bits input data only)
- MODE 1: Input plus analog mode (48 bits input data plus 6 channels of analog data)
- MODE 2: Input plus field voltage
Pins π
(float out).7i70.0.0.analogNβ (modes 1 and 2 only) analogue input values.(float out).7i70.0.0.fieldvoltageβ (mode 2 only) field voltage monitoring pin.(bit out).7i70.0.0.input-NNβ (NN = 0 to 47) 48 digital inputs.(bit in).7i70.0.0.input-NN-notβ (NN = 0 to 47) an inverted copy of the inputs provided for convenience π. The two complementary pins may be connected to different signal nets.
Parameters β¨
(u32 ro).7i70.0.0.nvbaudrateβ indicates the vbaud rate. This probably should not be altered π.(u32 ro).7i70.0.0.nvunitnumberβ indicates the serial number of the device and should match a sticker on the card π·οΈ. This can be useful for working out which card is which.(u32 ro).7i70.0.0.nvwatchdogtimeoutβ the sserial remote watchdog timeout. This is separate from the Anything-IO card timeout. This is unlikely to need to be changed.(u32 ro).7i69.0.0.swrevisionβ the onboard firmware revision number. Utilities exist to update and change this firmware π§.
π 7I71 π
The 7I71 is a remote isolated 48 output card. The 48 outputs are 8VDC to 28VDC sourcing drivers (common + field power) with 300 mA maximum current capability β‘. All outputs have LED status indicators β¨.
The 7I71 has two software selectable modes. For high speed applications, choosing the correct mode can reduce the data transfer sizes, resulting in higher maximum update rates π.
- MODE 0: Output only mode (48 bits output data only)
- MODE 1: Outputs plus read back field voltage
Pins π
(float out).7i71.0.0.fieldvoltageβ (mode 2 only) field voltage monitoring pin.(bit out).7i71.0.0.output-NNβ (NN = 0 to 47) 48 digital outputs. The sense may be inverted by the invert parameter.
Parameters β¨
(bit rw).7i71.0.0.output-NN-invertβ invert the sense of the corresponding output pin π.(u32 ro).7i71.0.0.nvbaudrateβ indicates the vbaud rate. This probably should not be altered π.(u32 ro).7i71.0.0.nvunitnumberβ indicates the serial number of the device and should match a sticker on the card π·οΈ. This can be useful for determining which card is which.(u32 ro).7i71.0.0.nvwatchdogtimeoutβ the sserial remote watchdog timeout. This is separate from the Anything-IO card timeout. This is unlikely to need to be changed.(u32 ro).7i69.0.0.swrevisionβ the onboard firmware revision number. Utilities exist to update and change this firmware π§.
π 7I73 π
The 7I73 is a remote real time pendant or control panel interface ποΈ.
The 7I73 supports up to four 50 kHz encoder inputs for MPGs, 8 digital inputs and 6 digital outputs and up to a 64 Key keypad. If a smaller keypad is used, more digital inputs and outputs become available β¨. Up to eight 0.0 V to 3.3 V analog inputs are also provided. The 7I73 can drive a 4 line 20 character LCD for local DRO applications π.
The 7I73 has 3 software selectable process data modes. These different modes select different sets of 7I73 data to be transferred between the host and the 7I73 during real time process data exchanges. For high speed applications, choosing the correct mode can reduce the data transfer sizes, resulting in higher maximum update rates π.
- MODE 0: I/O + ENCODER
- MODE 1: I/O + ENCODER + ANALOG IN
- MODE 2: I/O + ENCODER + ANALOG IN FAST DISPLAY
Pins π
(float out).7i73.0.0.analoginNβ analogue inputs. Up to 8 channels may be available dependent on software and hardware configuration modes (see the PDF manual downloadable fromwww.mesanet.com).(u32 in).7i73.0.1.displayβ (modes 1 and 2). Data for LCD display. This pin may be conveniently driven by the HALlcdcomponent, which allows the formatted display of the values any number of HAL pins and textual content π.(u32 in).7i73.0.1.display32β (mode 2 only). 4 bytes of data for LCD display. This mode is not supported by the HALlcdcomponent.(s32 out).7i73.0.1.encNβ the position of the MPG encoder counters π.(bit out).7i73.0.1.input-NNβ up to 24 digital inputs (dependent on config).(bit out).7i73.0.1.input-NN-notβ inverted copy of the digital inputs.(bit in).7i73.0.1.output-NNβ up to 22 digital outputs (dependent on config).
Parameters β¨
β¦okay bestie, the parameter list is literally right on the next page and we are NOT done here, stay with me π
Like, okay, so the 7i73 board is absolutely serving a whole lil' wardrobe of read-only u32 values, and we are NOT skipping a single one, because every single one of these deserves its moment. Read-only, u32, no takebacks:
.7i73.0.1.nvanalogfilterβ(u32 ro).7i73.0.1.nvbaudrateβ(u32 ro).7i73.0.1.nvcontrastβ(u32 ro).7i73.0.1.nvdispmodeβ(u32 ro).7i73.0.1.nvencmode0β(u32 ro).7i73.0.1.nvencmode1β(u32 ro).7i73.0.1.nvencmode2β(u32 ro).7i73.0.1.nvencmode3β(u32 ro).7i73.0.1.nvkeytimerβ(u32 ro).7i73.0.1.nvunitnumberβ(u32 ro).7i73.0.1.nvwatchdogtimeoutβ(u32 ro).7i73.0.1.output-00-invertβ(u32 ro)
For further details of the use of the above see the Mesa manual. π«Ά Like, genuinely, the Mesa manual is the group chat you wanna scroll for the β¨loreβ¨ on all of those.
.7i73.0.1.output-01-invertβ(bit rw)β Invert the corresponding output bit. Yep, that's it, that's the whole vibe: flip it and the matching output bit gets inverted. π.7i73.0.1.swrevisionβ(s32 ro)β The version of firmware installed. So when you wanna know which firmware glow-up your board is currently rocking, this is the pin that tells you. π
And that's a wrap on the page, bestie! πΈ This little love letter came from the LinuxCNC Documentation, dated 2008-05-13, and it lives under the name SSERIAL(9). Periodt. πβ¨
π¦ where this page comes from
- debian trixie: linuxcnc-uspace 1:2.9.4-2+deb13u1 Β· GFDL-1.1-or-later
- ubuntu questing: linuxcnc-uspace 1:2.9.4-2ubuntu2
- ubuntu resolute: linuxcnc-uspace 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- ubuntu stonking: linuxcnc-uspace 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms