This week I primarily focused on getting the sound module working in hardware. Our 8-bit DAC, 3.5mm stereo jack, and jumper wires arrived on Wednesday, so I breadboarded the audio hardware (as designed last week for the middleman board) to make sure everything would work. One area of concern was that the minimum voltage our DAC needs for a high value is 2.4V, and the FPGA GPIO pins output a high voltage of 2.5V. This proved to not be an issue though, so we will be moving forward with the middleman board as is.
I had to change a couple things in my Verilog for the music module. First, I had an expensive modulo operation that was causing me to not meet timing requirements. I had a clock counter which I was modding by the current note wavelength to get the point in the waveform cycle. I changed this so that the clock counter would instead just count to the current wavelength and then reset. I also cleaned up the rest of my code by 1) splitting each module into its own file and 2) using explicit counter modules, rather than including all my counter logic in always_ff blocks. I was happy to see that my synthesized design took only 1% of the ALMs on the DE0-CV, as area is becoming a precious resource with game logic. I tried to design the music module to be lightweight and I’m glad that paid off.
I had some troubles with installing Quartus on my personal computer and getting the pin assignments to cooperate, but once I was able to synthesize and program my board, the circuitry worked first try. I took a short video of the whole thing in action:
https://drive.google.com/file/d/1zv8ESeyPrDs8PyCj7VEOEUGBFnfPqMl5/preview
I’m ordering PCBs this week, since I missed the window to order last week before I had finished the audio testing. Our buttons came in, so next order of business is to catch up on controllers and get those finished.
I’m a little behind schedule with controllers, but ahead of schedule on audio. What I have now for audio already meets our MVP requirements (plays original Tetris music at 50kHz, 3.5mm jack output), so all that’s left is to fabricate the middleman PCB and build an enclosure for it.