Lab Report #7 Alex Styborski, Daniel Telesman, and Josh Kauffman Group 12 March 22, 2013 Abstract

Similar documents
Lab Report #10 Alex Styborski, Daniel Telesman, and Josh Kauffman Group 12 Abstract

The Audio Synthesizer

Using the CODEC ReadMeFirst

SDR14TX: Synchronization of multiple devices via PXIe backplane triggering

I hope you have completed Part 2 of the Experiment and is ready for Part 3.

Lab 4 An FPGA Based Digital System Design ReadMeFirst

Web-Enabled Speaker and Equalizer Final Project Report December 9, 2016 E155 Josh Lam and Tommy Berrueta

Iowa State University Electrical and Computer Engineering. E E 452. Electric Machines and Power Electronic Drives

ESE 350 Microcontroller Laboratory Lab 5: Sensor-Actuator Lab

Debugging a Boundary-Scan I 2 C Script Test with the BusPro - I and I2C Exerciser Software: A Case Study

BeRadio SDR Lab & Demo

Surfing on a Sine Wave

TRDB_DC2 TRDB_DC2. 1.3Mega Pixel Digital Camera Development Kit

1 Overview. 2 Design. Simultaneous 12-Lead EKG Recording and Display. 2.1 Analog Processing / Frontend. 2.2 System Controller

EE 308 Spring 2006 FINAL PROJECT: INTERFACING AND MOTOR CONTROL WEEK 1 PORT EXPANSION FOR THE MC9S12

IMPLEMENTING THE 10-BIT, 50MS/SEC PIPELINED ADC

Digital-to-Analog Converter. Lab 3 Final Report

Lab 1.2 Joystick Interface

Experiment I: An Introduction to the Arduino Due + Sampling and Reconstruction

EE 300W Lab 2: Optical Theremin Critical Design Review

ADS9850 Signal Generator Module

Game Console Design. Final Presentation. Daniel Laws Comp 499 Capstone Project Dec. 11, 2009

Cyclone II Filtering Lab

Synthesizer. Team Members- Abhinav Prakash Avinash Prem Kumar Koyya Neeraj Kulkarni

Connect Four Emulator

Lab #10: Finite State Machine Design

Capacitive Touch Sensing Tone Generator. Corey Cleveland and Eric Ponce

Introduction to Simulation of Verilog Designs. 1 Introduction. For Quartus II 13.0

Lab 3 Final report: Embedded Systems Digital Potentiometer Subsystem TEAM: RAR

Lab 3: Embedded Systems

Lab 6 Using PicoBlaze. Speed Punching Game

Experiment 3. Direct Sequence Spread Spectrum. Prelab

Introduction to Simulation of Verilog Designs. 1 Introduction

ACEX 1K. Features... Programmable Logic Device Family. Tools

Techniques for Implementing Multipliers in Stratix, Stratix GX & Cyclone Devices

Hardware/Software Co-Simulation of BPSK Modulator and Demodulator using Xilinx System Generator

Simultaneous Co-Test of High Performance DAC-ADC Pairs May 13-28

Stratix Filtering Reference Design

EE307. Frogger. Project #2. Zach Miller & John Tooker. Lab Work: 11/11/ /23/2008 Report: 11/25/2008

University of North Carolina-Charlotte Department of Electrical and Computer Engineering ECGR 3157 Electrical Engineering Design II Fall 2013

MP212 Principles of Audio Technology II

Computer Architecture Laboratory

Overview. This lab exercise requires. A windows computer running Xilinx WebPack A Digilent board. Contains material Digilent, Inc.

Video switch for CANAL-Plus decoder

IF ID EX MEM WB 400 ps 225 ps 350 ps 450 ps 300 ps

Hardware/Software Co-Simulation of BPSK Modulator Using Xilinx System Generator

Introduction to Simulation of Verilog Designs. 1 Introduction. For Quartus II 11.1

FIR Filter for Audio Signals Based on FPGA: Design and Implementation

An FPGA-based Re-configurable 24-bit 96kHz Sigma-Delta Audio DAC

High-Speed Transceiver Toolkit

Quartus II Simulation with Verilog Designs

Experiment 5: Basic Digital Logic Circuits

Embedded Test System. Design and Implementation of Digital to Analog Converter. TEAM BIG HERO 3 John Sopczynski Karim Shik-Khahil Yanzhe Zhao

Lab 4: Using the CODEC

Week 8 AM Modulation and the AM Receiver

Implementing Dynamic Reconfiguration in Cyclone IV GX Devices

Arria V Timing Optimization Guidelines

Design of an Active Noise Control System Using Combinations of DSP and FPGAs

Campus Fighter. CSEE 4840 Embedded System Design. Haosen Wang, hw2363 Lei Wang, lw2464 Pan Deng, pd2389 Hongtao Li, hl2660 Pengyi Zhang, pnz2102

Stratix II Filtering Lab

CONTENTS Sl. No. Experiment Page No

Generating DTMF Tones Using Z8 Encore! MCU

Optical Theremin CDR

Design Implementation Description for the Digital Frequency Oscillator

Rotary Motion Servo Plant: SRV02. Rotary Experiment #02: Position Control. SRV02 Position Control using QuaRC. Student Manual

SNGH s Not Guitar Hero

1. GENERAL DESCRIPTION FEATURES PIN DESCRIPTION BLOCK DIAGRAM... 5

How To Mac. Setup your Macintosh computer: Go to APPLICATIONS > UTILITIES > AUDIO MIDI SETUP Set the AUDIO DEVICE as shown to use the mlan NETWORK

ACEX 1K. Features... Programmable Logic Family. Tools. Table 1. ACEX TM 1K Device Features

Open Source Digital Camera on Field Programmable Gate Arrays

Lab 5. Binary Counter

Forensics with TI-NspireTM Technology

Terasic TRDB_D5M Digital Camera Package TRDB_D5M. 5 Mega Pixel Digital Camera Development Kit

EE 314 Spring 2003 Microprocessor Systems

10. DSP Blocks in Arria GX Devices

Quartus II Simulation with Verilog Designs

M-Powered Basics Guide

Lab 6. Binary Counter

CSE 3215 Embedded Systems Laboratory Lab 5 Digital Control System

Laboratory set-up for Real-Time study of Electric Drives with Integrated Interfaces for Test and Measurement

6. DSP Blocks in Stratix II and Stratix II GX Devices

CSEE 4840 Project Design A Tower Defense Game: SAVE CROPS

Move-O-Phone Movement Controlled Musical Instrument ECE 532 Project Group Report

EE 209 Lab Range Finder

Interfacing to the SoundStation VTX 1000 TM with Vortex Devices

SynthNV - Signal Generator / Power Detector Combo

Laboratory Manual CS (P) Digital Systems Lab

Digital Signal Processing for Analog Input

Name That Tune: Matching musical tones through waveform analysis

MARMARA UNIVERSITY CSE315 DIGITAL DESIGN LABORATORY MANUAL. EXPERIMENT 7: Analog-to-Digital Conversion. Research Assistant Müzeyyen KARAMANOĞLU

Controlling Your Robot

RC Filters and Basic Timer Functionality

IF ID EX MEM WB 400 ps 225 ps 350 ps 450 ps 300 ps

Using ProASIC PLUS Clock Conditioning Circuits

AC : PERSONAL LAB HARDWARE: A SINE WAVE GENERATOR, LOGIC PULSE SIGNAL, AND PROGRAMMABLE SYNCHRONOUS SERIAL INTERFACE FOR ENHANCING EDUCATION

DSP Project. Reminder: Project proposal is due Friday, October 19, 2012 by 5pm in my office (Small 239).

Digital Guitar Effects Box

(SUBSINO CASINO GAME HIGH RESOLUTION SERIES)

STRS COMPLIANT FPGA WAVEFORM DEVELOPMENT

University of California at Berkeley Donald A. Glaser Physics 111A Instrumentation Laboratory

Transcription:

Lab Report #7 Alex Styborski, Daniel Telesman, and Josh Kauffman Group 12 March 22, 2013 Abstract The goal of Lab 7 was to create a musical keyboard from a computer keyboard. The keyboard was connected to the DE2 board, which was programmed using QUARTUS II with a circuit built by the students. The keyboard s keys were used as inputs, and functioned like the keys on a piano, or other musical instrument. These inputs were manipulated to form p values for a synthesizer circuit. Since these p values directly change the output frequency of the synthesizer and the output was sent to the CODEC on the DE2 board, each key was able to be mapped to a specific audible note. The circuit created in this lab allowed two notes to be played at once from the keyboard (two channels) and also allowed the channels of the keyboard to be toggled on and off using a switch on the DE2 board. This was accomplished through the use of multiplexers.

Lab Report #7 2 3/22/2013 Introduction Lab 7 built off knowledge learned in previous labs. Group 12 continued to implement synthesizers and the CODEC. This specific lab required the group to construct a musical keyboard that has the ability to play two frequencies simultaneously (two channels). The group was also required to have an option to turn off two channels and only have one note playing simultaneously. This lab report includes the calculations that were done, the experiment and results that were obtained, and lab discussion questions. A conclusion ends the lab report. Theory / Calculations Constant P equations: B = (F / F Middle C ) x (2 m / F s ) -- (eq. 1) a/2 m (Bit-Shifting) -- (eq. 2) F(12-bit) x B(20-bit) = P(32-bit) Main Body The procedure of this lab builds on many of the previous labs. It involves the use of the CODEC, a synthesizer and an lpm_rom, all created in previous labs. Before constructing the circuit, a new QUARTUS II project is created in a new folder. DE2 device settings and other general project settings are the same as in previous labs. Specific settings for the lab are listed in Table 1 and will be referred to throughout the lab. File/Component Parameter Proper Setting Lpm_ROM - Lookup Output bus 12 Bits Number of words 256 words Memory content file Freq_map.mif Lpm_ROM - Synthesizer Output bus 12 Bits Number of words 256 words Memory content file brass.mif Lpm_add_sub0 data 32 Bits Addition, Subtraction, or Both Addition Lpm_add_sub1 data 16 Bits Addition, Subtraction, or Both Addition Lpm_mux Data inputs 8 Bits Output bus 8 Bits Lpm_mult dataa 20 Bits datab 12 Bits Does datab have a constant No Value? Type of multiplication Signed Table 1: Settings for specific circuit elements

Lab Report #7 3 3/22/2013 The group will begin by constructing and implementing a one channel controller. After receiving successful results, the group will incorporate two channels. The reason for this is to simplify error debugging in the case the project doesn t compile or function. The group begins by first configuring the CODEC chip. The procedure for this has been stated in previous labs. After checking to make sure the CODEC and speaker are operating correctly, the group can then begin to work on the constructing the circuit. The procedure is as follows: Channel One A new block diagram is created and saved in the project directory. Before the construction of the circuit, the filed named PS2_KEYBOARD.v must be copied into the project folder from the Sophomore Experience Directory. This is the symbol file for the PS2 keyboard component that will be implemented into the design. A symbol file can be created from this file by going to file --> create --> symbol file. The PS2_KEYBOARD block element can now be used in the project. The group first builds a single synthesizer based off the settings located in Table 1. The process for building a synthesizer has been used in the previous labs. Next, brass.mif needs to be copied into the project directory from the Sophomore Experience folder. This file is used with the lpm_rom element of the synthesizer. The file is used in both channel one and for channel two. Further assembly of the synthesizer then continues again adding components whose properties are stated in Table 1. After successfully constructing the synthesizer, the group needs to arrange the circuit to operate with the PS2 keyboard. Further expansion of the circuit will be necessary. First, a new lpm_rom needs to be created in order serve as a lookup table for the different keys on the keyboard. Add the component using the settings described in Table 1. From there, the values contained in the.mif have not yet been converted to the proper analog frequencies that will appear at the line_out when a key is pressed and need to be adjusted. In order to obtain these values, a multiplier, lpm_mult, is used with a constant, B, to find the correct frequencies. To determine the constant B, eq. 1 is used. (eq. 1) B = (F / F Middle C ) x (2 m / F s ) The result of eq. 1, setting F equal to 523 Hz and F Middle C equal to 565, is 82827. Next, the lpm_constant is connected to the input with a width of 20 and lpm_rom to the input with a width of 12 on the multiplier. The output of this will be a number that will represent the address and frequency. The idea of this part of the circuit is again to assign each key that is located in the.mif file with its own unique frequency when pressed. From here the signal will flow from the output of the multiplier which is then connected to the input, dataa, of the lpm_add_sub of the synthesizer. Now, the DAC component must be added to the project. To do this, it is first copied into the project directory of the Sophomore Experience folder and then added to the project (refer to lab 4 for the setup of the block). The output from the lpm_rom1 of the synthesizer is then directly connected to audio_outl and audio_outr. The output of the signal will then be fed into an adc2dac component. The AUD_DACLRCK is used as the clock for the synthesizer part of the design. The PS2_KEYBOARD element is then added.

Lab Report #7 4 3/22/2013 Two input pins are added and connected to CLOCK_50 and ps2_clk. CLOCK_50 will then be routed to be the DAC block and lpm_rom0. Next a power source or vcc is added and connected to both reset and reset 1 of the ps2 keyboard component. After this, a bidirectional pin is needed for the port named ps2_dat. Finally lpm_rom input is connected to key1_code. The design now is complete for a one channel electric keyboard. After importing pin assignments and verifying that this project is set to the top-level entity, the project is compiled then programed onto the FPGA chip. Figure 1 shows the keys that are active on the PS2 keyboard. Figure 1: The location of the frequencies on the PS2 Keyboard. Channel Two The following is the procedure to expand the previous circuit to generate two signals when two keys are pressed on the PS2 keyboard simultaneously. To begin, the group needs to replicate the first channel to create another identical circuit that uses its own synthesizer. In addition to this, in order to have some control over whether or not the circuit will be one or two channels, a multiplexer, lpm_mux, will also be added to each channel before the lpm_roms that contain the look up tables. A multiplexer is a function that allows the group to control the output. In this case, the multiplexers will have two inputs. The first, data1, will be connected to the PS2 keyboard component at either key1_code (or if it s for the second channel, at key2_code). The other input, data0, will be connected to a ground. Next, the group adds an input pin named SW[1] (or SW[2]) as the selector. Figure 2 exhibits the above descriptions.

Lab Report #7 5 3/22/2013 Figure 2: Part of a circuit that implements multiplexers to control the channels. The group then needs to add the outputs of the synthesizer together before sending it into the DAC. Since there are two channels for this keyboard, each out of the synthesizers will need to be divided by two before they can be added together. To do this, bit shifting must be used (see eq. 2). (eq. 2) a/2 m The least significant digits, depending on m, will be discarded and the number can then be padded with 0 s. In this case, the output bus divide by 2 1 of the first synthesizer is named in1[15],in1[15],in[14..1]. As one can see, the last two digits are discarded and then padded with zeros on the left. The same idea is applied to the second synthesizer. Finally, both buses are added together and the result is routed to the DAC block. Figure 3 shows how the synthesizers are connected and Figure 4 shows how the DAC block is implemented fully into the design.

Lab Report #7 6 3/22/2013 Figure 3: Part of a circuit that shows the addition of two synthesizers. Figure 4: Part of a circuit that shows how one bus can be routed to both signals of the DAC component.

Lab Report #7 7 3/22/2013 After ensuring that there are no errors in the design, the group compiles and programs the FPGA chip. The two channel electrical keyboard is now fully usable with the FPGA. Switch 1 on the DE2 board will enable the first channel and switch 2 will enable the second channel. The group may now begin to play beautiful music. Discussion and Suggestions How does the circuit convert key codes from the PS/2 keyboard controller into frequencies for the synthesizer? When a key is pressed on the keyboard a unique 8-bit wide signal is output from the PS2_KEYBOARD element. This signal is sent through a multiplexer (if switch is on) and then into an lpm_rom element, which maps the signal to a specific 12-bit output / frequency. The lpm_rom acts as a lookup table and converts the 8-bit keyboard signal into a 12-bit output frequency. This output is then multiplied by the constant B to get the p-value frequency for the synthesizer. Explain the purpose of constant B Constant B is used to convert the output frequency of the lookup table ROM into the p-frequency that the synthesizer uses. Hint: It is used to do 2 different tasks in one multiplication. Show and explain how you calculated constant B. 1. B s first function was as the multiple that gets the values received from the lpm_rom high enough to be used as valid frequencies for producing sound. 2. B s second function was tuning the keys to the correct frequency. i.e. F is a middle C The variables are then placed into the equation: I. F emits a frequency of 565 Hz naturally. II. A 32-bit bus is ultimately used so m=32. III. F s = sampling rate = 48000 Hz IV. F middle c = 565 Hz

Lab Report #7 8 3/22/2013 What does it mean to have two channels? The two channels are a result of the keyboard needing multiple outputs. When one key is pressed the keyboard outputs one unique signal. If a second is pressed the keyboard outputs a second unique signal. The second signal needs a new place to go because the first key that was pressed is taking the output slot. Due to this fact, the second signal needs to be output to a different output or channel. Using two channels means that these two outputs are connected to two independent synthesizers. Both channels then create their own output that could be played as an individual note. How are these channels merged into a single signal? However, the CODEC cannot handle two different outputs at the same time, so they must be merged into a single signal. To merge these signals, the outputs of both channels are divided by two (via bit shifting) and are then added together to create a single signal. The merged signal is sent to the adc2dac block in order to be converted and output to the speaker as sound. What do the multiplexers for the circuit do? The multiplexers in this circuit allow the user to turn off and on each channel independently. The user is able to turn on and off the first channel from the keyboard by using switch 1. Without this switch on, no sound can be played. Switch 2 controls the second channel of the circuit. When both switch 1 and 2 are on, two notes can be played at the same time. If switch 1 is on and switch 2 is off, then only one note can be played at a time. Conclusion The knowledge gained from previous labs was used in this lab to construct a very intricate circuit that allowed a computer keyboard to play musical notes. Previous circuit elements, such as the CODEC and the synthesizer circuit, were placed alongside new circuit designs like multiplexers to create the completed circuit. This approach of using both old and new components helped to reinforce the students understanding of each electrical component. In addition to understanding what is happening in the hardware, students also became more proficient at using QUARTUS II. Acknowledgements Alex Styborski, Daniel Telesman, and Josh Kauffman all were present during the lab period and contributed to this lab report.