Skip to main content

Raspberry Pi Zero

Third-party evaluation option

The Raspberry Pi Zero 2 W is a low-cost way to try Endpoint on a board you may already have. It uses the same IDE extensions, libraries, and APIs as Endpoint Domino24, with a different mix of on-board peripherals.

Raspberry Pi Zero 2 W​

Raspberry Pi Zero 2 W

Features:​

  • 1 GHz quad-core 64-bit ARM, 512 MB RAM
  • Wi-Fi on board
  • 40-pin GPIO header
  • microSD card slot
  • micro-USB port for power and debugging

Only the Raspberry Pi Zero 2 W is supported. The original Raspberry Pi Zero and Zero W use an older processor that .NET does not run on.

Connecting to your PC​

The board has two micro-USB ports. Connect the one labeled USB to your PC. It powers the board and carries the debugging connection, so the other port, labeled PWR IN, is not needed.

Because that port is used for debugging, USB host is not available on this board. Keyboards, mice, USB drives, and webcams cannot be connected.

OS image​

The Raspberry Pi Zero 2 W has its own OS image on the Downloads page. Follow Getting Started and pick the Raspberry Pi Zero 2 W tab in Step 1.

Pinout​

Raspberry Pi Zero 2 W pinout

Two things worth noting about the diagram:

  • "GPIO N" is the BCM GPIO number, not the physical header position. For example, GPIO 23 is the Broadcom SoC's line 23, which happens to sit at physical header pin 16. All pin constants in code use the BCM number.
  • The header has 40 pins, but not all 40 are GPIO. Of the 40, 26 are usable I/O lines; the rest are 3.3 V, 5 V, and ground rails.

Pins in code​

Pin and bus constants for this board live in the GHIElectronics.Endpoint.Drivers.RaspberryPi package (NuGet for .NET, wheel for Python, header-only drop-in for C/C++), under the Zero2W class. Use them where the feature pages reference EPDomino24.

using GHIElectronics.Endpoint.Core;
using GHIElectronics.Endpoint.Drivers.RaspberryPi;

I2cController.Initialize(Zero2W.I2c.I2c1);
SpiController.Initialize(Zero2W.Spi.Spi0);
PwmController.Initialize(Zero2W.Pwm.Pin.Pin12);
SerialPortController.Initialize(Zero2W.SerialPort.Uart1);

The verb classes (I2cController, SpiController, etc.) are the same ones every Endpoint board uses; only the pin and bus prefix differs. Code written against EPDomino24 swaps to Zero2W with a single find-and-replace.

The project template from Getting Started already blinks the on-board LED on Domino24. To make it blink the LED on the Raspberry Pi Zero 2 W, add a using for the RaspberryPi driver and change the pin reference from EPDomino24.Gpio.Led to Zero2W.Gpio.Led. The controller, the API, and the loop are the same on every board.

using System.Device.Gpio;
using GHIElectronics.Endpoint.Core;
using GHIElectronics.Endpoint.Drivers.RaspberryPi;

using var gpio = new GpioController(new Zero2W.Gpio.Driver());
var ledPin = Zero2W.Gpio.Led;

gpio.OpenPin(ledPin, PinMode.Output);

var on = false;
while (true)
{
gpio.Write(ledPin, (on = !on) ? PinValue.Low : PinValue.High);
Thread.Sleep(500);
}
The Pi's on-board LED is active-low

Writing PinValue.Low to Zero2W.Gpio.Led turns the LED on, and PinValue.High turns it off. The LED is wired between 3.3 V and the SoC pin, so the pin has to sink current to light it. This is a wiring detail of the Raspberry Pi board, not a quirk of the API; external LEDs you add to the header can be wired either way.

That is the whole difference between a blink on Domino24 and a blink on the Pi. The same holds for every other peripheral page in this documentation: pick the pin or bus from Zero2W instead of EPDomino24 and the sample runs unchanged.

Features supported by board​

For the full list of what Endpoint supports on the Raspberry Pi Zero 2 W, see Features supported by board on the Hardware page, which compares every supported board side by side.