Sonsivri

Electronics => Pic C Languages => Topic started by: biomed12 on October 17, 2016, 01:46:07 13:46



Title: [SOLVED] About .s File -C30/XC16
Post by: biomed12 on October 17, 2016, 01:46:07 13:46
Hello Dear Members,

I am observing dsPIC digital filter examples to implement a digital band pass filter. I saw some .s files that are produced by dsPIC Digital Filter Design software.

Firstly, I attached some codes. I could not understand the syntax. What is the mission of .hword function?
Secondly, Is there anyone who can share with me the dsPIC Digital Filter Design Software or recommend me a similar software which produce .s files for my design.

Thanks.

EDIT: After a few weeks later, I designed a FIR filter succesfully using dsPIC and it works perfectly in the simulation. I will try the hardware implementation and i will share complete projects in the Electronics->Projects section.


Title: Re: [HELP] About .s File -C30/XC16
Post by: baybay on October 17, 2016, 02:30:11 14:30
.hword defines 16-bit number (little-endian)

please refer to page 69

http://ww1.microchip.com/downloads/en/DeviceDoc/50002106C.pdf




Title: Re: [HELP] About .s File -C30/XC16
Post by: Gallymimu on October 17, 2016, 03:10:34 15:10
the .hword are your filter taps.  If you don't know what filter taps are you need to read about DSP for a bit.  The filter taps are you coefficients of you FIR or IIR filter design.

The coefficients get reserved in xdata space (DSP functions need to be utilizing combinations of xdata and ydata space to get the speed out of the special DSP assembly functions.)

you could also reserve your coefficient space in C like with the keyword CONST (but you still have to use the compiler specific keywords to get the variable reserved in the right xdata space)

you don't actually need the filter designer.  There are plenty of free ways to do it:

http://t-filter.engineerjs.com/

but you do need to understand DSP and dspic assembly so you can build it correctly.

Start with simple stuff like echo filters and reverb filters so you can figure it out more easily.


Title: Re: [HELP] About .s File -C30/XC16
Post by: biomed12 on October 17, 2016, 05:12:26 17:12
the .hword are your filter taps.  If you don't know what filter taps are you need to read about DSP for a bit.  The filter taps are you coefficients of you FIR or IIR filter design.

The coefficients get reserved in xdata space (DSP functions need to be utilizing combinations of xdata and ydata space to get the speed out of the special DSP assembly functions.)

you could also reserve your coefficient space in C like with the keyword CONST (but you still have to use the compiler specific keywords to get the variable reserved in the right xdata space)

you don't actually need the filter designer.  There are plenty of free ways to do it:

http://t-filter.engineerjs.com/

but you do need to understand DSP and dspic assembly so you can build it correctly.

Start with simple stuff like echo filters and reverb filters so you can figure it out more easily.

Dear Gallymimu,

Could you recommend a good ebook to me to understand DSPs? I have read some book's part but, I think i have not understood the concept of DSP. Maybe books I have read are old.

Thanks.


Title: Re: [HELP] About .s File -C30/XC16
Post by: Gallymimu on October 18, 2016, 06:49:50 06:49
Dear Gallymimu,

Could you recommend a good ebook to me to understand DSPs? I have read some book's part but, I think i have not understood the concept of DSP. Maybe books I have read are old.

Thanks.

before I try to answer that.  Do you already have background in classical control systems (analog filter, analog controls, s-domain, poles and zeroes?)

Those items are prerequisites to DSP and digital control systems.

you can try this:  http://www.analog.com/en/education/education-library/scientist_engineers_guide.html

it covers a lot of the basics and some details.