Function Descriptions
Alignment Requirements:
The delay and coefficients buffer must be aligned to a minimum of 2 x (order + 1) words. For
example, if the filter order is 31, it will have 32 taps or coefficients each a 32-bit floating point
value. A minimum of (2 * 32) = 64 words will need to be allocated for the delay and coefficients
buffer.
To align the buffer, use the DATA_SECTION pragma to assign the buffer to a code section
and then align the buffer to the proper offset in the linker command file. In this code example
the buffer is assigned to the firldb section while the coefficients are assigned to the coefffilt
section.
#define FIR_ORDER 31
#pragma DATA_SECTION(dbuffer, "firldb")
float dbuffer[FIR_ORDER+1];
#pragma DATA_SECTION(coeff, "coefffilt");
float const coeff[FIR_ORDER+1]= FIR_FP_LPF32;
In the project’s linker command file, the firldb section is then aligned to a value greater or equal
to the minimum required as shown below:
firldb ALIGN(0x100) > RAML0 PAGE = 0
coefffilt ALIGN(0x100) > RAML2 PAGE = 0
Notes:
1. All buffers and stack are placed in internal memory (zero-wait states in data space).
Sep 10, 2012 47