CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Is it possible to design Digital Filters (FIR) using CCS C ?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
SubhamayS



Joined: 07 Mar 2012
Posts: 34
Location: jalpaiguri, India

View user's profile Send private message

Is it possible to design Digital Filters (FIR) using CCS C ?
PostPosted: Mon Feb 26, 2018 9:45 am     Reply with quote

I am trying to design digital filters using dsPIC30F/dsPIC33F.

I am referring to the manual provided by microchip http://ww1.microchip.com/downloads/en/DeviceDoc/SW300001%20manual.pdf

Please let me know if it is possible to design FIR / IIR filters using CCS C compiler. I am not able to find any such examples related to this area.

I am using pcwhdupd(CCS 5.015).

please suggest your views on this.

thanks in advance... Smile
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Mon Feb 26, 2018 12:29 pm     Reply with quote

You don't design the filters with the PIC. The MicroChip note gives you a link to their tool to generate the filter coefficients on a PC. You then just use these in the code you run on the PIC. There are FFT and FIR filter implementations supplied in the examples with the compilers. Even though yours is old they should be there.
temtronic



Joined: 01 Jul 2010
Posts: 9240
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Feb 26, 2018 2:17 pm     Reply with quote

just a note... that Microchip did have an application note about FFT design using 16/17 series PICs, 20-25 years ago. Yes, it's in assembler BUT the 'math' should be similar or perhaps useful as a basis to cut code in CCS C.
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Mon Feb 26, 2018 2:48 pm     Reply with quote

For software FFT like this, there have been several threads in the past here. For example:
<http://www.ccsinfo.com/forum/viewtopic.php?t=54587&highlight=fft>

The question here is about using the more powerful features of the DsPIC. CCS do now supply code for this, and it does work, so this has to be the best place to start.
dmendesf



Joined: 31 Dec 2005
Posts: 32

View user's profile Send private message

PostPosted: Tue Apr 17, 2018 7:03 pm     Reply with quote

Ttelmah, where you saw support for the DSP features of dspics? This is a long missing feature for me. One that Mikroc implements very well...

Daniel

Ttelmah wrote:
For software FFT like this, there have been several threads in the past here. For example:
<http://www.ccsinfo.com/forum/viewtopic.php?t=54587&highlight=fft>

The question here is about using the more powerful features of the DsPIC. CCS do now supply code for this, and it does work, so this has to be the best place to start.
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Wed Apr 18, 2018 12:49 am     Reply with quote

Look at EX_FIR.C and FIR.C include file.
dmendesf



Joined: 31 Dec 2005
Posts: 32

View user's profile Send private message

PostPosted: Wed Apr 18, 2018 7:28 am     Reply with quote

Thanks for the pointers. Still a very crude implementation using ASM directly, but it´s a start.

Ttelmah wrote:
Look at EX_FIR.C and FIR.C include file.
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Wed Apr 18, 2018 7:48 am     Reply with quote

Everything is ASM. C is just a way of writing ASM more easily. The functions are complete and allow a filter to be setup quite efficiently. The only thing is they haven't 'hidden' the ASM from you, but posted it.
temtronic



Joined: 01 Jul 2010
Posts: 9240
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Apr 18, 2018 7:49 am     Reply with quote

You can also 'cheat' and use the mikeroe website program to create the filter code, then convert into CCS style C.
Also use google to see if anyone else has cut FIR code for dspics....
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group