Skip to main content

Getting Started with TinyCLR

Set up the TinyCLR programming environment, install the firmware on a SITCore device, and deploy your first program — a blinking LED. About 15 minutes start to finish.

What is TinyCLR?

TinyCLR is a .NET runtime for embedded products from GHI Electronics. You write C# in Visual Studio, deploy and debug over USB, and the same code runs across every SITCore hardware form factor — chipsets, modules, single-board computers, and dev boards. No JTAG, no external programmer, no separate toolchain.

Out of the box: modern C# (generics, async/await, top-level statements), step debugging in Visual Studio, full peripheral coverage (GPIO, SPI, I²C, UART, networking, displays, file system), security (TLS, secure boot, IP protection, encrypted firmware updates), and cloud SDKs for Azure, AWS, and Google Cloud. Browse the full features list for the deep dive.

TinyCLR is royalty-free for SITCore customers.

What you'll need

  • A SITCore boardchipset, module, SBC, or Dev Board. For a fun, structured way to learn, the Experimenter Kit bundles a FEZ Bit with sensors, a robot, and a companion eBook.
  • A Windows PC with Visual Studio 2026 (the free Community Edition works)
  • A USB cable

No JTAG probe, no external programmer, no separate toolchain.

Pick your hardware

TinyCLR runs on the SITCore family — chipsets, modules, single-board computers, and development boards. If you haven't picked one yet, see SITCore Hardware for the family overview. The FEZ Flea is the cheapest entry at $14.95 — plug it into USB and you're running.

Set up your development machine

  1. Install Visual Studio 2026. Any edition works, including the free Community Edition. During install, check the .NET desktop development workload.

  2. Install the TinyCLR Project System extension. In Visual Studio, go to ExtensionsManage Extensions. Select Online in the left panel, search for tinyclr, and install TinyCLR OS Project System. Restart Visual Studio to finish installation.

    Installing the TinyCLR extension in Visual Studio

    note

    Pre-release versions of the Project System aren't published to the Visual Studio Marketplace. Download them directly from the Downloads page.

How a SITCore board starts up

A SITCore device runs three firmware components in order:

  1. GHI Electronics Bootloader — initializes the chip and hands off to TinyCLR. Hardcoded into the device — can't be changed and never needs to be updated.
  2. TinyCLR firmware — executes your managed code.
  3. Your managed application — the C# program you write.

The LDR pin controls which component runs. Holding LDR low at startup stops the device at the bootloader — that's how you load or update firmware. With LDR high (the default), the device boots into TinyCLR and runs your application.

Two other pins matter at startup:

  • APP — stops the managed application from running.
  • MOD — selects USB or UART for communication with your PC (USB by default).

After startup, all three pins return to default GPIO state and are available as normal GPIO (or peripheral pins) in your application. See Special Pins for the full reference, including which pins to expose on custom PCB designs.

Install or update firmware

Before TinyCLR can run your code, your SITCore device needs the TinyCLR firmware loaded. The firmware includes the Common Language Runtime — it converts compiled C# IL into machine instructions, manages execution on the device, and lets Visual Studio deploy and debug over USB.

The firmware update procedure is the same for every SITCore product:

  1. Activate the bootloader — hold the LDR signal low while resetting the board. (Each board's pinout shows the LDR pin location.)
  2. Open the TinyCLR Config tool.
  3. Connect to the device — select the correct COM port and click Connect. If the device doesn't appear, it isn't in loader mode — recheck the LDR pin and reset.
  4. Download the firmware from the Downloads page. Select the file in TinyCLR Config and click Update Firmware.

For manual firmware updates without TinyCLR Config, see the GHI Electronics Bootloader page.

Start a new project

Let's blink an LED on a SITCore board.

  1. Open Visual Studio and select Create a new project.

    Create a new project

  2. In the Create a new project window, pick TinyCLR OS from the Platforms dropdown.

    Select the TinyCLR OS platform

  3. Pick the C# TinyCLR Application template, then click Next.

    Select the C# TinyCLR Application template

  4. Keep the default project name and location, then click Create. If you change the name, make sure the namespace in your code matches.

    Configure project

  5. Install the GHIElectronics.TinyCLR.Devices.Gpio and GHIElectronics.TinyCLR.Pins NuGet packages.

  6. Paste this into Program.cs:

    using GHIElectronics.TinyCLR.Devices.Gpio;
    using GHIElectronics.TinyCLR.Pins;
    using System.Threading;

    namespace TinyCLRApplication1 {
    class Program {
    static void Main() {
    // Use SC20100.GpioPin.PE11 on the SC20100S Dev Board.
    // Use SC20260.GpioPin.PB0 on the SCM20260D Dev Board.
    var led = GpioController.GetDefault().OpenPin(SC20100.GpioPin.PB0);
    led.SetDriveMode(GpioPinDriveMode.Output);

    while (true) {
    led.Write(GpioPinValue.High);
    Thread.Sleep(100);

    led.Write(GpioPinValue.Low);
    Thread.Sleep(100);
    }
    }
    }
    }
  7. Plug your board into USB and hit Start (or press F5). The program compiles, deploys to the device, and the on-board LED starts blinking.

    Hit the Start button

Top-level statements

C# 9 top-level statements work too, and most examples in these docs use them — less boilerplate to read.

Same NuGet packages, same logic, no namespace or class wrapper:

using GHIElectronics.TinyCLR.Devices.Gpio;
using GHIElectronics.TinyCLR.Pins;
using System.Threading;

// Use SC20100.GpioPin.PE11 on the SC20100S Dev Board.
// Use SC20260.GpioPin.PB0 on the SCM20260D Dev Board.
var led = GpioController.GetDefault().OpenPin(SC20100.GpioPin.PB0);
led.SetDriveMode(GpioPinDriveMode.Output);

while (true) {
led.Write(GpioPinValue.High);
Thread.Sleep(100);

led.Write(GpioPinValue.Low);
Thread.Sleep(100);
}

What's next

You've shipped your first TinyCLR program. From here:

  • Browse features — debugging, security, networking, displays, file system, multithreading, and a lot more.
  • Find your board's pinout and specs in the SITCore Hardware section.
  • Set up firmware updates and device options with TinyCLR Config.