My original topic: http://www.diystompboxes.com/smfforum/index.php?topic=88921.0=== Introduction ===
I'm like a lot of DIY'ers in that I really want to explore the digital side of
developing guitar effects. In school, we were spoiled on 8-bit PIC processors,
so I wanted to take the next step and try out Microchip's 16-bit dsPIC chips.
My goal is to develop a simple DSP platform with which I can sample a guitar
signal, try out some filtering/waveshaping/whatever, and spit the samples out
of the on-board audio DAC.
In short, I hope that this thread does the following:
1. Shows where I'm currently at with the project and provide a place for updates.
2. Allows other members of the community to ask questions and/or contribute ideas.
3. Shows other curious DIY'ers how a DSP system can be implemented to get real, audible
results with relative ease.
Keep in mind that this is, and will probably be for quite some time, a WORK-IN-PROGRESS
We all know the learning process never ends, but I'm really enjoying this project so far and
I wanted to share it with everyone here.
I'll try to include a high-level overview of the system and its major parts for now, but
please feel free to ask questions and/or make requests and I'll be happy to respond with
more details.=== Schematic ===
DSP: The brain of the system is the 16-bit dsPIC33FJ64GP802 processor from Microchip. This
chip was chosen because it has all the required peripherals on-board, including a
12-bit ADC and a 16-bit stereo DAC specifically designed for audio purposes. It runs at
at 80Mhz, or 40 MIPS. The dsPIC chips are essentially the same as Microchip's regular
16-bit processors (PIC24) except that they also have a DSP engine.
Port Expander: This is used for extra general purpose input/output, or GPIO for short. It
has two ports, each with 8 additional I/O lines. Right now, I
am using 4 lines as data to my LCD screen. I plan on keeping the entire other
port unused for now, and using a header for easy access to those
pins later on, just in case the extra I/O is needed. (add-on boards?)
LCD Screen: The display is a 16x2-line character LCD. I'd like to keep this in the system
and eventually use it as a user-interface. Perhaps program a few different
effects and use buttons with the display to act as a simple menu to select which
algorithm the user wants to use.
Dual Op-Amp: The special feature of the MCP6022 chip is that its outputs are rail-to-rail
capable and it runs on 5 volts. The DAC output only swings about 1Vrms peak
so there is plenty of headroom. The DAC outputs are also differential, so
the op-amps convert the signals to single-ended.=== Programming the dsPIC ===
Programmer: Pickit 2
Compiler: MikroC PRO for dsPIC30/33 and PIC24
You can program the dsPIC (along with MANY other Microchip devices) with the above tools.
MikroC PRO is a trusted, VERY GOOD third-party C compiler with excellent software libraries.
It is free to download here: http://www.mikroe.com/eng/products/view/231/mikroc-pro-for-dspic30-33-and-pic24
The Pickit 2 is a Microchip programmer that can handle basically all of Microchip's
processors except for their latest-and-greatest ones. It's a great tool for hobbyists
at only $34.99: http://www.microchipdirect.com/productsearch.aspx?Keywords=PG164120
I have code written already to communicate with the other devices in the system. Thus, there
is a single location in the main function where you can play around with coding different
effects algorithms. So, if you don't want to concern yourself with anything else, you can
just jump right to that spot in the code and start programming some effects!=== My First Digital Effect: Foldback Distortion ===
With a working ADC-DAC loopback platform, now we can get to the fun part. One simple
distortion algorithm (which I admittedly found online somewhere) is called a foldback
distortion. Basically, the algorithm clips the samples at a certain threshold that you
define, then it clips additionally based on the difference between the sample and the threshold.
So, the bigger difference between the signal and the clipping threshold, the more clipping
you will actually get. The resulting sound isn't super-impressive, but again, this was the
very first thing I tried and honestly I was just excited to be able to hear that my project
was working!=== Conclusion and Tentative Plans ===
Hopefully this thread will be helpful to others who want to develop their own DSP systems.
Sure, it ain't the best, but it works, and its a great way to take that first big step into
learning more about digital devices and applying it to something cool like guitar!
As a side-note, I thought it might be worth while to have professional PCBs made. I'll see
what kind of response this post gets and maybe if there is enough interest I can take that
step and do a layout. I just don't want to pay for several boards when I really only need
one or two for myself. If other folks are interested in the project maybe I can order some
though and make a little kit out of it.
I planned on adding support for EEPROM and SRAM chips just in case extra memory
is required. Also, analog pots will be added so the user can change parameters in real-time.
Aside from that stuff, I'm going to continue to experiment with different algorithms and just see
what kind of sounds I can get. Again, any suggestions in this area would be fantastic! === Attachments ===
Code, sound samples, pictures, etc are available upon request.