gundy / tiny-synth Goto Github PK
View Code? Open in Web Editor NEWVerilog code for a simple synth module; developed on TinyFPGA BX
License: Other
Verilog code for a simple synth module; developed on TinyFPGA BX
License: Other
I am having difficulty getting any audio output using your code unchanged on a TinyFPGA. My speaker setup on PIN_1 works fine for designs that just do simple tone output and I have used the same setup a lot on my myStorm FPGA with various audio output. The problem seems to be the 1Mhz carrier frequency. I tried using the low-pass filter as described in your README file. Looking at the output using an oscilloscope, when the 1Mhz signal is filtered out, the 1Khz frequency voltage is also drastically reduced so I get nothing through the speakers. I tried building an active low-pass filter with an op amp, but that did not work either. I did try putting putting it through a stereo amplifier, selecting an input with a preamp, and turning the volume up. I got some sound that way, mainly a rhythmic beating sound, but not what I was expecting.
What should the output sound like?
Do you have any suggestions of what I should try?
Are you on the TinyFPGA forum? It might be better to discuss this there.
This probably doesn't cause problems at 31.25kBaud off a 16MHz clock, but the Baud rate calculation is wrong. I was trying to reuse the module and testing with 1MBaud off 12MHz (divider of 12) and found that the bits were 14 clocks long.
The local parameter "cfg_divider" is set at line 47 to the simple ratio of clock to Baud.
At line 142 (also 130, 158, 203) the bit timing counter is tested for being strictly greater than this and, if so, cleared to zero onthenextclock*. Thus with a divider of 12, the counter cycles through from 0 to 13, giving a total of 14 counts.
The fix is in two parts. First, change all of those ">" tests to ">=". Second, calculated the cfg_divider as (clk/Baud)-1 (which is very common in hardware UART Baud generator registers).
If you are interested in your project working on other boards, I have ported the midi and song_player examples to the BlackIce II board.
See https://github.com/lawrie/tiny-synth/blob/develop/examples/song_player/top.v and https://forum.mystorm.uk/t/midi-synthesizer/470.
The way I have done it is reasonably clean with most of the BlackIce stuff in a separate blackice directory, but the example directories have an apio.ini file for the TinyFPGA BX board, but a Makefile for the BlackIce II board. There is probably a better way of doing that. The Makefile should build it for either the BlackIce II or II boards. Apio works for BlackIce too, but I mainly use it on Linux with Makefiles.
I made a Midi Pmod for use with the BlackIce boards (or any others that support Pmods).
I've checked the datasheet and the schematics to make sure and the recommended current limiting resistor is a bit low for a 3.3v usage as the IOs are rated for 8mA. So, I'd recommend using resistor of about 437Ohms instead (since you'd have to change the board design to bring Vccio down otherwise). Looking forward to test this circuit soon.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.