Migration to dsPIC30F

Programmer, In-Circuit Debugger, PIC Start-Up Kit, Memory Interface...

Migration to dsPIC30F

Postby aurora » Sun Jun 26, 2011 5:16 pm

Hi guys,

Been a while since I last check here, and there is dsPIC30F! Anyone try SKDS40A already? How is it? What was the reason you upgrade from PIC18F to dsPIC30F?

I'm attracted with the raw computing power, looks pretty good.
aurora
Discoverer
 
Posts: 126
Joined: Sun Jun 07, 2009 4:52 pm

Re: Migration to dsPIC30F

Postby Brian Griffin » Sun Jun 26, 2011 6:13 pm

aurora WROTE:Hi guys,

Been a while since I last check here, and there is dsPIC30F! Anyone try SKDS40A already? How is it? What was the reason you upgrade from PIC18F to dsPIC30F?

I'm attracted with the raw computing power, looks pretty good.


I have it right in front of me, on the workstation.

It is a better upgrade from the PIC18F if you ever need a lot of computing power, like single-cycle multiply. However, the divide is 16-cycle per instruction, so be a bit careful if you ever use divides.

The reason is simple, I'm using it for making musical applications on the smaller dsPICs. Not the square waves beep beep kinda thing, it's more on sound reproductions.

If you need more, try the PIC32 - I have the chipKIT Uno32 from Microchip which is Arduino-compatible. Their divides and multiplies are much simpler and easier to handle.

And don't forget : Barrell shifter. No matter how many shifts on the number, it's still single cycle (unless you stack the variables and you carry forward them!)
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Re: Migration to dsPIC30F

Postby robosang » Sun Jun 26, 2011 8:07 pm

Woh... Brian, you uses chipkit 32 already? How is the IDE and library? Nice!?

I never uses dsPIC nor PIC32, but been seeing some projects use those MCU. I think the Robot magazine from Cytron just share about SKds40, one of their project sharing is using dsPIC30F to be spectrum analyzer, not really gone through in details. You can download their magazine and take a look. I think the title is My 1st dsPIC project. :)
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: Migration to dsPIC30F

Postby Brian Griffin » Sun Jun 26, 2011 9:09 pm

robosang WROTE:Woh... Brian, you uses chipkit 32 already? How is the IDE and library? Nice!?

I never uses dsPIC nor PIC32, but been seeing some projects use those MCU. I think the Robot magazine from Cytron just share about SKds40, one of their project sharing is using dsPIC30F to be spectrum analyzer, not really gone through in details. You can download their magazine and take a look. I think the title is My 1st dsPIC project. :)


The chipkit has a modified Arduino IDE by Digilent Group. The PIC32 uses a different architecture, the MIPS and the same architecture/method used in Nintendo 64 and Playstation 2 and the PSP.

Unfortunately due to my busy schedule, I didn't get to play much with the PIC32. But I believe that there are so much potentials inside the processor itself.
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Re: Migration to dsPIC30F

Postby aurora » Mon Jun 27, 2011 12:30 am

18F can do single-cycle multiplication, but only 8 x 8 bit. Division 16-cycle per instruction, as in 1 division query? This is nice. :)

Sound reproduction kind of hard. You need to do a lot raw computation as well? I'm using it for robotic, need to do a lot of multiplication, division, square root, trigo, etc. Any more useful tips? :lol:
aurora
Discoverer
 
Posts: 126
Joined: Sun Jun 07, 2009 4:52 pm

Re: Migration to dsPIC30F

Postby Brian Griffin » Mon Jun 27, 2011 8:28 am

aurora WROTE:18F can do single-cycle multiplication, but only 8 x 8 bit. Division 16-cycle per instruction, as in 1 division query? This is nice. :)

Sound reproduction kind of hard. You need to do a lot raw computation as well? I'm using it for robotic, need to do a lot of multiplication, division, square root, trigo, etc. Any more useful tips? :lol:


Yes. 16-cycle per instruction for divide. Quite a little bit heavy on that, but that is the limitation of that dsPIC.

Sound reproduction is always difficult - there are many books and research papers about them. Right now I'm developing a multi-channel DDS for making a better quality music box.

For square root and trigo you can use CORDIC (Coordinate Rotation Digital Computer) algorithm. I haven't wrote that kind of thing yet but it's pretty effective and much used in earlier scientific calculators to calculate trigonometric functions.
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Re: Migration to dsPIC30F

Postby aurora » Mon Jun 27, 2011 8:22 pm

Found a link for CORDIC here. I read about CORDIC before and later abandon it. Can't remember why, I think not efficient for PIC (or too difficult). In the end I settle with lookup table, take up a lot of memory. Got to try that again.

I'm using a similar bit-shift method for division and square root, more efficient than C, but way more than 16 cycles.
aurora
Discoverer
 
Posts: 126
Joined: Sun Jun 07, 2009 4:52 pm

Re: Migration to dsPIC30F

Postby Brian Griffin » Mon Jun 27, 2011 9:14 pm

aurora WROTE:Found a link for CORDIC [url=here]http://en.wikipedia.org/wiki/CORDIC[/url]. I read about CORDIC before and later abandon it. Can't remember why, I think not efficient for PIC (or too difficult). In the end I settle with lookup table, take up a lot of memory. Got to try that again.

I'm using a similar bit-shift method for division and square root, more efficient than C, but way more than 16 cycles.


Cordic can be pretty tough. I tried just for one sine(x) and then abandoned the idea of doing it altogether, on pencil and paper. The method can be very effective for microcontrollers which have space constraints, but it can be very tedious to write it in ASM or C.

Even earlier Pentium processors (and maybe all the other processors) have lookup tables inside them. The algorithm of lookup tables may sound lazy, but it did a lot of pretty good stuff in the universe.
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Re: Migration to dsPIC30F

Postby aurora » Fri Jul 01, 2011 11:01 pm

Just received my SKDS40A and dspic30, I expect the learning curve wont be as easy, going to take some time before I transfer my code to 16-bit.

I need accuracy up to 4 decimal point for my asin function. CORDIC is for sin, not for asin, hence the look up table.

The code space for dspic is larger, how long does it take to download your code?
aurora
Discoverer
 
Posts: 126
Joined: Sun Jun 07, 2009 4:52 pm

Re: Migration to dsPIC30F

Postby Brian Griffin » Sat Jul 02, 2011 12:14 am

aurora WROTE:Just received my SKDS40A and dspic30, I expect the learning curve wont be as easy, going to take some time before I transfer my code to 16-bit.

I need accuracy up to 4 decimal point for my asin function. CORDIC is for sin, not for asin, hence the look up table.

The code space for dspic is larger, how long does it take to download your code?


Downloading the code doesn't take as much time, it's equally fast as the other PICs.

Unfortunately, dsPIC hasn't got any floating points operation engine. You need to either use a fixed point system to manipulate the numbers.

ASM on dSPIC is easier - there are new operations such as repeat and stuff. However, array manipulations using ASM can be very tricky.
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Next

Return to PIC Development Tool

Who is online

Users browsing this forum: No registered users and 14 guests