CE005_FIR_DSP_lib_Filter

所属分类:单片机开发
开发工具:C/C++
文件大小:34KB
下载次数:10
上传日期:2007-10-26 20:37:31
上 传 者joncy
说明:  dsPIC30F Code ——学习PIC单片机(16位)的好资料
(dsPIC30F Code- learning PIC Singlechip (16) a good information)

文件列表:
CE005_FIR_DSP_lib_Filter (0, 2007-03-28)
CE005_FIR_DSP_lib_Filter\design (0, 2007-03-28)
CE005_FIR_DSP_lib_Filter\design\filter (0, 2007-03-28)
CE005_FIR_DSP_lib_Filter\design\filter\bandpassexample.s (3573, 2006-08-08)
CE005_FIR_DSP_lib_Filter\design\filter\bandpassexample_psv.s (3717, 2006-08-08)
CE005_FIR_DSP_lib_Filter\design\filter\FIRBPF.spc (328, 2006-08-08)
CE005_FIR_DSP_lib_Filter\design\filter\FIRLPF.spc (302, 2006-08-08)
CE005_FIR_DSP_lib_Filter\design\filter\lowpassexample.s (3130, 2006-08-08)
CE005_FIR_DSP_lib_Filter\design\filter\lowpassexample_psv.s (3272, 2006-08-08)
CE005_FIR_DSP_lib_Filter\design\input (0, 2007-03-28)
CE005_FIR_DSP_lib_Filter\design\input\input_square1k.fre (336, 2006-08-08)
CE005_FIR_DSP_lib_Filter\design\input\input_square1k.MCH (1536, 2006-08-08)
CE005_FIR_DSP_lib_Filter\design\input\input_square1k.tim (246, 2006-08-08)
CE005_FIR_DSP_lib_Filter\design\output (0, 2007-03-28)
CE005_FIR_DSP_lib_Filter\design\output\BPFoutput.fre (331, 2006-08-08)
CE005_FIR_DSP_lib_Filter\design\output\BPFoutput.MCH (2048, 2006-08-08)
CE005_FIR_DSP_lib_Filter\design\output\BPFoutput.tim (241, 2006-08-08)
CE005_FIR_DSP_lib_Filter\design\output\LPFOutput.fre (331, 2006-08-08)
CE005_FIR_DSP_lib_Filter\design\output\LPFOutput.MCH (2048, 2006-08-08)
CE005_FIR_DSP_lib_Filter\design\output\LPFOutput.tim (241, 2006-08-08)
CE005_FIR_DSP_lib_Filter\FIR_Filter_Example.mcp (905, 2007-03-13)
CE005_FIR_DSP_lib_Filter\FIR_Filter_Example.mcs (3775, 2007-03-13)
CE005_FIR_DSP_lib_Filter\FIR_Filter_Example.mcw (132096, 2007-03-20)
CE005_FIR_DSP_lib_Filter\gld (0, 2007-03-28)
CE005_FIR_DSP_lib_Filter\gld\linkerscript.gld (457, 2006-08-08)
CE005_FIR_DSP_lib_Filter\src (0, 2007-03-28)
CE005_FIR_DSP_lib_Filter\src\bandpassexample.s (4512, 2006-08-08)
CE005_FIR_DSP_lib_Filter\src\bandpassexample_psv.s (4583, 2006-08-08)
CE005_FIR_DSP_lib_Filter\src\FIRExample.c (8278, 2007-03-20)
CE005_FIR_DSP_lib_Filter\src\inputsignal_square1khz.s (6029, 2006-08-08)
CE005_FIR_DSP_lib_Filter\src\lowpassexample.s (4071, 2006-08-08)
CE005_FIR_DSP_lib_Filter\src\lowpassexample_psv.s (4140, 2006-08-08)

Readme File for Code Example: CE005 - Using FIR Filters from dsPIC Filter Design and DSP library ------------------------------------------------------------------- This file contains the following sections: 1. Code Example Description 2. Folder Contents 3. Suggested Development Resources 4. Reconfiguring the project for a different dsPIC30F device 5. Revision History 1. Code Example Description: ---------------------------- Microchip's 16-bit dsPIC Digital Signal Controllers feature a DSP Engine in the CPU that is capable of executing Digital FIR and IIR filters with great efficiency and reliability. The dsPIC Filter Design Software provides a means of generating coefficients for digital filters via an easy to use Graphic User Interface (GUI). The dsPICworks Data Analysis and Design software provides a GUI-based mechanism for generating signals and exporting them in to data files or assembler files. The dsPIC30F DSP library provides functions to perform FIR filtering alongside other DSP functions. In this code example, we demonstrate how these tools can be used to generate signals, design filters and implement these in firmware. This example demonstrates how one can filter a square wave to produce a sine wave signal. For the example, we have used an input square wave of 1 KHz frequency sampled at 20 KHz. This signal was generated by dsPICworks Data Analysis and Design Software. Four (4) filter examples are provided in this project/workspace: 1. Demonstrating how to use the DSP library and the dsPIC Filter Design software to perform a Low Pass Filter when: a. FIR Filter Coefficients are stored in Program Flash Memory b. FIR Filter Coefficients are stored in RAM 2. Demonstrating how to use the DSP library and the dsPIC Filter Design software to perform a Band Pass Filter when: a. FIR Filter Coefficients are stored in Program Flash Memory b. FIR Filter Coefficients are stored in RAM The workspace has been configured for example (1a) above. To reconfigure the project for Bandpass filter, that uses filter coefficients stored in RAM (example (2b) above), perform the following : 1. Remove the lowpassexample_psv.s file 2. Add the bandpassexample.s file into the project 3. Comment out the line of code that defines "LOWPASSFILTER" as follows: // #define LOWPASSFILTER 4. Comment out the line of code that defines the symbol "FILTERCOEFFS_IN_PROGMEM" as follows: // #define FILTERCOEFFS_IN_PROGMEM 5. Re-build the project Use the stopwatch feature in MPLAB SIM to compare the execution time of a filter that uses coefficients stored in program memory versus that of a filter that uses coefficients stored in RAM. You will note that the performace in both cases is comparable. 2. Folder Contents: ------------------- This folder contains the following sub-folders: a. gld This folder contains a linker script file for the example project. This file is used for building the project for a 30F6014A device. This file simply includes the relevant device linker script, "p30F6014A.gld" and the relevant MPLAB C30 library files, "libdsp-coff.a", "libc-coff.a", and "libm-coff.a" or "libdsp-elf.a", "libc-elf.a", and "libm-elf.a" from their installed location. b. h This folder contains C header files useful in building this project. Device register and bit definitions are provided in the "p30F6014A.h" file, which may be found in the installation folder of the MPLAB C30 toolsuite. c. hex This folder contains three file types - coff, hex and map. These are files generated by the MPLAB C30 toolsuite on build operation performed within MPLAB IDE. The *.map file contains details on memory allocation for various variables, constants and dsPIC30F instructions specified in the source and library code. The *.hex file contains a binary file that may be programmed into the dsPIC30F device. The *.coff file contains a binary file that is used by MPLAB IDE for simulation. d. src This folder contains all the C and Assembler source files (*.c, *.s) used in demonstrating the described example. This folder also contains a sub-folder named "obj" that stores compiled object files generated when the project is built. e. design This folder contains files created by dsPIC Filter Design and dsPICworks Data Analysis and Design Software. Input signal files, output signal files and filter specifications have been provided here. 3. Suggested Development Resources: ----------------------------------- a. dsPICDEM 1.1 Development Board (See below) b. dsPIC30F6014A Digital Signal Controller Plug-In Module (See below) 4. Reconfiguring the project for a different dsPIC30F device: ------------------------------------------------------------- The Project/Workspace can be easily reconfigured for any dsPIC30F device. Please use the following general guidelines: a. Change device selection within MPLAB IDE to a dsPIC30F device of your choice by using the following menu option: MPLAB IDE>>Configure>>Select Device b. Provide the correct device linker script and header file for your device. Device linker scripts and header files are available in your MPLAB C30 installation folder under: Device Linker Script- YourDrive:>Program Files\Microchip\MPLAB C30\support\gld Device C Header file- YourDrive:>Program Files\Microchip\MPLAB C30\support\h Device ASM Include file- YourDrive:>Program Files\Microchip\MPLAB C30\support\inc c. Provide the appropriate path to your MPLAB C30 support file locations using the menu option: MPLAB IDE>>Project>>Build Options>>Project d. Chose the development board applicable to your device. Some options are provided below: - dsPICDEM 2 Development Board supports: 30F2010, 30F2011, 30F2012, 30F3010, 30F3011, 30F3012, 30F3013, 30F3014, 30F4011, 30F4012, 30F4013 - dsPICDEM 1.1 Development Board supports: 30F5013, 30F6010, 30F6011, 30F6012, 30F6013, 30F6014, 30F6011A, 30F6012A, 30F6013A, 30F6014A - dsPICDEM MC1 Development Board supports: 30F6010, 30F6010A, 30F5016 e. Re-build the MPLAB project using the menu option: MPLAB IDE>>Project>>Build All f. Download the hex file into the device and run. 5. Revision History : --------------------- 09/30/2005 - Initial Release of the Code Example

近期下载者

相关文件


收藏者