This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

dsplib,6727

Hi,

I am developing a product using dsplib, but I am having some trouble I can't seem to locate.

Example:

First, I used the C code in the src library to write and test the biquad.

This works fine.

Then I load the dsplib library in the .cmd file and use that function and the same code blows up. It will output something- certainly not what is expected, square waves, noise- then the dmax stops working. looks like a stack problem.

I have the proper header included for the function,

I am calling it as in the reference libraries example,

I am using bios so rts67plus is loaded

I am dis-abling the interrupts before the routines and re-enabling them afterwards using the compiler intrinsics

I can see the proper routine in the map file

nonetheless, the library fails while the C version shown the dsplib pdf never does.

Any thoughts?

Thanks,

Don 

  • Don,

    What specific function are you testing and having problems with?

    If the C function works and the DSPLIB asm function does not work, it is usually because:

    1) You are not passing the parameters as the documentation specifies (alignment, sizes, etc)

    2) It could be a problem with the asm function.

     

  • I think we may have a documentation issue with the DSPF_sp_biquad function.  Is that the one you're using?

    The source code that ships with dsplib has these notes in the DSPF_sp_biquad.asm file:

    *   ASSUMPTIONS                                                                 *
    *       nx is a multiple of 3                                                   *
    *       Source and destination arrays do not overlap.                           *

    It also has this note:

    *    Unrolling the loop thrice implies that the order of the filter has been    *
    *    increased by 2. This is because the output at time instant 'n' is          *
    *    dependent on the outputs at instants 'n-3' and 'n-4'. This is              *
    *    mathemetically equivalent to multiplying the transfer function's numerator *
    *    and denominator by (1 + k1 * z^-1) (1 + k2 * z^-1), where k1 and k2 are    *
    *    'a1' and (a2-a1*a1)/a1 respectively. Hence 2 new poles are introduced, one *
    *    at -a1 and the other at -(a2-a1*a1)/a1.Thus, use of this function requires *
    *    that modulii of a1 and (a2-a1*a1)/a1 be less than 1.

    You should make your arrays double-word aligned too.

    Brad

  • indeed, it is the X3 that bit me. And I have no excuses, I read that wrote it down and then forgot.

    But it is now working.

    Thanks,

    Don