Friday 6 June 2014

Getting your design to load from the EPCS16 on the DE0-Nano development board

Introduction

I have been playing with my DE0-nano, just switching the eight LEDs between 0xAA and 0x55 once every second. The top level of my design can be seen in the image below.

I am so happy with my design!! That I decided to program it into the EPCS16 serial flash device on the DE0-Nano to loads it automatically every time the development board is powered.

What is the EPCS16

FPGA's are built using SRAM technology, which mean that every time power is removed it will loose its configuration. The EPCS16 is a flash memory device that can hold the configuration for an FPGA (and Nios II software) and automatically load it into the FPGA at power on time. The diagram below is taken from Altera - Serial Configuration (EPCS) Devices Datasheet and show how the EPCS device is connected to the FPGA.


Creating the right file format

In order to program the EPCS device the first thing we need to do is convert the SOF file that is generated as part of the synthesis process into a POF file suitable of being written into the flash device. By clicking on File > Convert Programming Files... you will see the following dialog box:


The first thing we need to do is set the programming file type and select the configuration device followed by the name of the output file.


Select the SOF data and click on add file to select the SOF file that we want to program into the flash device.


Next we need to click on the flashloader and click on add device. Selecting the Cyclone IV E and EPC4CE22 device.


You should now have a screen that looks like the following: 


Select the SOF file and click on properties. Next make sure compression is selected. 


We can now generate the JIC file ready to be programmed into the EPCS!


Programming the EPCS16

Now we have generated a flash file we can programming it into the EPCS device using the Altera programmer. Add the JIC file, click start and wait.


If all goes to plan you will now have your design run just after power up!!


No comments:

Post a Comment