View previous topic :: View next topic |
Author |
Message |
SubhamayS
Joined: 07 Mar 2012 Posts: 34 Location: jalpaiguri, India
|
Is it possible to design Digital Filters (FIR) using CCS C ? |
Posted: Mon Feb 26, 2018 9:45 am |
|
|
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... |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Mon Feb 26, 2018 12:29 pm |
|
|
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
|
|
Posted: Mon Feb 26, 2018 2:17 pm |
|
|
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
|
|
Posted: Mon Feb 26, 2018 2:48 pm |
|
|
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
|
|
Posted: Tue Apr 17, 2018 7:03 pm |
|
|
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
|
|
Posted: Wed Apr 18, 2018 12:49 am |
|
|
Look at EX_FIR.C and FIR.C include file. |
|
|
dmendesf
Joined: 31 Dec 2005 Posts: 32
|
|
Posted: Wed Apr 18, 2018 7:28 am |
|
|
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
|
|
Posted: Wed Apr 18, 2018 7:48 am |
|
|
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
|
|
Posted: Wed Apr 18, 2018 7:49 am |
|
|
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.... |
|
|
|