User`s guide
Preventing Memory Corruption When You Export C oefficients to Processor Memory
Caution Identify changes that require additional memory to store the
coefficients before you begin your export. Otherwise, exporting the new filter
coefficients may overwrite data in memory locations you did not allocate for
storing coefficients. Also, exporting filter coefficients to memory after you
change the filter order, structure, design algorithm, or data type can yield
unexpected res ults and corrupt memory.
Changing the filter design algorithm in FDATool, such as changing from
Butterworth to Max im ally Flat, often changes the number of filter coefficients
(the filter order), the number of sections, or both. Also, the coefficients from
the new design algorithm may not perform properly with your source code
filter implementation.
If you change the design algorithm, verify that your filter structure and
length are the same after y ou redesign your filter, and that the coefficients
will perform properly w ith t he filter you implemented.
If you change the number of sections or the filter order, your fi lter will not
perform properly unless your filter algorithm implementation accommodates
the changes.
Example: Changing Filter Coefficients Stored on Your
Processor
This example writes filter co ef ficients to processor memory to replace the
existing coefficients. To perform this process, you need the names of the
variables in which your project stores the filter d ata.
Before you exp ort coefficients directly to memory, verify that your project
allocated enough m emo ry f or the new filter coefficients. If y our project
allocated eno ug h memory, you can modi fy your filte r in FDAT ool and then
follow the steps in this exampletoexporttheupdatedfilter coefficients to
the allocated memory.
If your new filter requires additional memory space, use a C header file to
allocate mem ory on the processor and export the new coefficients as described
in “Exporting Filter Coefficients to Your Code Composer Studio Proje ct” on
page 5-9.
5-17