Showing results for 
Search instead for 
Did you mean: 
Honored Contributor I

How to configure the SPI on DE0-Nano-SoC




I am currently an undergraduate studying in Electrical Engineering and I am a beginner with no experience with this type of board. This semester, I have to do a project about building a music synthesizer with a professor. I ran into two major problems while using the board (De0-Nano-SoC board). I would like to connect a LCD display to this specific board. However, the touch screen cannot be directly connected to the Arduino header part because the Arduino header is already connected to an audio device. The requirements of the project are the following which are provided by the professor: 

1. Terasic DE0-Nano-SoC Board (

2. Adafruit 2.8’’ TFT LCD shield with Touchscreen (



So I have came up an idea of connecting this specific touch screen to the LTC 2x7 header on the board. My first question is can your company please provide a demonstration code for SPI like those demonstration codes for LED and G-Sensor in the disk.  

I tried to connect these two devices using female-female wires as the sample shown on the site ( Unfortunately, the size does not match. My second question is where can I buy a LTC adapter to connect the touch screen. 


Is there any suggested solution? 



Sorry for the inconvenience. 

Thank you very much.
Tags (2)
0 Kudos
1 Reply
Honored Contributor I

I think we can provide you with all the SW you need. 

You can request our free BSP package for the DE0 nano at 

You'll get all the drivers you'll need for your project. 


First, to use the SPI on the LT connector, a mux must be set-up to select between the I2C1 and SPI signals. 

That's done controlling GPIO# 40 and you can select SPI using the macro DE0_SELECT_LT_SPI(). 

You will see how it used in the demo code. 

To play with the SPI, it's demo# 40; but as it's through the LT connector, the supported devices in the Demo are non-standard as they are the ones we have in hand. 


You can use the other demos to make sure all is OK: demo# 8,# 9 and 10 use devices that are physically on the DE0 nano board: LED, Switch, G-sensor, SD/MMC, Ethernet etc. 


For the HW, the LT connector is a standard 2mm pitch connector (7 X 2 pins). 

e.g Digikey part# WM18678-ND 

A bit of wire and soldering will do the job.