[sdiy] PIC help

Tom Wiltshire tom at electricdruid.net
Mon Jun 8 11:45:22 CEST 2009


Hi Scott,

> 1. What programmer/debugger do you use or recommend? I don't want  
> to build one, or get some third party box. I've narrowed the  
> choices down to either the PICkit 3 ($70) or MPLAB ICD3 ($220) and  
> am wondering if there's any significant advantage to the ICD3 that  
> makes it worth being 3X as much as the PICkit 3.

I'm using a far-eastern clone of the ICD2. It cost $40 and does the  
job. I don't know about ICD3, but $220 sounds like a lot for a  
programmer. Does it make tea?

> 2. How do you decide which PIC chip to use? I know some of you are  
> using the dsPIC33FJ128GPxxx series (Tom, Seb, Eric) and I'm more  
> than happy to follow your lead, but it might be overkill for my  
> needs. But they aren't too expensive, should I just go with the  
> flow and use the latest and greatest chips?

The dsPICs are definitely easier to use. For me, this is mostly due  
to having more flexible addressing modes in the assembly language.  
That said, I still use 8-bit PICs for certain jobs. I'd have thought  
that 33F *is* overkill from what you describe. You could probably  
manage fine with a 40-pin PIC like a 16F77 (have I got that right?).
I've moved towards 33F because I've been trying to do audio  
generation with it, and for that you need as high a sample rate as  
you can manage and as many clock cycles as you can manage, and a pile  
of RAM would be nice too. Hence I finish up using the "latest and  
greatest chips" as you put it. Remembering the positions of a  
panelful of knobs is a *much* slower application and doesn't need so  
much power. For example, if you updated the positions at 100Hz, you'd  
be far ahead of any human, even a dedicated knobtwiddler. And that  
gives you 10mS between writes, an enormous amount of time.

> 3. Some of the dsPIC chips have a built-in 16-bit DAC but it  
> appears to be best suited for two channels of audio, not for 24  
> channels of control voltages. Would I be better off using an  
> external DAC to get 24 analogue outs and avoid the internal DAC?

Yes. Eric's comments are pertinent. I've used the built-in DACs for  
envelopes and LFOs, so they can do CVs, but I've never tried  
generating (say) a pitch voltage from one. That'd be a real tester.

> 4. If using an external DAC, is there any advantage to using one  
> DAC with lots of multiplexing to get 24 outputs vs. using several 8- 
> channel DACs (e.g. TLV5610)?

DAC+multiplexing is cheaper. 8-channel DACs will be simpler but more  
expensive. You could try some middle-ground compromise. One project I  
have on paper uses a dual channel DAC (a cheap 12-bit MPC4922) fed to  
a '4052 to generate 8 CVs. You could use three of those, and that way  
each CV is refreshed more often.

> 5. It seems that dsPIC chips don't have enough built-in EEPROM to  
> store all the info I want for the presets. Is it best to avoid  
> trying to max out the internal EEPROM and use an external EEPROM?  
> (I see that Seb has hooked up an EEPROM to his Digi-Mod.)

External EEPROM is cheap and hooks up easily via SPI. Microchip have  
lots on their website.

> 6. What do you recommend for an LCD display (2x40 character or  
> less) that would be simple to hook up to a PIC? Do these things  
> have some kind of common interface (SPI)?

Eric is spot on with this too. Most LCDs use a hitachi-compatible  
interface that can be operated in either 4-bit or 8-bit mode. The 4- 
bit mode uses 4 data lines plus some control signals to give you the  
7 lines Eric mentioned. 8-bit mode uses 11 lines, but runs quicker  
since you don't need to split bytes. For your application, speed  
isn't too much of an issue, so save the lines.

For LCDs, I just keep an eye open for a good offer. The "retail"  
price is quite high, but you often see them for a lot less, so grab  
one when you see a cheap one.

Regards,
Tom







More information about the Synth-diy mailing list