EDGE Spartan 6 FPGA kit Demonstration Manual

Overview

This package of demonstration projects can be used to illustrate all the features of the EDGE FPGA development platform. Each chapter of this document will provide a brief overview for a basic demonstration of some of the EDGE Board components and capabilities. In each chapter, there are details of the hardware required, version of Xilinx tools required, included support files and instructions to perform the demonstrations.

The edge_spartan6_codes zipped folder contains this manual and directories for each chapter. In each chapter directory there are source files, compiled bit files, and documentation files for any additional hardware used. All projects were developed in Xilinx ISE 14.7

Setting up and programming the EDGE Spartan 6 Board

In every chapter, the board will need to be setup and programmed. This section describes how to accomplish this.

Hardware Required:
– EDGE Spartan 6 FPGA Development board
– USB cable

Software Required:
– Xilinx ISE 14.7

Instructions:
1. Connect the USB cable to the USB port (U6) on the EDGE Spartan 6 Board above the power switch
2. Change the power switch position from Ext to USB on the EDGE Board. The Power LED (D18) will be illuminated
3. Open Xilinx iMPACT Tool
Go to Start Menu and type iMPACT to open Xilinx iMPACT Tool

Now double click on Boundary scan option, opens blank window on the right side.

Right click on the blank window and select Initialize Chain

Now XC6SLX9 FPGA detected and ask to assign configuration file to it. Click yes.

Now select Project.bit file

Now it ask for PROM device. Skip it by selecting No.

Now right click on Spartan6 FPGA and click program.

It displays Program Succeeded message and Done LED glow on EDGE Board for the indication of Programming completed. EDGE board is programmed with the selected bit file and is ready for testing.

Chapter 1: Switch LED Demo

This is a simple demo that changes the status of the user LEDs (D0-D15) when user change switch state from low to High.

Additional Hardware Required:
To enable LEDs, Jumper needs to be placed at ground position at J4 and J9.
The J4 connector enables LEDs D2 to D9.
The J9 connector enables LEDs D10 to D17.

Software Platforms:
– Xilinx ISE 14.7

Supplied Files:
– ISE project files

Instructions:
1. Setup and program the board as described in the “Setting up and programming the EDGE Board” Section
The LEDs (D0 – D15) will lit when the SPDT Switches change their state from LOW to High.

Chapter 2: BCD to 7 Segment Demo

This is a simple demo that displays 4 bit Switch BCD state in 7 Segment Display.

Additional Hardware Required:
– none

Software Platforms:
– Xilinx ISE 14.7

Supplied Files:
– ISE project files

Instructions:
1. Setup and program the board as described in the “Setting up and programming the EDGE Board” Section
SPDT Switch SW2, SW3, SW4, SW6 is assigned for inputting 4 bit BCD value.
When the Switch State is changed from 0000 to 1001 state, corresponding decimal value is displayed on the Seven segment displays from 0 to 9.

Chapter 3: Seven Segment Display counter demo

This is a simple demo that displays decimal Counter on 7 Segment Display.

Additional Hardware Required:
– none

Software Platforms:
– Xilinx ISE 14.7

Supplied Files:
– ISE project files

Instructions:
1. Setup and program the board as described in the “Setting up and programming the EDGE Board” Section
Decimal counter counts from 0 to 9999. The counter increments at 1 sec interval and repeat the count sequence.
Reset switch sw2 is used to reset the counter to 0.

Chapter 4: Push Button Demo

This is a simple demo display the Push button state on LEDs.

Additional Hardware Required:
To enable LEDs, Jumper needs to be placed at ground position at J4 and J9.
The J4 connector enables LEDs D2 to D9.
The J9 connector enables LEDs D10 to D17.

Software Platforms:
– Xilinx ISE 14.7

Supplied Files:
– ISE project files

Instructions:
1. Setup and program the board as described in the “Setting up and programming the EDGE Board” Section
Each of 5 Push Button states is directly assigned to LEDs. When the user press Push Button corresponding LED turn ON. LED D2, D3, D4, D5, D6 are used for demonstration.

Chapter 5: Buzzer Demo

This is a simple demo produce sound at piezo Buzzer at regular interval.

Additional Hardware Required:
To enable Buzzer, Jumper needs to be placed at Enable position at J6

Software Platforms:
– Xilinx ISE 14.7

Supplied Files:
– ISE project files

Instructions:
1. Setup and program the board as described in the “Setting up and programming the EDGE Board” Section
PWM pulse of 2 sec is generated and supplied to buzzer.
5v Piezo buzzer produce beep sound at the interval of every 2 sec.

Chapter 6: 2×16 LCD Demo

This is a simple demo for displaying characters in the 2×16 LCD.

Additional Hardware Required:
Connect 2×16 LCD display at J2 Header
LCD Data lines are shared with LEDs D2 – D9. Disable those LED by changing J4 jumper position from E to D.

Software Platforms:
– Xilinx ISE 14.7

Supplied Files:
– ISE project files

Instructions:
1. Setup and program the board as described in the “Setting up and programming the EDGE Board” Section
2×16 LCD displays the following characters 123456789ABCDEF in the second row.

Chapter 7a: Temperature Sensor (ADC) Demo

This demo reads the temperature value through ADC and display on LED

Additional Hardware Required:
To enable LEDs, Jumper needs to be placed at ground position at J4 and J9.
The J4 connector enables LEDs D2 to D9.
The J9 connector enables LEDs D10 to D17.

Software Platforms:
– Xilinx ISE 14.7

Supplied Files:
– ISE project files

Instructions:
1. Setup and program the board as described in the “Setting up and programming the EDGE Board” Section
LM35 Temperature interfaced through channel 7 of SPI ADC.
MCP3208 SPI ADC converts the temperature value in to 12 bit digital value.
12 bit Value is assigned to 12 user LEDs.
By placing finger over the top of sensor, temperature variation can be seen on LEDs.

Chapter 7b: LDR Sensor (ADC) Demo

This demo reads the LDR value through ADC and display on LED

Additional Hardware Required:
To enable LEDs, Jumper needs to be placed at ground position at J4 and J9.
The J4 connector enables LEDs D2 to D9.
The J9 connector enables LEDs D10 to D17.

Software Platforms:
– Xilinx ISE 14.7

Supplied Files:
– ISE project files

Instructions:
1. Setup and program the board as described in the “Setting up and programming the EDGE Board” Section
Light Detect Resistor is interfaced through channel 6 of SPI ADC.
MCP3208 SPI ADC converts the LDR value in to 12 bit digital value.
12 bit value is assigned to 12 user LEDs.
By moving hand closer to the sensor, Light level variation can be easily verified on LEDs.

Chapter 7c: Temperature Sensor / UART Demo

This demo reads the Temperature value through ADC and displays it on UART

Additional Hardware Required:
-none

Software Platforms:
– Xilinx ISE 14.7

Supplied Files:
– ISE project files

Instructions:
1. Setup and program the board as described in the “Setting up and programming the EDGE Board” Section
Temperature Sensor is interfaced through channel 7 of SPI ADC.
MCP3208 SPI ADC converts the Temperature value in to 12 bit digital value.
12 bit Value is converted to decimal Temperature data and sent to UART at 9600 Baud Rate
By placing finger over the top of sensor, Variation can be easily verified on UART.

Chapter 8: UART Demo

This demo transmit the data through UART at 9600 baud Rate

Additional Hardware Required:
-none

Software Platforms:
– Xilinx ISE 14.7

Supplied Files:
– ISE project files

Instructions:
1. Setup and program the board as described in the “Setting up and programming the EDGE Board” Section
UART interface is transmitting at the max baud rate of 3 MBaud.
We are transmitting data Hello World at 9600 Baud rate.

Chapter 9: DAC Demo

This demo output the sine wave generated from DAC IC

Additional Hardware Required:
-none

Software Platforms:
– Xilinx ISE 14.7

Supplied Files:
– ISE project files

Instructions:
1. Setup and program the board as described in the “Setting up and programming the EDGE Board” Section
MCP4921 SPI DAC IC converts 12 bit digital discrete sign values to continuous analog sine wave Output at the connector J7.
Connect DSO at 19th Ground Pin and 20th DAC out Pin of J7 Header to view the output.

Chapter 10: Keyboard Demo

This demo display the Scan Code value of keyboard in the LEDs

Additional Hardware Required:
Connect USB Keyboard at the J8 Connector
To enable LEDs, Jumper needs to be placed at ground position at J4 and J9.
The J4 connector enables LEDs D2 to D9.
The J9 connector enables LEDs D10 to D17.

Software Platforms:
– Xilinx ISE 14.7

Supplied Files:
– ISE project files

Instructions:
1. Setup and program the board as described in the “Setting up and programming the EDGE Board” Section
USB Keyboard Scan code of key pressed is displayed on the LEDs.
Note: USB Keyboard interface is not compatible with all the USB keyboards.

Chapter 11: CMOS Camera / VGA Demo

This demo displays the video frames in the VGA Monitor generated from the OV7670 CMOS Camera.

Additional Hardware Required:
To interface OV7670 CMOS Camera with EDGE Board, Leave pin1 and pin2 of J5 unconnected. Connect pin3 of expansion connector to pin1 of CMOS Camera.
Connect VGA Monitor to the connector P1

Software Platforms:
– Xilinx ISE 14.7

Supplied Files:
– ISE project files

Instructions:
1. Setup and program the board as described in the “Setting up and programming the EDGE Board” Section
Video frames captures through OV7670 Camera module is 160*120.
Data is stored in frame buffer before displaying in the VGA monitor.

Chapter 12a: SPI TFT Display Demo

This demo displays the colour displaying on the SPI TFT Display.

Additional Hardware Required:
Connect SPI TFT to the connector J14
SPI TFT lines are shared with LEDs D2 – D9. Disable those LED by changing J4 jumper position from E to D.

Software Platforms:
– Xilinx ISE 14.7

Supplied Files:
– ISE project files

Instructions:
1. Setup and program the board as described in the “Setting up and programming the EDGE Board” Section
1.8 inch SPI TFT Display the pixel area of 128×160.
Different colour pattern is sent to TFT Display through SPI Protocol.
To display the output keep the Switch Sw2 to On State.

Chapter 12b: SPI TFT Display – colour image Demo

The demo displays 128×160 pixel image on the SPI TFT Display.

Additional Hardware Required:
Connect SPI TFT to the connector J10
SPI TFT lines are shared with LEDs D2 – D9. Disable those LED by changing J4 jumper position from E to D.

Software Platforms:
– Xilinx ISE 14.7

Supplied Files:
– ISE project file

Instructions:
Setup and program the board as described in the “Setting up and programming the EDGE Board” Section
1.8 inch SPI TFT Display the pixel area of 128×160.
The image converted into image.coe file for storing the image in FPGA BRAM
Through SPI Protocol image is transferred from BRAM to SPI TFT display as shown below.

Chapter 13: Bluetooth Demo

In this demo, FPGA LEDs are controlled through Bluetooth interface.

Additional Hardware Required:
To enable LEDs, Jumper needs to be placed at ground position at J4.
The J4 connector enables LEDs D2 to D9.
To enable power to the Bluetooth device, Place jumper at E and centre of J13.
D19 LED ON/OFF at every 1 sec delay to represent Bluetooth is ready to pair.

Software Platforms:
– Xilinx ISE 14.7

Supplied Files:
– ISE project files

Instructions:
1. Setup and program the board as described in the “Setting up and programming the EDGE Board” Section
We are going to control On-board LEDs through Bluetooth via Android Phone App.
Install BLE Scanner App from play store.
Pair with Bluetooth device on FPGA kit. D19 LED glow continuously once paired with Bluetooth.
Under Custom Services, select W option to send some data through Bluetooth.
EDGE Board LEDs D2, D3, D4 and D5 are turned ON by sending 1, 3, 5, 7 respectively through Bluetooth.
Those LEDs are turned OFF by sending 2, 4, 6, 8 through Bluetooth.
Switch Sw2 act as reset input. It should be kept low for working.

Chapter 14: Wi-Fi Demo

In this demo, Temperature and Light intensity level data is sent to cloud through Wi-Fi Interface.

Additional Hardware Required:
To enable power to the WiFi device, Place jumper at E and centre of J11.

Software Platforms:
– Xilinx ISE 14.7

Supplied Files:
– ISE project files

Instructions:
1. Setup and program the board as described in the “Setting up and programming the EDGE Board” Section
Monitoring Temperature data through IoT
Transmitting Temperature and Light intensity level data through WiFi involves communication with cloud server using IP Address. We used an open source data logger website thingspeak.com to reduce the implementation cost. It provides a free user space for creating the data channels. Each channel will be having 8 fields to write the various data and it automatically plots the given data in a graphical representation.
We have to program for ESP8266-12F to send the required AT commands and to establish a connection between the system and thingspeak server.
Once we created our channel for entering the data into web site, the channel will be allocated with one API key. So we have to write the API key before writing the actual data, then the data will be stored and displayed in the required channel.
We have created one thingspeak channel and used 1 field for Temperature Reading and 2 field for light intensity level reading. The actual data obtained from the sensor will be first stored in a script and then the thingspeak server will automatically plots the data retrieving from the field which we have entered an integer data of temperature and Light intensity level output.
To access the data from personal computing devices such Laptop, Tablet and Mobile Phone channel ID is required. Channel ID will be provided by Thingspeak.com when you create new channel. These channel ID can be changed to private or public depending on the application requirement.

Example Channel ID Will be like
https://thingspeak.com/channels/384072

Procedure to check the IoT Demo Code
Step 1: To start using ThingSpeak, you must create a new MathWorks account.
https://thingspeak.com/users/sign_up
Step 2: Login and setting up new channel to collect and display temperature data.
https://www.mathworks.com/help/thingspeak/collect-data-in-a-new-channel.html
New channel created can be available to the public or private based on settings selected.
Step 3: Establishing connection between ESP12F WiFi modem and Thingspeak cloud. We have send the following AT commands.
AT+RST
Reset the WiFi Module to Default State

AT+CWJAP=”WIFINAME”,”Password”
Set the home/office Wifi User Id and Password to connect ESP module to the internet

AT+CIPSTART=”TCP”,”184.106.153.149″,80
Connecting to TCT IP Address of Thingspeak.com

AT+CIPSEND=49
Sending total lengh of the data to transmitted to server.

GET /update?api_key=XXXXXXXXXXXXXXXX&field1=000
Set your API key received when creating new channel. Field 1 represent temperature value and Field 2 represent light intensity value.

AT+CLOSE
Close the communication with server.

Step 4: After updating IoT project file with WiFi user id, password and API key. Regenerate the project and download the bit file to FPGA.
Note: WiFi user id and password length may vary. We need to update the array length based on it.

Step5: Monitoring the data through channel id.
https://thingspeak.com/channels/384072

With API key and channel id. We can also monitor in Android / IOS App.

Chapter 15: Audio connector Demo

This demo generates 2-voice music box that plays J.S. Bach’s Invention at audio connector

Additional Hardware Required:
Connect head phone jack or speaker to the stereo Audio Connector
To enable LEDs, Jumper needs to be placed at ground position at J4 and J9.
The J4 connector enables LEDs D2 to D9.

Software Platforms:
– Xilinx ISE 14.7

Supplied Files:
– ISE project files

Instructions:
1. Setup and program the board as described in the “Setting up and programming the EDGE Board” Section
Stereo Audio tempo is displayed on the LEDs.
Music is held in a BRAM-based ROM, as are the tone frequencies (well-tempered scale), and output waveform. Output is 12-bit PWM at 48 KHz on each of the two audio outputs. This music conveniently has only two voices and one is played on each channel (left or right).
The music is repeating again and again.

×