Do you have a question about the 492 and is the answer not in the manual?
Questions and answers
Summary of Contents for ECE 492
Page 1
ECE 492 Capstone Project 2013W Virtual Guitar Gloves Summary: Play a virtual guitar in the air by using two gloves fitted with tactile sensors and an accelerometer. Group Members: Elysia Jong ejong@ualberta.ca Qingyue Zhou qingyue@ualberta.ca...
Page 2
Abstract Terasic’s V.1.6 DE2_SD_Card_Audio demonstration was used as a base for this project. By default, it waited for an SD card to be inserted into the FPGA’s port, then played all the files within it in sequence through audio out. The files are assumed to be of .wav format with a 48 kHz sampling rate.
Functional Requirement Specification: Our virtual guitar consists of 2 gloves. There are 7 tactile sensors on the left hand, which are used for 7 notes (A to G). There are 4 sensors on the right: 2 used to go up/down octaves, 1 to switch from playing notes to chords or vice versa, and a reset to the original mode (notes with default octave).
The tactile sensors, combined with hardware debouncing, had no issues. The left hand sensors correspond to the correct notes/chords and the right hand’s mode switch (for selecting notes/chords), octave up, octave down, and reset buttons were functional. The LCD also correctly displayed whether the user was in note or chord mode and which octave.
Flow chart: Image 2: Software design flow Input to output functionality: 1 Tap sensor and accelerometer signals detected from GPIO pins 2 Based on input, read sound file from SD card 3 Output sound file to speakers connected to FPGA Algorithms/Tasks: “task_which_note”...
BASE_ADDRESS, it corresponds to a tactile sensor being depressed. The sector that should be read from the SD card is then updated depending on which sensor it was. While polling is generally wasteful for CPU cycles, this system has no need to do any other critical computation or tasks other than to respond to the user’s actions.
2GB SD Card $10.00 $10.00 $9.95 $9.95 Accelerometer (MMA8452Q) Digital output via I2C bus. Low voltage to interface (1.6- 3.6V). ±2g/4g/8g 3-axis. Package is about the size of a quarter. 1.95-3.6V supply. 2 programmable interrupt pins. Supplier: https://www.sparkfun.com/products/10955 Datasheet: http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Sensors/Ac celerometers/MMA8452Q.pdf $0.05 $0.55...
3. For the SD card, the application note “SD_Card_Interfacing” created by Jason Brown & Brady Thornton (Group 12) of Winter 2013 can be used as a substitute plan: https://www.ualberta.ca/~delliott/local/ece492/appnotes/2013w/SD_card_interfacing/ Datasheet User Perspective Diagram Image 3: User perspective diagram User I/O Signals: All GPIO inputs are driven by +3.3 V and are active low.
Page 11
GPIO_0[10] Note A tactile sensor on left index tip Input GPIO_0[12] Note B tactile sensor on left middle tip Input GPIO_0[14] Note C tactile sensor on left ring tip Input GPIO_0[16] Note D tactile sensor on left pinky tip Input GPIO_0[18] Note E tactile sensor on left index tip below Note A Input...
Accelerometer Interface: Signal Description Type sda_padoen_o data enable scl_i2c_to_accel i2c clock to accelerometer sda_i2c_to_accel i2c data to accelerometer inout scl_i2c_to_bus i2c clock to i2c bus sda_i2c_to_bus i2c data to i2c bus inout interrupt2 int2 on accelerometer avalon_slave_address avalon_slave.address avalon_slave_readdata avalon_slave.readdata avalon_slave_writedata avalon_slave.writedata avalon_slave_write_n...
External Circuitry Schematic: Image 6: Schematic Power: The below values were obtained with a DE2 power measurement wiring harness connected to the system: Idle: 0.447A, 9.10V Power = I R = (0.447 to 0.457) 9.10 = 1.818 to 1.901 [W] Peak: 0.457A, 9.10V Background Reading 1.
Page 15
program is going to read 512 bytes each time, write the data to the DAC FIFO in the audio controller, and then enter the next loop. In our design, we should know base/starting address of each sound file, and how many loops we are going to read for each of them. 2.
Page 16
http://dcodelab.files.wordpress.com/2012/11/command.jpg Furthermore, SD card initialization, data reading, data writing, and data erasing, were explained. The information was extremely similar to what we are doing for our project (based of off Terasic’s demo.) and multiple example projects we have found have used the same methods for SD card communication (1-bit SPI).
http://ieeexplore.ieee.org/xpl/articleDetails.jsp?tp=&arnumber=6278363&contentType=Books+ %26+eBooks&searchField%3DSearch_All%26queryText%3DAltera+Quartus+II+Tutorial This is a tutorial article for Altera Quartus II. It includes several functions of Quartus II. We found it is very useful under the section “B6. Making Pin Assignment”. It helped us to complete our application notes, which is about applying internal weak pull-up resistor in Quartus Software design The software design is based on Nios II, uC/OS-II.
all the messages from other tasks and analyze the signals to perform the next correct move. It is going to monitor the sensors’ signals from the player’s left hand by polling. There are seven tap sensors/switches on the left hand glove. We could distinguish all those signals by assigning them to different pins on the GPIO on DE2 board.
List of Libraries: Name Description "altera_avalon_pio_regs.h" Provides a hardware interface that allows software to access the PIO. "altera_avalon_lcd_16207_regs.h" Provides a hardware interface that allows software to "altera_avalon_lcd_16207.h" access the two (2) internal 8-bit registers in an Optrex model 16207 (or equivalent) character LCD display (the kind shipped with the Nios Development Kit, 2 rows x 16 columns).
const int cmd24[5] = {0x58,0x00,0x00,0x00,0x00}; /* Write a single block */ const int acmd41[5] = {0x69,0x0f,0xf0,0x00,0x00}; /* Active Card's ini process */ const int acmd42[5] = {0x6A,0x0f,0xf0,0x00,0x00}; /* Disable pull up on Dat3 */ const int acmd51[5] = {0x73,0x00,0x00,0x00,0x00}; /* Read SCR(Configuration Reg) */ note: we are not using all of these commands.
Decrease octave works on all notes Reset sends system to note mode and default octave No sound plays if no tactile sensors are engaged but accelerometer detects No failure if user holds the chord/up octave/down octave/reset buttons instead of pressing them Playing one note and another in quick succession should cut off the first note (no overlap) Response time and performance...
Software: Steps for non-volatile version: 1. Navigate to the directory of this project. 2. Run ./scripts/launch_quartus.sh in the terminal. 3. Compile the code in Quartus task section. 4. Flash the compiled .sof file to the DE2 board (JTAG port). 5. Run ./scripts/launch_niosII.sh in the terminal. 6.
Page 26
(SHARP GP2D15 F 52) was successfully implemented as a backup. This sensor requires a 5V power supply and outputs a digital signal (0 for non-detection, 1 for detection). Thus, it was very easy to interface and power it through the GPIO pins on the DE2. The accelerometer was still chosen as the main option for strumming detection as it provided much more features that can be used to extend upon this project.
Page 28
Source code section: Block diagram of interactions between processes: Image 11: Software block diagram Index to source code: Status: -Not compiled successfully -Compiled without errors -Executed or otherwise demonstrated -Tested and passed Source File (Created) Description Status hello_ucosii.c Main C file modified from Terasic’s “DE2_SD_Card_Audio.”...
Page 29
terasic_includes.h From Terasic’s demo. Links to other header files. i2c_ctrl.h/i2c_ctrl.c From Reference [10], controller for the accelerometer I2C bus. accelerometer.h/ From Reference [10], controller for the accelerometer. accelerometer.c DE2_SD_Card_Audio.v Top level Verilog file modified from Terasic’s “DE2_SD_Card_Audio.” opencores_i2c_master.vhd Top level VHDL file of i2c bus modified by Troy. Table 7: Created source files Source File Description...
Page 30
noteB.v SOPC builder - tap sensor noteC.v SOPC builder - tap sensor noteD.v SOPC builder - tap sensor noteE.v SOPC builder - tap sensor noteF.v SOPC builder - tap sensor noteG.v SOPC builder - tap sensor Oct_DOWN.v SOPC builder - octave down tap sensor Oct_UP.v SOPC builder - octave up tap sensor SD_CLK.v...
Need help?
Do you have a question about the 492 and is the answer not in the manual?
Questions and answers