![]() |
VOOZH | about |
dotnet add package nanoFramework.Iot.Device.Mbi5027 --version 1.2.931
NuGet\Install-Package nanoFramework.Iot.Device.Mbi5027 -Version 1.2.931
<PackageReference Include="nanoFramework.Iot.Device.Mbi5027" Version="1.2.931" />
<PackageVersion Include="nanoFramework.Iot.Device.Mbi5027" Version="1.2.931" />Directory.Packages.props
<PackageReference Include="nanoFramework.Iot.Device.Mbi5027" />Project file
paket add nanoFramework.Iot.Device.Mbi5027 --version 1.2.931
#r "nuget: nanoFramework.Iot.Device.Mbi5027, 1.2.931"
#:package nanoFramework.Iot.Device.Mbi5027@1.2.931
#addin nuget:?package=nanoFramework.Iot.Device.Mbi5027&version=1.2.931Install as a Cake Addin
#tool nuget:?package=nanoFramework.Iot.Device.Mbi5027&version=1.2.931Install as a Cake Tool
MBI5027 is a 16-bit shift register. Per the datasheet, the MBI5027 is a "16-bit Constant Current LED Sink Driver with Open/Short Circuit Detection". The is based on and is compatible with the more general binding. The Mbi5027 binding adds error detection functionality. Either binding can be used to control the MBI5027.
The MBI5027 is similar to the commonly used shift register, with some key differences.
Note: The MBI5168 is an 8-bit constant current sink without error detection, making it a more direct comparison to the SN74HC595.
The demonstrates how to use the shift register. The is more extensive and is compatible with the MBI5027.
The following example code demonstrates how to use the MBI5027 with its most basic functions.
Mbi5027 sr = new(Mbi5027PinMapping.Minimal);
// Light up three of first four LEDs
sr.ShiftBit(1);
sr.ShiftBit(1);
sr.ShiftBit(0);
sr.ShiftBit(1);
sr.Latch();
// Display for 1s
Thread.Sleep(1000);
// Clear register
sr.ShiftClear();
// Write to all 16 registers with two byte values
// The `false` parameter avoids latching the storage register after the first call to `ShiftByte`
sr.ShiftByte(0b_1101_1010, false);
sr.ShiftByte(0b_1010_1101);
If you want to use SPI, see the binding, which includes more information on SPI.
The following image demonstrate a .
The following breadboard circuit demonstrates the correct wiring pattern, including error detection.
It is easy to mis-wire the MBI5027. The following image captures the most basic aspects for correct configuration.
The following are key aspects to ensure are correct:
The MBI5027 provides the ability to detect errors, per output. This is very useful for remote deployments, to determine if repairs are required (for a traffic sign, for example). The MBI5027 requires transitioning to an error detection mode to detect errors and then back to normal mode for normal operation.
The following example code demonstrates how to detect output errors with the MBI5027.
var sr = new Mbi5027(Mbi5027PinMapping.Complete);
// switch to error detection mode
sr.EnableDetectionMode();
// read error states, per output
var index = sr.BitLength - 1;
foreach (var value in sr.ReadOutputErrorStatus())
{
Debug.WriteLine($"Bit {index--}: {value}");
}
// switch back to normal mode
sr.EnableNormalMode();
Per the datasheet, data can be shifted into the storage register while reading the output error status and before re-entering normal mode.
When all 16 outputs are in use, and no errors are detected, you will see the following output given this code. A Low state would be shown if the output is unused, is misconfigured or other error condition. You can create this situation by disconnecting one of the input connections on the MBI5027.
Bit 15: High
Bit 14: High
Bit 13: High
Bit 12: High
Bit 11: High
Bit 10: High
Bit 9: High
Bit 8: High
Bit 7: High
Bit 6: High
Bit 5: High
Bit 4: High
Bit 3: High
Bit 2: High
Bit 1: High
Bit 0: High
Note: Error detection was found to work only with 5v power. When 3.3v power was used, error detection did not work correctly.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net net is compatible. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0-preview.85 | 49 | 6/1/2026 |
| 2.0.0-preview.80 | 64 | 5/27/2026 |
| 2.0.0-preview.73 | 55 | 5/20/2026 |
| 2.0.0-preview.69 | 56 | 5/18/2026 |
| 2.0.0-preview.62 | 54 | 5/13/2026 |
| 2.0.0-preview.49 | 57 | 5/4/2026 |
| 2.0.0-preview.45 | 63 | 4/29/2026 |
| 2.0.0-preview.37 | 60 | 4/22/2026 |
| 2.0.0-preview.32 | 53 | 4/20/2026 |
| 2.0.0-preview.16 | 69 | 3/10/2026 |
| 1.2.931 | 348 | 11/10/2025 |
| 1.2.907 | 278 | 10/2/2025 |
| 1.2.869 | 377 | 4/2/2025 |
| 1.2.864 | 360 | 4/2/2025 |
| 1.2.852 | 358 | 3/11/2025 |
| 1.2.835 | 293 | 2/27/2025 |
| 1.2.833 | 315 | 2/27/2025 |
| 1.2.829 | 322 | 2/27/2025 |
| 1.2.822 | 302 | 2/26/2025 |
| 1.2.785 | 334 | 2/4/2025 |