Skip to content

Latest commit

 

History

History
93 lines (58 loc) · 2.66 KB

README.md

File metadata and controls

93 lines (58 loc) · 2.66 KB

iCE40lib : FPGA peripheral Library

This repository contains various peripheral drivers written in Verilog for open-source ICE40 FPGAs. iCESuger nano FPGA ships with several PMOD accessories. This repository contains Verilog IPs to work with them.

docker

Content

  1. blinky : LED blink example
  2. lcd : Examples for PMOD 0.96in LCD
  3. st7735 : Driver for PMOD 0.96in LCD

LCD driver is configured for ICESugar nano default clock rate of 12MHz and this driver can save your SPI pins for SPI stuff.

Sublime's custom image
Checkered demo on 0.96 oled

Build Yosys toolchain is required to build the binary files. For this, you can use the following docker container with all the dependencies

Sublime's custom image

Follow the steps to build using the docker environment. (You should have the docker daemon installed on your system)

  1. Clone the repository
git clone https://github.com/Archfx/ice40lib
  1. Pull the docker image from docker-hub
docker pull archfx/ice40tools
  1. Set the expected location to mount with the container
export LOC=/ice40lib
  1. Run the Docker image
docker run -t -p 6080:6080 -v "${PWD}/:/$LOC" -w /$LOC --name ice40tools archfx/ice40tools

This will open up a browser window with

  1. Connect to the docker image
docker exec -it ice40tools /bin/bash
  1. Compile the design and upload

Note change the --pl1k parameter with the chip model that you have. iCESugar Nano uses ice40LP1k-CM36 chip

cd ice40/examples/blinky

yosys -p 'synth_ice40 -top blinky -json blinky.json' blinky.v               # synthesize into blinky.json

nextpnr-ice40 --lp1k --json blinky.json --pcf blinky.pcf --asc blinky.asc --package cm36  # run place and route
icepack blinky.asc blinky.bin                                               # generate binary bitstream file

iceprog blinky.bin                                                       

Relevant Docs