User Tools

Site Tools


projects:fpga_note_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
Last revision Both sides next revision
projects:fpga_note_generator [2013/12/22 22:50]
criley1
projects:fpga_note_generator [2013/12/30 18:21]
criley1
Line 1: Line 1:
 +======FPGA Note Generator======
 +by Caitlin Riley
 +
 =====What I Did===== =====What I Did=====
  
-{{projects:​p1020661.jpg?​550}}+{{projects:​p1020661.jpg?​550|Note Generator}}
  
-I turned my FPGA into an instrument capable of playing eight notes. The eight switches on the FPGA are set to correspond to a note in an A natural minor scale. When a switch is on, the FPGA outputs an 8-bit quantized sine wave corresponding to that note. The sine wave is then converted into an analog signal that drives a speaker. ​+I turned my FPGA into an instrument capable of playing eight notes. The eight switches on the FPGA are set to correspond to a note in an A natural minor scale. When a switch is on, the FPGA outputs an 8-bit quantized sine wave corresponding to that note. The sine wave is then converted into an analog signal that drives a speaker. A video of it working can be downloaded [[fpga_note_generator#​files|below]].
  
 ====Why I Did It==== ====Why I Did It====
Line 34: Line 37:
 ====Digital-to-Analog Converter==== ====Digital-to-Analog Converter====
  
-{{projects:​p1020662.jpg?​350}}+{{projects:​p1020662.jpg?​350|R-2R Ladder}}
  
 I ended up using an R-2R resistor ladder as the DAC for my system. Using an R-2R resistor ladder is a simple way to convert from digital to analog. It works by weighting the contribution of each bit to the final output voltage. The most significant bit contributes the most to the output voltage and the least significant bit contributes the least. An op amp buffer was placed between the resistor ladder and the speaker to prevent the speaker from acting as another resistor and distorting the output of the DAC. Although an R-2R ladder is not as accurate as other methods of digital to analog conversion, it was good enough for my purposes. I ended up using an R-2R resistor ladder as the DAC for my system. Using an R-2R resistor ladder is a simple way to convert from digital to analog. It works by weighting the contribution of each bit to the final output voltage. The most significant bit contributes the most to the output voltage and the least significant bit contributes the least. An op amp buffer was placed between the resistor ladder and the speaker to prevent the speaker from acting as another resistor and distorting the output of the DAC. Although an R-2R ladder is not as accurate as other methods of digital to analog conversion, it was good enough for my purposes.
Line 104: Line 107:
 </​file>​ </​file>​
  
-The complete code used in the project can be downloaded below. ​+The complete code used in the project can be downloaded ​[[fpga_note_generator#​files|below]]
  
 ===Schematics=== ===Schematics===
 Because the switches on the FPGA board are connected to the same FPGA pins as the 16-pin header connector, I used two sets of the 6-pin header connectors to connect the 8-bit sine wave output to the DAC. I powered the op amp from the ground and V<​sub>​DD</​sub>​ pins on the first header connector. The diagram for the DAC and speaker connection can be seen below. Because the switches on the FPGA board are connected to the same FPGA pins as the 16-pin header connector, I used two sets of the 6-pin header connectors to connect the 8-bit sine wave output to the DAC. I powered the op amp from the ground and V<​sub>​DD</​sub>​ pins on the first header connector. The diagram for the DAC and speaker connection can be seen below.
  
-{{projects:​Schematic.png}}+{{projects:​Schematic.png|Circuit diagram}}
  
 ====Gotchas==== ====Gotchas====
Line 134: Line 137:
 Additive synthesis is also something that could be experimented with to change and improve the way that the output sounds. This involves adding sine waves of different amplitudes and frequencies together to produce different sounds. Additive synthesis is also something that could be experimented with to change and improve the way that the output sounds. This involves adding sine waves of different amplitudes and frequencies together to produce different sounds.
  
 +=====Files=====
 +{{projects:​note_generator_demo_video.zip}}:​ Video demonstrating the FPGA outputting an A natural minor scale.
 +
 +{{projects:​notegeneratorproject.zip}}:​ Contains all of the project files.
projects/fpga_note_generator.txt ยท Last modified: 2013/12/30 18:27 by criley1