Button-controlled LED for Sipeed Tang Primer 25K FPGA board

This board from Chinese company Sipeed uses a Gowin FPGA from their top of the range Arora V 22nm family - the GW5A-LV25MG121 - mounted on a tiny plug-in module with an SPI flash memory chip. The module plugs into a dock board fitted with a 40-pin connector and three 12-way sockets. The 40-pin connector is intended for an SRAM board and the 12-way sockets take PMOD modules. They are connected directly to the FPGA so they can be used as general I/O.

Sipeed also sells a kit with a selection of PMOD modules and an SRAM board.

You can buy the board and PMOD kit here: 

https://a.aliexpress.com/_EQqvF4N
A very simple piece of VHDL code that can be used on the Tang Primer 25K enabling an onboard LED to be controlled with one of the buttons. Useful if you want to try out the board without one of the PMOD modules.

Uses button S1 and DONE LED.

VHDL code (I called the file led_btn.vhd)

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity led_btn is
    Port ( btn : in  STD_LOGIC;
           led : out STD_LOGIC);
end led_btn;

architecture Behavioral of led_btn is
begin
    led <= not btn;
end Behavioral;

Physical constraints (I called the file led_btn.cst)

IO_LOC "led" D7;
IO_LOC "btn" H11;
IO_PORT "btn" PULL_MODE=DOWN BANK_VCCIO=3.3;
.
You need to enable the DONE LED:

In Gowin IDE check this
Project -> Configuration -> Place & Route -> Dual-Purpose Pin

Comments

Popular posts from this blog

Sipeed Tang Nano 20K FPGA board

I nearly died at Easter! Warning - somewhat revolting!