Go back

Custom chips grow up: one editor, live sensor sliders, a personal chip library

Custom chips have been one of Velxio’s quiet superpowers: when the part you need isn’t in the catalog, you write a few lines of C, we compile them to WebAssembly, and the result behaves like real silicon — pins, I2C, SPI, UART, timers, even a framebuffer. Today they stop being quiet. This release reworks the whole experience, end to end.

One editor for everything

The old flow split a chip across two surfaces: a modal dialog for the C source and the manifest, and the regular editor for the program a retro-CPU chip runs. That’s gone. Every custom chip now owns a section in the file explorer with chip.c and chip.json as ordinary files — edited in the same Monaco editor as your sketch, with JSON-schema validation on the manifest as you type. Press Run and the chip recompiles whenever its source changed; a per-chip compile button gives you the fast loop when you’re iterating on the C alone.

Sensors you can drive while the simulation runs

Testing a threshold used to mean editing a constant, recompiling, and watching one number go by. Now you drag a slider and watch the firmware react, the way you would wave a lighter under a real sensor.

A custom chip declares live controls in its manifest:

"controls": [
  { "id": "ppm", "label": "CO2 (ppm)", "type": "range",
    "min": 400, "max": 5000, "step": 10, "unit": "ppm" }
]

Each control drives the attribute with the same id. The chip reads it back wherever the value is actually needed:

static void on_tick(void *user_data) {
  double ppm = vx_attr_read(S.ppm);            /* the slider, right now */
  double volts = (ppm - 400.0) / 4600.0 * 5.0; /* 400..5000 ppm -> 0..5 V */
  vx_pin_dac_write(S.out, volts);
}

void chip_setup(void) {
  S.out   = vx_pin_register("OUT", VX_ANALOG);
  S.ppm   = vx_attr_register("ppm", 1000);
  S.timer = vx_timer_create(on_tick, 0);
  vx_timer_start(S.timer, 50000000ULL, true);  /* 50 ms, in nanoseconds */
  on_tick(0);
}

That is the entire sensor. Wire OUT to A0, press Run, click the chip, and analogRead(A0) follows the slider with no recompile and no restart. Chip DAC outputs now reach board ADCs, which is what makes the analog path work end to end.

The one rule: re-read the attribute where you use it. Cache it in chip_setup and the slider will appear, move, and do nothing at all.

Digital sensors work the same way, you just sample somewhere else. An I2C sensor latches its registers when the master opens a read, so a slider moved between two transactions shows up on the very next one, with no torn values halfway through a 16-bit register.

Adding a custom chip now opens a dialog of ready-made templates, two of which are built exactly this way: a CO2 sensor whose analog output tracks a ppm slider, and an I2C environment sensor with temperature and humidity sliders behind a register map at 0x44. Start from either, or from blank.

And if you already wrote chips before any of this existed: any attribute that declares min and max gets a slider automatically, no manifest change needed. Go click one of your old chips mid-run.

All of it is free, on every plan: writing the chip, compiling it, running it, and dragging the sliders. What we charge for is having the AI write the part for you, and the My Chips library that keeps it on the server for reuse across projects.

Full walkthroughs, both sensors from empty file to serial output, plus every field you can put in controls, are in Programmable sensors. Or open them straight in the editor: CO2 sensor and I2C env sensor.

My Chips: build once, reuse everywhere

Pro users get a personal chip library. Save a chip from its file-explorer section and it appears in your component picker — in every project, marked with a CUSTOM badge. Dropping it copies source, manifest and compiled binary into the project, so projects stay self-contained and shareable.

The AI agent got a serious upgrade here too

Ask the in-app agent for “a CO2 sensor with a slider I can move during the simulation” and it builds one — this whole release started with us watching it fail at exactly that. The agent’s chip knowledge was wrong in ways that produced pinless, inert chips; that’s fixed, the server now validates chip pins on every wire, and the agent can save chips to My Chips and reuse them. External agents connected over the MCP bridge get the same powers, including a server-side compile tool.

The SDK — the velxio-chip.h header and a growing collection of open-source chips including our clean-room retro CPU family — lives at github.com/velxio/velxio-chips. The docs have the full story: getting started, programmable sensors, My Chips and the complete API reference.


Share this post on:
David Montero

Written by

David Montero

Creator of Velxio, the open-source circuit and Arduino simulator.

GitHub velxio.dev

Related posts


Previous Post
Building an OutRun-style 3D racing game for the ESP32-S3 without a Z-buffer
Next Post
Bring your own WiFi: custom access points, a packet capture, and your local network