* It's worth noting that several of the dsPIC designs at the site linked above are the basis for the Synthesis Technology E3x0 and E5x0 series of Eurorack modules. I did a lot of the software prototyping on these little boards before we went ahead with the form/fit/function development. Based on my experience with those modules, the direction you're going using dsPICs in this thread seems feasible.

* Sample rates for the '802 DAC - The clock rate for the on-chip DAC is closely tied to the rate that the processor runs, although there is some flexibility due to the various dividers in the clock generator. In some of my oscillator applications, I usually run the dsPIC CPU at about 39MHz and then run the DAC at about 98kHz - this seems to give a good balance of sample rate vs processing throughput. For audio effects the sample rates don't need to be as high because you're not as worried about aliasing, so those will typically run the CPU at 23 or 39MHz and then clock the DAC in the 30 - 40kHz range.

* Programming language: MCHP has a decent (not *great*) C compiler for the dsPIC available for free. It integrates nicely with MPLAB and I've had pretty good luck using it for some of my more recent projects. You don't want to try using it to do high-performance DSP coding, so I use assembly for that, but I've found it works nicely to code interrupt service routines which handle signal processing in assembly, and then the low priority 'big loop' code for housekeeping works fine in C. I also have had good luck building up a personal library of C callable assembly functions for common calculations, like exponential conversion, filtering, nonlinear functions, etc. Also, parsing MIDI in C is worlds easier than trying to do it in assembly...

* Someone mentioned that the DACs can be noisy. True. Also from time to time you may come across a dsPIC with bad DACs. I've got no idea how those slip through the manufacturing testing process, but usually just swapping them out works.

Keep up the good work. I'll be lurking so if there's any way I can contribute just gimme a shout...

I will be watching this post with excitement! I would love to find a SIMPLE SDIY DSPIC project!

I have been finding tons of synth related AVR projects...But everyone keeps telling me the DSPIC has the power to do amazing things...sadly, unlike the AVR, it seems much harder to find projects to learn from, and the code seems more complicated...(hence the need for projects to learn from

I also bought some Microchip 23K256 ICs, these are 32K byte SPI SRAM ICs. Using the CS pin to select the RAM being accessed, I should be able to put 2 of them on the SPI port of the dsPIC and have 32K words for a 740 mSec delay at 44.1 kHz sample rate. This lives all of the internal dsPIC SRAM free for DSP magic._________________FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.Fruit flies when you're having fun.BTW, Do these genes make my ass look fat?corruptio optimi pessima

I now have a working dsPIC bench-test environment board. It has power supply, 3.3v reg, LED (top row left) input power connector, 6 pin RJ11, 28 pin socket for dsPIC and all support circuitry. It needs only be connected to a programmer such as PICkit-2.

I've just tested it at 40 MIPS with a 20 MHz crystal. I followed rule of thumb RF technique of keep the wires as short as possible. One of the capacitors is actually on top of the crystal with short spaghetti to keep from shorting on the xtal can.

There is a LED (bottom row center) with 200 ohms on pin 21 which is RB10. This is here for testing and experiments.

This is mainly a programmer, the application will be on it's own board without the programming hardware.

I've now got a board that can receive MIDI data on one port and send the same data at 115.2 kilobaud to a PC COM port. The MIDI receive stream is interrupt driven. The application reads MIDI bytes and translates them to hex ASCII characters sent to the output UART.

My hope is to get 8 voices minimum out of the synth. In this case, one dsPIC will be a MIDI controller and voice assigner, the other 2 will be voice engines._________________FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.Fruit flies when you're having fun.BTW, Do these genes make my ass look fat?corruptio optimi pessima

Good job, Scott. I'm guessing this is the hard part and it's all downhill from here....or am I being overly optimistic?

The dsPIC SPI module was designed to be versatile enough to connect to any sort external SPI device that can run at 10 megabits per second or less. This means the module accepts many parameter choices - all of which have to be correct or it won't work. I was also a bit worried about the electrical end of things. 10 megabits per second is essentially RF and as such, RF practices need to be observed. Clock and data lines should be the same length - but not too long. Under some conditions, buss termination resistors might be required (for long wires). Fortunately, it works with an 11 inch cable and no termination resistors. The signals (clock and data) look very clean and crisp on an oscope.

So for me, this was a big deal and yeah, it should be easier here on out.
Next is to get the DAC making a signal.
After that to get the ADC to acquire CVs from dsPIC pins.
And finally, I get to write the synthesizer. _________________FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.Fruit flies when you're having fun.BTW, Do these genes make my ass look fat?corruptio optimi pessima

This first project will be a MIDI controlled polyphonic harp synth based on Karplus-Strong string models. Two parameters that affect the synth's timbre are the loop's lowpass filter cutoff frequency and a linear damping value. These two parameters will be set by pots (supplying the CVs to the dsPICs). It could easily be modified to accept CVs generated by other devices. I am also considering a module that will accept an additional CV for pitch. In the modular version, the pitch CV would be captured and stored when the trigger occurs. Because it will have a sustain pedal input, it would be possible for a modular owner to use a sequencer to play the harp - even in polyphony because of the sustain pedal. Chords could be played with a sequence of pitch-change and triggers that are closely spaced in time. I will have to talk with modular friends to determine if this is feasible with the kind of equipment that they already own, so at this point the module version is only an idea._________________FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.Fruit flies when you're having fun.BTW, Do these genes make my ass look fat?corruptio optimi pessima

A transmit dsPIC was programmed to generate a 16 bit pseudorandom number using a 32 bit LFSR. The low word is used as data. The 32 bit SPI message was create using the low word and it's ones complement. This is then sent to the receiver with 1 uSec of dead time between transmissions.

A reciever dsPIC was programmed to receive the 32 bit messages (using interrupts). The received 32 bits of data is loaded into 2 registers. One of the registers is ones complemented and the two are then compared. If equal, the transfer was good. Errors cause a period to be sent to a terminal session using a UART set at 115.2 kbaud. As long as the terminal session has a blank screen, everything is fine. I tested the system by running it for awhile noting the blank screen. If the SPI connection is disconnected and reconnected, I get dots.

During my testing of SPI reliability, I found that a flourescent work light near the boards would cause SPI errors when switched off. I will add termination resistors to hopefully abate that behavior._________________FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.Fruit flies when you're having fun.BTW, Do these genes make my ass look fat?corruptio optimi pessima

After reading about termination, I decided on 1K resistors to ground and +3.3 on both SCK and SDI. The resistors are on the receiver end of the cable.

When testing after I added these resistors, the errors generated by turning off my flourescent work lamp stopped. I do not know if this termination will work in other environments. From what I've read, 1K is a rather light termination. I want the current as low as possible._________________FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.Fruit flies when you're having fun.BTW, Do these genes make my ass look fat?corruptio optimi pessima

Ideally termination is on both sides and has the same impedance as your cable ... a twisted pair cable impedance calculator :: http://www.eeweb.com/toolbox/twisted-pair . It'll all be a bit of an approximation of course, when your cable is shorter than about lamba / 6 it should not matter too much anyway ... hmm10 MHz is 30 meter or so ... so for cables over about 5 meter it might become an issue.

Two times 1k means 500 Ohm termination, which is not really that high I think._________________Jan

As I said, my termination is light and doesn't represent a "fix all" for all environments. Readers should not take it as the absolute best solution, only that it worked for me in my lab.

Since the SPI signals look very clean on my oscope (no reflection that I can see), my intention was mainly to surpress external noise effects, which apparently it did. My reading regarding termination would have put the resistors at around 270 to 330 ohms, but I didn't want that much current if I can help it.

In reading about SPI in particular, most opinions were that no termination is necessary at all given a short enough transmission line. 11 inches is considered quite short at 10 MHz and it ran fine with no termination - as long as I didn't turn that flourescent lamp off. Also, the SPI articles I read did not mention using termination at both ends (as is the case for a bus like DEC's Unibus - but this is an open collector bus). I did think that was odd, but went with a terminator at the receiving end only (as was described in several articles). I looked at the schematic for the Spartan-3E Starter Board (FPGA) SPI circuit which is spec'd to run at 50 MHz and has 100 ohm termination resistors to both rails at one end only. Works quite well.

There are many factors to consider with transmission lines, length being one of them. I do understand the theory, and surely a best effort terminator may well be at both ends and a much lower resistance, especially for a more significant length of wire - however, what I did works.

As always, your particular milage may vary. If you play with this stuff, you may indeed need heavier termination than I used._________________FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.Fruit flies when you're having fun.BTW, Do these genes make my ass look fat?corruptio optimi pessima

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum

Please support our site. If you click through and buy from our affiliate partners, we earn a small commission.