modelHx711Serial

A logic analyser probe decodes the clock/data link of an HX711 (synchronous serial, 24-bit words MSB first)

Extends from Modelica.Icons.Example (Icon for runnable examples).

Information

The circuit of Examples.Weighing.Hx711Read, plus a logic analyser probe on the two-wire link of the HX711: CH0 on PD_SCK (clock, driven by the microcontroller), CH1 on DOUT (data, driven by the converter).

The data channel is of kind SyncData: read on the falling edge of its clock channel (ch1ClockChannel = 0, ch1ClockEdge = Falling), in words of 24 bits, most significant bit first, in two's complement. In Hx711Serial.analyzer.txt, each conversion gives one line (068DB9 = 429497 + 1 extra clock pulse): the 25th, 26th or 27th pulse selects the gain of the next conversion (128, 32, 64). The timing diagram shows each burst of 25 to 27 pulses as a frame, and the 100 ms between two conversions as a single line of silence.

Components

TypeNameDefaultDescription
MCUmcuscriptPath = Resources/Scripts/MCU/hx711_read.py - imports the driver hx711_gpio.py placed next to it (robert-hh, unchanged)
MicroPythonMCU.Peripherals.DisplaydisplayCodes read by the microcontroller
MicroPythonMCU.Peripherals.Weighing.Hx711hxConverter, without noise: the codes read are exactly predictable
MicroPythonMCU.Peripherals.Weighing.WheatstoneBridgebridge
MicroPythonMCU.Peripherals.Weighing.LoadCellloadCell5 kg load cell body
Modelica.Mechanics.Translational.Sources.ForceweightThe weight of the mass placed
Modelica.Blocks.Math.GaingWeight = mass × g
Modelica.Blocks.Sources.ConstantmassMass placed: 1 kg
Modelica.Electrical.Analog.Basic.Groundground
MicroPythonMCU.Peripherals.Analyzers.LogicAnalyzeranalyzerCH0 = PD_SCK (Logic, clock of CH1), CH1 = DOUT (SyncData: read on the falling edge, 24-bit signed words, MSB first)