Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

dsPIC

Status
Not open for further replies.

YAN-1

New Member
Hello everyone. It's been a while!

I was just wondering regarding the dsPIC family (the dsPIC30F2010 in particular). I've been working for a while on the 16F family and I'm trying to understand the different things that the dsPIC family provides. From what I got from a quick look at the datasheet is that it is basically a normal PIC with standard operation but it has some extra modules (like the motor control PWM, quadrature encoder module,...) and the DSP engine. The DSP engine is responsible for carrying out mathematical operations effectilvely and much faster than normal. So if I want to calculate:
z = x * y;
where x = 12.2456 and y = -63.149, it will be much easier and faster and I just have to type that line and the PIC will recognize it as a mathematical operation and use the DSP engine automatically to solve it. Is that correct? And as for the operating frequencies of the dsPIC famliy, they are close to the normal PICs in general, the difference being the use of the very fast DSP engine for mathematical operations?

Your guidance and comments would be much appreciated. Thanks a lot.

Nichola V. Abdo
 
PIC16 and PIC18 are 8-bit cores. To add two 16-bit numbers together requires several operations.
dsPIC30 and dsPIC33 are 16 bit cores. All data is handled as 16 bit ops.
dsPIC30/33 has a number of extra DSP instructions that PIC16/18 does not. Additionally it has improved addressing modes in the instruction set and it has improved hardware modules.

If you are writing C, the code does not really look different. If you multiply two floats as you propose, you will write the same code in C, but the C30 compiler will probably create very different assembly code than the C18 compiler.

Many of the DSP instructions cannot be accessed effectively from C. For example, there's no mathematical operators defined that would do these operations so it would be unclear when the compiler could use the DSP instruction in its implementation. Thus many of these DSP instructions are often used by a library function written in assembly but can be called from C or assembly. Like you collect 80 samples from the ADC in C and then call this function that will return the Fourier Transform of it. That function's going to be written in assembly to make skillful use of the available DSP instructions.
 
One of the most useful and convenient features of the dsPIC30F, 33F and PIC24 are the unique interrupt vectors for each interrupt source. If you are running a lot of periperals with interrupts, this eliminates the need to poll all of the interrupt flags to determine which interrupt occured. It reduces the amount of ISR overhead considerably in larger projects.

Besides working on twice as much data per instruction cycle (16-bit vs. 8-bit), the dsPIC and PIC24 are considerably faster instruction clock wise. 16F devices typically max out at 5 MIPS and 18F devices max out at 10 MIPS (12 MIPS for USB parts) but the dsPIC30F runs at 30 MIPS and the dsPIC33F and PIC24 run at 40 MIPS. I haven't had the chance to overclock a dsPIC33F yet but I have been able to run a dsPIC30F at 50MIPS with no issues other than heat (heatsinking is required at that speed).

Overall the dsPIC is a fantastic part. You will need at least an ICD-2 to work with them though.
 
I'm getting to really dig the 33F's DMA controller. Instead of using an ISR to work with one word off the SPI module's tx/rx registers, you can set it up so the SPI module just takes off writing into DMA space without having to use an interrupt. Much more efficient for peripherals which receive words frequently!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top