SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By silic0re
thanks! i tried to make this board look really clean and yet still have some "cool" factor. :) (i do have a picture of the underside of the board here: ... _small.jpg , although it is a little blurry. I tried to keep all the wiring pretty clean on the underside, but there are a few pretty long wirewrap jumpers on there.).

it seems we've actually had the same idea -- my plan was, once I have a good working piece of software and understanding of how to code for the cluster, to get some modular PCB's that use surface mount versions of the dsPIC made up. I was trying to think of what shape to make them -- the cube idea with right angled headers had come to mind as well, and then putting a plug on one side of the cube to interface it with some main board.

I was actually thinking that if I get fancy I might be able to include two interfaces on each little 'PIC cluster cube' -- one that just brings out the straight I2C connected to each of the dsPICs, and another that uses one of the dsPICs on each cube as a 'router'. The 'router' for each cube would be connected to the host, and maybe to the other routers as well, to make a more complex (and potentially more efficient) communications topology. That might speed up interprocessor communications quite a bit, while keeping the simple I2C interface behind the router of a given cube just to interface with 4-10 dsPICs.

i definitely agree though, a huge cluster of PICs in a modular design would certainly be way cool! :) of course there would have to be blinky lights on each cube... :)
By saipan59
...And I think that after you make "the cube", you should mount it inside a large transparent sphere, with the cube supported in the middle by the wires that go radially in all directions. And some of the 'wires' should be those colored light-tube things, so that you can 'see' data moving in and out of the 'brain', which will of course soon take over the world because its smarter than we are, and knows that humans are like a virus that must be terminated...

By saipan59
Here's pix of the boards I made recently, which are designed to 'stack' on each other without the need for any cables.
Each set of 3 boards was a single 'mini-board' from ExpressPCB, then I cut them apart by hand with a jeweler's saw.
One board has a PIC18F2620 on it, the other 2 boards are 'peripherals'.

By daveg
Nice project, I think this is going to turn into something very nice.
I have been thinking of building a cluster of pics for some time now, but unfortunately have never come up with a practical application other than blinkenlights ;-)

I have an idea about how to program the pics tha i have not read about here.
If I'm correct, the flash program memory is writable from within the pic. How about programming all the pics with a bootloader. That way you just have to program the pics once in a programmer and then stick em on the board. You can distribute the new program to each pic via the i2c network. The boatloader in the pics then programs the flash program memory. do a reset and you're good to go.
By silic0re
hi dave,
i definitely had the same thought -- it would be ideal to build an i2c bootloader into the cluster software such that it could be updated easily and without the use of an ICSD.

i've had a lot of responses from people who'd love to see schematics and open source software since this was featured on . to them, i definitely plan on releasing the schematics and sample code as open source, and i think it'd be neat if other people started building these small hobbiest microcontroller clusters. I've even considered building a larger cluster if the performance of the small PIC cluster is actually useful!

By silic0re
A quick update:
I wrote some very inefficient prime finding code (that would take some time to run) for both the dsPIC and my PC. The code would find the first 100 primes after some number (I used 10,000 and 20,000 in the tests).

The dsPIC runtime was about 1 second starting at 10 000, and about 2 seconds when starting from 20 000, on one of the dsPIC30F3012's overclocked using a 24mhz oscillator. The PC version (running on a 2.4ghz processor) ran at least an order of magnitude faster (it took about 10 seconds to find the first 10000 primes after 20 000).
User avatar
By phalanx
silic0re wrote:PC version (running on a 2.4ghz processor) ran at least an order of magnitude faster...
"At least" is a slight understatement!

The dsPIC is around 30MIPS and is considerably slower with floating point math.

A 2.4GHz Core2 Duo runs at about 22,000MIPS on much larger chunks of data. It can also process floating point numbers natively at about 15GFLOPS! That's smokin'! :shock:
By silic0re
There isn't any floating point involved in my algorithm, just a modulo, so the dsPIC is running pretty speedy. When I get into algorithms that require floating point, then "several orders of magnitude faster" will easily apply.

I think that part of some people's thoughts about the PIC cluster come from the fact that it can essentially solve general purpose problems, but in that class even a light-weight PC would probably solve most problems you can think of much faster. The really interesting question isn't so much how much faster a PC is in general, but rather (at least to me), what sorts of problems can the PIC cluster solve particularly well?

(even the first connection machine didn't have any floating point units :) )

That being said, it's also just a cool project. There's something neat about building your own cluster of microcontrollers and getting them to solve problems, regardless of if it's 10 times slower than your desktop.