4
\$\begingroup\$

So I'm probably going to buy a dsPIC33F to build a synth with.

I've used Atmel micros in the past, but this will be my first PIC chip, I wanted to know if there's anything in particular I need or will have to look out for?

I'll need to be able to program the chip using my laptop which has USB and is running a Linux based operating system (Ubuntu).

Thanks.

Edit: (To clarify my question)-

I will be using the dsPIC33F from Microchip Technology Inc I want to use it for real time audio synthesis, probably additive synthesis using wave table generated sine waves, much like the application discussed in this question on the electronics.stckexchange. I have a crummy old Dell laptop with which to program the dsPIC33F chip with, it has USB 2.0 ports on it, and that's about it. I run a Linux system (Ubuntu 10.10 Maverick Meerkat to be specific), what software / hardware will I require to program the dsPIC33F chip using the afore mentioned computer system??

\$\endgroup\$
  • 1
    \$\begingroup\$ +1 to this. It looks for me that 16-bit PICs have a greatest user base. And dsPIC are more convenient software wise. I wonder what people think \$\endgroup\$ – user924 Jul 8 '11 at 15:51
  • 1
    \$\begingroup\$ I use a Pickit2 clone programmer with the pk2cmd program in Linux. I use it with pic16 and pic18, but it appears it should work with dsPIC33 \$\endgroup\$ – Majenko Jul 8 '11 at 16:02
  • \$\begingroup\$ Try the Microchip forums: microchip.com/forums/Default.aspx? \$\endgroup\$ – Leon Heller Jul 8 '11 at 16:06
  • \$\begingroup\$ These are a bargain at twice the price. microchip.com/stellent/… \$\endgroup\$ – kenny Jul 8 '11 at 19:46
  • \$\begingroup\$ @Kenny - Great, that looks like a nice easy package to start programming, I may just go down that route \$\endgroup\$ – Jim Jul 9 '11 at 8:41
2
\$\begingroup\$

Working with PIC chips in Linux is both a daunting and a surprisingly easy task at the same time.

First you need to get yourself a PIC programmer. The one I got was a clone of the PicKit2 off ebay for only a few pounds. There are many others around. The PicKit3 is probably a better option that the PicKit2, but I have had good results with mine so far.

Secondly there is the software. For the actual programming of the PIC, you will need software suitable for the programmer you get. For my PicKit2 I use the Linux command-line utility pk2cmd downloadable from Microchip. At first, when I started using it, I was very very lost about what the command line options were - the documentation is rather poor. But, after some digging I worked out the following command line that I always use:

$ sudo pk2cmd -p -m -r -f file.hex

That auto-detects the chip you are using (-p), programs all the memory (-m), resets the PIC after programming so it runs (-r) and uses the file /path/to/hex/file (-f ...)

Another useful one is:

$ sudo pk2cmd -p -i

Which tells you about what PIC it has detected.

Now, I ran up against a problem with pk2cmd recently - it doesn't support the very newest PIC chips (in particular the PIC18F46K22 I was trying to use). However, there is another version somewhere on the Internet (I can't remember where right now) which has been modified to support the very latest versions of chips. You may or may not need that depending on which PIC you go for.

Then there is the programming of the firmware itself. Microchip have very thoughtfully ported their MPLAB-X IDE to Linux, so you can get all the software you need for the programming here. It's still in beta at the moment, so expect a few bugs, but you can get the IDE, and all the C implementations you like there. The on-line documentation inside the IDE is pretty good, but you will need the data sheet for your chosen PIC at hand.

While there are other IDEs available, this is the one I have had best results with (i.e., it's the only one I have actually had working under Ubuntu).

PS. I have community wiki'd this answer so people can build on it.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Nice one Matt - just what I'm looking for, will have to check out the PIC kit programmers \$\endgroup\$ – Jim Jul 9 '11 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.