[sdiy] dsPIC Stuff
Scott Gravenhorst
music.maker at gte.net
Mon Nov 12 06:07:37 CET 2012
Oh wow, thanks!
The thing that "struck" me while doing this after working with FPGAs (and doing
Karplus-Strong there too) was that I looked for ways to use the dsPIC's parallelism wherever
I could. The approaches to both for me are generally the same in terms of how the state
machine works, but different mental gymnastics. I mean, the same math and logic has to be
done in both cases. I have to say that I felt more constrained by the dsPIC. With an FPGA I
usually had the option to create more parallel mechanisms where in the dsPIC I had to use
what was there and then be clever with the instruction set. The dsPIC MAC instruction is
quite powerful. Using the dsPIC's DMA is essential to getting the most out of it IMO.
Looking at how it's built, the DMA controller channels are like pico-processors, they do
stuff all by themselves without necessarily being prodded into doing them by CPU action. No
cycle stealing happens with DMA thanks to some dual ported RAM inside the dsPIC. Some real
multiprocessing going on in there. I found the free tools to be quite useful, but some
things didn't want to work for me. Debugging didn't work for me when I ran it at 40 MIPS.
Slower speeds were fine (i.e., speeds that do not use the dual speed mode worked fine with
the debugger). Not sure why that happened, but at one point I shrugged and gave up on using
the debug mode (single step etc). I wound up using my normal LED method to do some of the
troubleshooting and I used a UART to dump hex data to a terminal session on a PC for the rest.
Oh BTW, the LEDs are fun to watch on the synth when it's playing. Each voice engine has a
"pluck" LED the flashes each time a string is plucked on that engine. The MIDI controller
has a LED the flashes for each SPI message it sends. (simple things are so much fun...)
Eric Brombaugh <ebrombaugh1 at cox.net> wrote:
>Scott,
>
>Great stuff - you're doing amazing things with the dsPIC. The KP
>model you've built is very musical and the pieces you've written
>show it off very nicely.
>
>I'm curious - you started out working with FPGAs for implementing
>your synthesis projects. How would you contrast that approach
>with the dsPIC you've been using lately? I found that coding on a
>DSP MCU was a bit more immediate. The development tools were
>somewhat easier to use and I spent less time thinking about bits
>and circuits and more time thinking about higher-level ideas.
>
>Thanks for the demos,
>
>Eric
>
>On Nov 11, 2012, at 7:08 PM, Scott Gravenhorst wrote:
>
>>
>> My Brain Is An Electron:
>> http://electro-music.com/forum/download.php?id=32641
>>
>> Sometimes I Repeat Myself:
>> http://electro-music.com/forum/download.php?id=32653
>>
>> These two pieces were done using an 8 voice polysynth implemented on dsPICs
>> (a big thank you goes out to Tom Wiltshire for his help).
>>
>> The "Harpie" instrument consists of 3 dsPIC33F ICs, one serves as a MIDI
>> controller and voice assigner which communicates via a one way SPI channel
>> to the other two "voice engines". Each voice engine manifests 4
>> Karplus-Strong string models. The Karplus-Strong model parameters for
>> reflection filter Fc and linear damping are controlled by pots feeding ADC
>> input pins.
>>
>> The second piece was done by recording the same MIDI sequence twice - one
>> time an octave higher than the other and using Audacity, the two recordings
>> were offset some small number of milliseconds in time and then mixed into a
>> stereo track.
>>
>> The synthesizer is built on 2 stripboards and all 3 dsPICs run at 40 MIPS
>> with a 20 MHz xtal.
>>
>> -- ScottG
>> ________________________________________________________________________
>> -- Scott Gravenhorst
>> -- FPGA MIDI Synth Info: jovianpyx.dyndns.org:8080/public/FPGA_synth/
>> -- FatMan Mods Etc.: jovianpyx.dyndns.org:8080/public/fatman/
>> -- Some Random Electronics Bits: jovianpyx.dyndns.org:8080/public/electronics/
>> -- When the going gets tough, the tough use the command line.
>>
>> _______________________________________________
>> Synth-diy mailing list
>> Synth-diy at dropmix.xs4all.nl
>> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
>
>_______________________________________________
>Synth-diy mailing list
>Synth-diy at dropmix.xs4all.nl
>http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
>
-- ScottG
________________________________________________________________________
-- Scott Gravenhorst
-- FPGA MIDI Synth Info: jovianpyx.dyndns.org:8080/public/FPGA_synth/
-- FatMan Mods Etc.: jovianpyx.dyndns.org:8080/public/fatman/
-- Some Random Electronics Bits: jovianpyx.dyndns.org:8080/public/electronics/
-- When the going gets tough, the tough use the command line.
More information about the Synth-diy
mailing list