Getting Started with the Signaloid C0-MicroSD FPGA Platform – Hackster.io

https://www.hackster.io/gatoninja236/getting-started-with-the-signaloid-c0-microsd-fpga-platform-092f23

Things used in this project

Hardware components

C0-microSD×1
×1

Software apps and online services

VS Code

Story

About Signaloid and the C0-microSD

When it comes to capturing data and ensuring our applications/devices are getting the most accurate values, they often fall short because of how we tend to use averages to correct for drift and the inherent inaccuracies in our sensors. As an alternative to this approach, Signaloid's platform of both cloud and hardware-level integrations aims to track these uncertainties at the CPU architecture-level rather than as an external set of application libraries. Their C0-microSD FPGA board is able to perform these functions in the form of a coprocessor to a traditional microcontroller. And beyond uncertainty tracking, the board allows for custom bitstreams to be loaded onto the iCE40 FPGA from a host computer's SD card slot thanks to its bootloader.

Specifications

One of the biggest strengths of the C0-microSD is its ultra-compact micro SD form-factor which can interface directly with host devices, the carrier board, or even GPIO pins connected to a micro SD breakout module. The card itself contains a Lattice iCE40UP5K FPGA featuring 5280 logic cells, 120Kb of dual-port Block RAM, and 1Mb of single-port RAM. Non-volatile data can be stored in the on-board 128Mb (16MB) flash IC courtesy of a Renesas AT25QL128A IC.

Lastly, there are two LEDs for indicating status, six GPIO pins that are accessible from the micro SD card's contacts, and an additional five pins available from the test pads.

The SD-Dev carrier board

In addition to the C0-microSD, Signaloid has produced a carrier board called the SD-Dev which is a compact way to access all of the available I/O over a plethora of connectors. The carrier has a connector underneath for attaching a Raspberry Pi Compute Module 4 for easy, direct communication with the C0-microSD. It features a total of four USB-C ports, with two for downstream connections, one solely for power, and the last one that carries both data and power from a host device. The SD-Dev also includes ports for Micro HDMI, I2C, and SPI, as well as both full-size and micro SD card slots.

Operating modes

Although the C0-microSD comes preloaded with Signaloid's RISC-V processor core bitstream, it can also act as a standalone device with the full capabilities of the iCE40UP5K FPGA. When slotted into a host computer as a micro SD card, the board will present itself as an unformatted drive, thus allowing other applications to upload custom bitstreams to what appears as a mounted disk. When powered externally and without an SD host present, the C0-microSD's built-in bootloader will attempt to load the latest bitstream from storage into the FPGA automatically.

To get started with the C0-microSD as an FPGA (not using the C0 Processor RISC-V core yet), we first need to install a toolchain for compiling and loading bitstreams. Head to the OSS CAD Suite repository from YosysHQ, navigate to the releases page, and follow the installation instructions for your host device's operating system/architecture. In the end, there should be a bin folder accessible from the current user's path.

The code for this project is found in this repository. Clone it before navigating to the inner /verilog/blink directory where you'll find a Makefile, pin constraints, and a verilog file that specifies the circuit being configured. In this case, it specifies the two status LEDs, a clock, and a counter that helps to periodically flip the LEDs' states. Compile the bitstream binary by running make.

Plugging in the C0-microSD opens a new disk dialog, and after dismissing without formatting the drive, its path can be verified by running lsblk on Linux and ensuring the disk appears with a 20.2MB capacity. Lastly, run:

make program DEVICE=<path>

to load the new bitstream into the C0-microSD. Unplug the board, give it external power, and watch as the red and green LEDs enter into an alternating blink pattern.

Breathing LEDs with PWM and button input

Building off the previous example, this demonstration showcases how the C0-microSD's I/O can be directly accessed through its exposed contacts for both LED outputs and button inputs. Simply connect one pushbutton switch between SD_DATA2/GND and another between SD_DATA3/GND. Then compile and upload the bitstream using the same method as the previous section from inside the verilog/breathe-button directory. The red and green LEDs at the top of the C0-microSD should begin to breathe in an alternating pattern while allowing for the breathing rate to be adjusted via the pair of buttons.

The verilog file starts by declaring a clock source and several registers for storing the iCE40's built-in LED controller's configuration. Unlike a typical ARM CPU core which would require setting a timer, interrupts, and a counter for controlling the duty cycle of an output pin, the LED driver allows the setting of delays, breathing ramp times, and brightness levels through its addressable registers, which in turn, can drive external pins.

The LED breathing speed can be continuously adjusted via the two buttons connected to the SD DATA2 and SD DATA3 pins that have been pulled high internally. When started, the system enters into a finite-state machine (FSM) that initializes the LED driver and begins breathing the LEDs. From here, it waits until a debounced button press has been detected, and depending on which one, will either increment or decrement the breathing rate by modifying the driver's Breathe On and Breathe Off control registers.

Going further

Given its compact size, ease-of-use, and open-source nature, the C0-microSD is a great platform for developing and deploying custom bitstreams to its iCE40 FPGA over the SD protocol. The source code for both example projects and additional documentation can be found in this repository from Signaloid.

Read more

Schematics

Code

Credits

{
"by": "rbanffy",
"descendants": 2,
"id": 40247868,
"kids": [
40256708,
40256729
],
"score": 3,
"time": 1714745478,
"title": "Getting Started with the Signaloid C0-MicroSD FPGA Platform – Hackster.io",
"type": "story",
"url": "https://www.hackster.io/gatoninja236/getting-started-with-the-signaloid-c0-microsd-fpga-platform-092f23"
}
{
"author": "Evan Rust",
"date": "2024-05-02T18:14:07.000Z",
"description": "Learn how to configure and load bitstreams onto the C0-microSD’s iCE40 FPGA across two example projects. By Evan Rust.",
"image": "https://hackster.imgix.net/uploads/attachments/1709440/_pEnCY2aezG.blob?auto=compress&w=1600&h=1200&fit=min&fm=jpg",
"logo": "https://logo.clearbit.com/hackster.io",
"publisher": "Hackster.io",
"title": "Getting Started with the Signaloid C0-microSD FPGA Platform",
"url": "https://www.hackster.io/gatoninja236/getting-started-with-the-signaloid-c0-microsd-fpga-platform-092f23"
}
{
"url": "https://www.hackster.io/gatoninja236/getting-started-with-the-signaloid-c0-microsd-fpga-platform-092f23",
"title": "Getting Started with the Signaloid C0-microSD FPGA Platform",
"description": "Things used in this project Hardware components×1×1Software apps and online servicesStory About Signaloid and the C0-microSDWhen it comes to capturing data and ensuring our applications/devices are getting...",
"links": [
"https://www.hackster.io/gatoninja236/getting-started-with-the-signaloid-c0-microsd-fpga-platform-092f23"
],
"image": "https://hackster.imgix.net/uploads/attachments/1709440/_pEnCY2aezG.blob?auto=compress&w=1600&h=1200&fit=min&fm=jpg",
"content": "<div><section><p></p><h2><a target=\"_blank\" href=\"https://www.hackster.io/gatoninja236/getting-started-with-the-signaloid-c0-microsd-fpga-platform-092f23#things\"><i><svg></svg></i></a><span>Things used in this project </span></h2><p></p><div><table><tbody><tr><td><h3>Hardware components</h3></td></tr><tr><td><img srcset=\"https://hackster.imgix.net/uploads/attachments/1709017/banner-image_OKeGy1mf0b.jpeg?auto=compress%2Cformat&amp;w=96&amp;h=96&amp;fit=fill&amp;bg=ffffff 2x, https://hackster.imgix.net/uploads/attachments/1709017/banner-image_OKeGy1mf0b.jpeg?auto=compress%2Cformat&amp;w=48&amp;h=48&amp;fit=fill&amp;bg=ffffff\" alt=\"C0-microSD\" src=\"https://hackster.imgix.net/uploads/attachments/1709017/banner-image_OKeGy1mf0b.jpeg?auto=compress%2Cformat&amp;w=48&amp;h=48&amp;fit=fill&amp;bg=ffffff\" /></td><td></td><td>×</td><td>1</td><td></td></tr><tr><td></td><td></td><td>×</td><td>1</td><td></td></tr><tr><td><h3>Software apps and online services</h3></td></tr><tr><td><img srcset=\"https://hackster.imgix.net/uploads/attachments/673386/512px-visual_studio_code_1_18_icon_svg_k5OBc8o3Yk.png?auto=compress%2Cformat&amp;w=96&amp;h=96&amp;fit=fill&amp;bg=ffffff 2x, https://hackster.imgix.net/uploads/attachments/673386/512px-visual_studio_code_1_18_icon_svg_k5OBc8o3Yk.png?auto=compress%2Cformat&amp;w=48&amp;h=48&amp;fit=fill&amp;bg=ffffff\" alt=\"VS Code\" src=\"https://hackster.imgix.net/uploads/attachments/673386/512px-visual_studio_code_1_18_icon_svg_k5OBc8o3Yk.png?auto=compress%2Cformat&amp;w=48&amp;h=48&amp;fit=fill&amp;bg=ffffff\" /></td><td></td><td></td><td></td></tr></tbody></table></div></section><section><p></p><h2><a target=\"_blank\" href=\"https://www.hackster.io/gatoninja236/getting-started-with-the-signaloid-c0-microsd-fpga-platform-092f23#story\"><i><svg></svg></i></a><span>Story </span></h2><p></p><div><h3 id=\"toc-about-signaloid-and-the-c0-microsd-0\"><span>About Signaloid and the C0-microSD</span></h3><p>When it comes to capturing data and ensuring our applications/devices are getting the most accurate values, they often fall short because of how we tend to use averages to correct for drift and the inherent inaccuracies in our sensors. As an alternative to this approach, Signaloid's platform of both cloud and hardware-level integrations aims to track these uncertainties at the CPU architecture-level rather than as an external set of application libraries. Their C0-microSD FPGA board is able to perform these functions in the form of a coprocessor to a traditional microcontroller. And beyond uncertainty tracking, the board allows for custom bitstreams to be loaded onto the iCE40 FPGA from a host computer's SD card slot thanks to its bootloader.</p>\n<h3 id=\"toc-specifications-1\"><span>Specifications</span></h3><p>One of the biggest strengths of the C0-microSD is its ultra-compact micro SD form-factor which can interface directly with host devices, the carrier board, or even GPIO pins connected to a micro SD breakout module. The card itself contains a Lattice iCE40UP5K FPGA featuring 5280 logic cells, 120Kb of dual-port Block RAM, and 1Mb of single-port RAM. Non-volatile data can be stored in the on-board 128Mb (16MB) flash IC courtesy of a Renesas AT25QL128A IC.</p>\n<p>Lastly, there are two LEDs for indicating status, six GPIO pins that are accessible from the micro SD card's contacts, and an additional five pins available from the test pads.</p><h3 id=\"toc-the-sd-dev-carrier-board-2\"><span>The SD-Dev carrier board</span></h3><p>In addition to the C0-microSD, Signaloid has produced a carrier board called the SD-Dev which is a compact way to access all of the available I/O over a plethora of connectors. The carrier has a connector underneath for attaching a Raspberry Pi Compute Module 4 for easy, direct communication with the C0-microSD. It features a total of four USB-C ports, with two for downstream connections, one solely for power, and the last one that carries both data and power from a host device. The SD-Dev also includes ports for Micro HDMI, I2C, and SPI, as well as both full-size and micro SD card slots.</p>\n<h3 id=\"toc-operating-modes-3\"><span>Operating modes</span></h3><p>Although the C0-microSD comes preloaded with Signaloid's RISC-V processor core bitstream, it can also act as a standalone device with the full capabilities of the iCE40UP5K FPGA. When slotted into a host computer as a micro SD card, the board will present itself as an unformatted drive, thus allowing other applications to upload custom bitstreams to what appears as a mounted disk. When powered externally and without an SD host present, the C0-microSD's built-in bootloader will attempt to load the latest bitstream from storage into the FPGA automatically.</p>\n<h3 id=\"toc-blink-an-led-4\"><span>Blink an LED</span></h3><p><span>To get started with the C0-microSD as an FPGA (not using the C0 Processor RISC-V core yet), we first need to install a toolchain for compiling and loading bitstreams. Head to the </span><a target=\"_blank\" href=\"https://github.com/YosysHQ/oss-cad-suite-build\">OSS CAD Suite repository</a><span> from YosysHQ, navigate to the </span><a target=\"_blank\" href=\"https://github.com/YosysHQ/oss-cad-suite-build/releases\">releases page</a><span>, and follow the installation instructions for your host device's operating system/architecture. In the end, there should be a </span><code>bin</code><span> folder accessible from the current user's path.</span></p>\n<p><span>The code for this project is </span><a target=\"_blank\" href=\"https://github.com/signaloid/C0-microSD-hardware\">found in this repository</a><span>. Clone it before navigating to the inner </span><code>/verilog/blink</code><span> directory where you'll find a Makefile, pin constraints, and a verilog file that specifies the circuit being configured. In this case, it specifies the two status LEDs, a clock, and a counter that helps to periodically flip the LEDs' states. Compile the bitstream binary by running </span><code>make</code><span>.</span></p><p><span>Plugging in the C0-microSD opens a new disk dialog, and after dismissing </span><strong>without formatting the drive</strong><span>, its path can be verified by running </span><code>lsblk</code><span> on Linux and ensuring the disk appears with a 20.2MB capacity. Lastly, run:</span></p><p><code>make program DEVICE=&lt;path&gt;</code></p><p>to load the new bitstream into the C0-microSD. Unplug the board, give it external power, and watch as the red and green LEDs enter into an alternating blink pattern.</p>\n<h3 id=\"toc-breathing-leds-with-pwm-and-button-input-5\"><span>Breathing LEDs with PWM and button input</span></h3><p><span>Building off the previous example, this demonstration showcases how the C0-microSD's I/O can be directly accessed through its exposed contacts for both LED outputs and button inputs. Simply connect one pushbutton switch between </span><code>SD_DATA2/GND</code><span> and another between </span><code>SD_DATA3/GND</code><span>. Then compile and upload the bitstream using the same method as the previous section from inside the </span><code>verilog/breathe-button</code><span> directory. The red and green LEDs at the top of the C0-microSD should begin to breathe in an alternating pattern while allowing for the breathing rate to be adjusted via the pair of buttons.</span></p>\n<p><span>The verilog file starts by declaring a clock source and several registers for storing the </span><a target=\"_blank\" href=\"http://www.latticesemi.com/view_document?document_id=50668\">iCE40's built-in LED controller</a><span>'s configuration. Unlike a typical ARM CPU core which would require setting a timer, interrupts, and a counter for controlling the duty cycle of an output pin, the LED driver allows the setting of delays, breathing ramp times, and brightness levels through its addressable registers, which in turn, can drive external pins.</span></p>\n<p><span>The LED breathing speed can be continuously adjusted via the two buttons connected to the </span><code>SD DATA2</code><span> and </span><code>SD DATA3</code><span> pins that have been pulled high internally. When started, the system enters into a finite-state machine (FSM) that initializes the LED driver and begins breathing the LEDs. From here, it waits until a debounced button press has been detected, and depending on which one, will either increment or decrement the breathing rate by modifying the driver's </span><code>Breathe On</code><span> and </span><code>Breathe Off</code><span> control registers.</span></p>\n<h3 id=\"toc-going-further-6\"><span>Going further</span></h3><p><span>Given its compact size, ease-of-use, and open-source nature, the C0-microSD is a great platform for developing and deploying custom bitstreams to its iCE40 FPGA over the SD protocol. The source code for both example projects and additional documentation </span><a target=\"_blank\" href=\"https://github.com/signaloid/C0-microSD-hardware\">can be found in this repository from Signaloid</a><span>.</span></p></div><a><i><svg></svg></i><span>Read more</span></a></section><section><p></p><h2><a target=\"_blank\" href=\"https://www.hackster.io/gatoninja236/getting-started-with-the-signaloid-c0-microsd-fpga-platform-092f23#schematics\"><i><svg></svg></i></a><span>Schematics </span></h2><p></p><div><p><img src=\"https://hackster.imgix.net/uploads/attachments/1705040/breathe-button-breadboard_zZMv6wIxi2.png\" /></p></div></section><section><p></p><h2><a target=\"_blank\" href=\"https://www.hackster.io/gatoninja236/getting-started-with-the-signaloid-c0-microsd-fpga-platform-092f23#code\"><i><svg></svg></i></a><span>Code </span></h2><p></p></section><section><p></p><h2><a target=\"_blank\" href=\"https://www.hackster.io/gatoninja236/getting-started-with-the-signaloid-c0-microsd-fpga-platform-092f23#team\"><i><svg></svg></i></a><span>Credits</span></h2><p></p></section></div>",
"author": "",
"favicon": "https://prod.hackster-cdn.online/assets/favicons/favicon-8955f42e874b98f97f6ba3076f8b17ac0af864eb76a4b70b81041cbc068f4e17.ico?v=zXX3Bm3lo3",
"source": "hackster.io",
"published": "2024-05-02T18:14:07Z",
"ttr": 187,
"type": "article"
}