User Tools

Site Tools


2014:fpga_piano_lfsr_with_sine_wave_generator

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
2014:fpga_piano_lfsr_with_sine_wave_generator [2014/12/18 22:50]
teamuptownfunk [Playing a Programmed Song with the Press of a Button]
2014:fpga_piano_lfsr_with_sine_wave_generator [2014/12/18 23:00]
teamuptownfunk
Line 41: Line 41:
 ==== How did we do it?==== ==== How did we do it?====
  
-The first thing we needed to do was slow down the clock. We ran the clock through an Up Counter so that the flip flops would wait for the clock appropriately to get the correct signal at 440 Hz. We had an up counter for each note, but it was pointed out to us that we could have just one up counter and get the signal at any point of the up counter at the frequencies we wanted. ​+== Piano == 
 +The first thing we needed to do was slow down the clock. We ran the clock through an Up Counter so that the flip flops would wait for the clock appropriately to get the correct signal at, for example, ​440 Hz. We had an up counter for each note, but it was pointed out to us that we could have just one up counter and get the signal at any point of the up counter at the frequencies we wanted. ​The note modules (musicA, musicB, etc) each take in a clock, counter and enable and output to the speaker. We then created a LUT to We uploaded this to the FPGA after making a top level module that declared all the switches as the enables for the notes as mentioned above.  
 +To upload to the FPGA, you need to open the project FPGAPiano in Xilinx and set top.v as the top level module. Then continue to synthesize, generalize, and configure as described in the FPGA tutorial. Now the switches will act as a piano! ​
  
-==== Run the piano/​song/​LFSR ====+== LFSR == 
 +Using the LFSR, we initially attempted to listen to the output bits, a random collection of 0s and 1s. Since the output of the LFSR is approximately,​ random, we were expecting to hear just static. However, our problem is that we did not slow down our clock, so our speaker, outputting frequencies in the MHz, played a soft incredibly high-pitched noise. 
 + 
 +We then decided to slow down our clock to the frequencies of each note, as in our piano, and then feed that into the LFSR. When we did that, we were able to hear repetitive chip-tune like sounds, very much making the expected static noises in a discernible pattern. 
 + 
 +In order to make our chip-tunes a higher pitch, the base clock frequency can be changed. We used a 25 MHz clock on the FPGA so that our upcounters did not need to count to larger numbers, but for our chip-tunes, simply manipulating the frequency of the clock on the FPGA produces drastically different sounds. In order to make a chip-tune that sounds more like the effects used in an old school arcade game, try switching the clock to 50 or 100 MHz. 
 + 
 +==== Run the piano/​song/​LFSR ​& Pick up where we left off ====
 You can synthesize either the piano mode or the LFSR chip tunes mode on the FPGA. You can synthesize either the piano mode or the LFSR chip tunes mode on the FPGA.
-==== Pick up where we left off ==== 
 Clone our repository at https://​github.com/​yunhsincynthiachen/​CompArchFPGAPianoFinal and program the FPGA in Xilinx opening the project ___________ or ____________. Clone our repository at https://​github.com/​yunhsincynthiachen/​CompArchFPGAPianoFinal and program the FPGA in Xilinx opening the project ___________ or ____________.
  
 http://​tinyurl.com/​ca-fpga-13 http://​tinyurl.com/​ca-fpga-13
2014/fpga_piano_lfsr_with_sine_wave_generator.txt · Last modified: 2014/12/18 23:17 by teamuptownfunk