Using Tang's GPIO

Create a new project

In the Menubar goto Project -> New Project or use the shortcut key Ctrl+Alt+P.

Select Device Family and Device Name for Lichee Tang as shown below.

New Project

Create a new HDL source file.

Right click on Hierarchy and click on New Source to make new HDL source file.


Select the HDL File Type and put source File Name. Check Add To Project to add this file to your project.


Copy the following code into text editor and save it, as shown in following image.

module gpio_main
		input wire RST_N,
		output wire R_LED	

assign R_LED = RST_N;



Now we need to assign physical Pins to our IO ports. Double click on IO Constraint to open IO Constraint Dialog.


Select the IO Bank and Pin Location for Tang’s onboard LED and Button then save it as adc file in the project.


Click on Run Icon to start compilation process.


Plug in you Lichee Tang board to USB and click on Download icon to open Download Dialog.

Open Download box

Make sure your device detacted by TD IDE. Add generated bitstream file by clicking on Add button. Click on Run button to start Download process.


Download the Bitstream into SPI Flash to make your design run after power reset.