GitXplorerGitXplorer
j

otl-icoboard-pmodoledrgb-demo

public
8 stars
4 forks
0 issues

Commits

List of commits on branch master.
Unverified
fff425fa4109d6b8e06c63de7f3ea94d453f7e41

Added video_hack_1

jjhol committed 7 years ago
Unverified
e074e285673b97378a0ac3e243e3cca8f4660de3

Added coordinate_decoder

jjhol committed 7 years ago
Unverified
9785dd1243d92e50362022057b0290090190d3d3

prbs_source: Fixed pixel_data port

jjhol committed 7 years ago
Unverified
4ee624f6373327534b07f2ae8244857dd08b0056

Added input switching

jjhol committed 7 years ago
Unverified
0711753eb4684c0326008d129f6cc3a9055ea085

Split out clock_generator

jjhol committed 7 years ago
Unverified
f32a5d1c2c1e2712c423a68db454412316dc7015

top: Declare inputs/outputs outside module port list

jjhol committed 7 years ago

README

The README file for this repository.

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.