Skip to content

A demo project that uses the IcoBoard to render graphics on a PmodOLEDrgb display

License

Notifications You must be signed in to change notification settings

jhol/otl-icoboard-pmodoledrgb-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

otl-icoboard-pmodoldergb-demo

Demo Board Setup

otl-icoboard-pmodrgboled-demo is a simple demo for the IcoBoard FPGA board for the RasberryPI involving the PmodOLEDrgb, which is synthesized using the IceStorm tool-chain; a fully open-source synthesis tool-chain for the Lattice ICE40HX8K FPGA.

This demo was produced as part of a video-demonstration of the IcoBoard and the IceStorm tools featured on the OpenTechLab YouTube channel.

The PmodOLEDrgb is a Pmod (plug-in module) featuring a 96×64-pixel 16-bits-per-pixel colour OLED display, driven by the Solomon Systech SSD1331 display controller, which is controlled by the FPGA through a Mode-3 SPI slave interface, via Pmod port #1 on the IcoBoard.

Display Modes

Display outputs A-E left-to-right

This demo firmware sends full frame-buffer video images at 60-FPS from a selection of video sources, including:

  • Video imagery sourced from block-RAM. At start-up the block-RAM is pre-populated with a static image (A). The contents of the block-RAM can also be replaced by the RasperryPI on a one-shot or repeated basis with stream-tool, so that still or moving images (B) can be displayed on the screen (see below).
  • Pseudo-random video noise generated on-the-fly by a 20-bit Linear-feedback Shift Register (LFSR) (C).
  • A video hack that produces a moving multi-coloured pattern (D).
  • A video hack that fills the screen with a binary counter made of blocks (E).

The different inputs are selected by button presses to a PmodBTN - a Pmod featuring 4× hardware debounce filtered tactile switches, connected to Pmod port #2 on the IcoBoard.

Design Structure

Design Structure

Build Requisites

The following tools must be installed...

Synthesize Bitstream, and Run

To synthesize bitstream...

$ cd fw/
$ make

Output is stored in demo.bin.

To program the bitstream into the IcoBoard...

$ icoprog -p < demo.bin

Run Simulation

$ cd fw/
$ make simulate-XXX

...where the available simulations are:

  • simulate-pmodoledrgb_controller
  • simulate-spi_ram_slave

Results will be displayed in GTKWave.

Stream Imagery

stream-tool is a simple C utility that reads frames from stdin, and sends them through SPI, in frame-buffer-sized messages.

Compile

$ cd stream-tool
$ make

Enable SPI interface

Run sudo raspi-config, and enable the SPI Interface wthin the Interfacing Options menu.

Stream Video

ffmpeg can be used to transcode video files into a 96×64 RGB565 raw video stream...

$ ffmpeg -re -i /path/to/video.mkv -s 96x64 -an -f rawvideo -pix_fmt rgb565 - | \
    ./stream-tool

Alternatively, video can be streamed from a USB WebCam, or other V4L2 source...

$ ffmpeg -f v4l2 -i /dev/video0 -s 96x64 -f rawvideo -pix_fmt rgb565 - | \
    ./stream-tool

...where /dev/video0 is the device-node of the video source.

About

A demo project that uses the IcoBoard to render graphics on a PmodOLEDrgb display

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published