ADC_IIR_Filter
所属分类:其他嵌入式/单片机内容
开发工具:C/C++
文件大小:470KB
下载次数:68
上传日期:2009-03-22 19:27:33
上 传 者:
bdsckj
说明: 一个简单实用的例程,通过PIC33Fxxx单片机实现无限冲击响应IIR数字滤波器的设计
(A simple practical routines, the adoption of single-chip implementation PIC33Fxxx IIR IIR digital filter design)
文件列表:
ADC_IIR_Filter.mcw (141824, 2009-03-07)
ADC_IIR_Filter.mcs (3874, 2009-03-07)
ADC_IIR_Filter.mcp (1187, 2007-03-13)
src\adcDrv1.c (7317, 2007-03-20)
src\adcDrv1.o (267798, 2008-07-31)
src\ExampleHPF.o (894, 2008-07-31)
src\ExampleHPF.s (3631, 2009-03-03)
src\main.c (4916, 2009-03-03)
src\main.o (265377, 2008-07-31)
src\tglPin.o (32132, 2008-07-31)
src\tglPin.s (2927, 2007-03-20)
src\traps.c (5711, 2007-03-20)
src\traps.o (264405, 2008-07-31)
PC Simulation\dsPIC Filter Design\ExampleHPF.h (944, 2006-05-15)
PC Simulation\dsPIC Filter Design\ExampleHPF.s (3093, 2006-05-15)
PC Simulation\dsPIC Filter Design\highpassfilter.flt (4424, 2006-05-15)
PC Simulation\dsPIC Filter Design\highpassfilter.spc (302, 2006-05-15)
PC Simulation\dsPICworks\inputsignal.fre (4430, 2006-05-15)
PC Simulation\dsPICworks\inputsignal.mch (1536, 2006-05-15)
PC Simulation\dsPICworks\inputsignal.s (5978, 2006-05-15)
PC Simulation\dsPICworks\inputsignal.tim (755, 2006-05-15)
PC Simulation\dsPICworks\outputsignal.fre (4431, 2006-05-15)
PC Simulation\dsPICworks\outputsignal.mch (1536, 2006-05-15)
PC Simulation\dsPICworks\outputsignal.s (5980, 2006-05-15)
PC Simulation\dsPICworks\outputsignal.tim (769, 2006-05-15)
PC Simulation\dsPICworks\sine2000.tim (734, 2006-05-15)
PC Simulation\dsPICworks\sine80.tim (732, 2006-05-15)
PC Simulation\screenshots\filter.jpg (252520, 2006-05-15)
PC Simulation\screenshots\input.jpg (76358, 2006-05-15)
PC Simulation\screenshots\output.jpg (220010, 2006-05-15)
PC Simulation\screenshots\Thumbs.db (12288, 2006-05-15)
h\adcDrv1.h (2047, 2007-03-20)
h\dsp.h (60524, 2008-11-22)
h\tglPin.h (1816, 2007-03-20)
PC Simulation\dsPIC Filter Design (0, 2008-11-27)
PC Simulation\dsPICworks (0, 2008-11-27)
PC Simulation\screenshots (0, 2008-11-27)
src (0, 2008-11-27)
PC Simulation (0, 2008-11-27)
... ...
Readme File for Code Example:
CE100 - ADC Sampling and IIR Filtering
----------------------------------------
This file contains the following sections:
1. Code Example Description
2. Folder Contents
3. Suggested Development Resources
4. Reconfiguring the project for a different dsPIC33F device
5. Revision History
1. Code Example Description:
----------------------------
In this example, ADC is configured to sample (AIN5) at 8Khz rate and coverted data is assembled as 256 sample buffer before triggering filtering operation.
Timer 3 is setup to time-out every 125 microseconds (8Khz Rate).
As a result, the module will stop sampling and trigger a 12-bit A/D conversion on every Timer3 time-out, i.e., Ts=125us.
At that time, the conversion process starts and completes Tc=14*Tad periods later.
When the conversion completes, the module starts sampling again. However, since Timer3
is already on and counting, about (Ts-Tc)us later, Timer3 will expire again and trigger
next conversion.
ADC module clock time period is configured as Tad=Tcy*(ADCS+1)= (1/40M)**** = 1.6us (625Khz).
Hence the conversion time for 12-bit A/D Conversion Time Tc=14*Tad = 22.4us
void initTmr3();
Timer 3 is configured to time-out at 8Khz rate.
void initAdc1(void);
ADC module is set-up to convert AIN5 input using CH0 S/H on Timer 3 event in 12-bit mode.
void initDma0(void);
DMA channel 0 is confiured in ping-pong mode to move the converted data from ADC to DMA RAM on every sample/convert sequence.
It generates interrupt after every 256 sample transfer.
void __attribute__((__interrupt__)) _DMA0Interrupt(void);
DMA interrupt service routine performs IIR filtering on the data buffer.
2. Folder Contents:
-------------------
This folder contains the following sub-folders:
a. C:\Program Files\Microchip\MPLAB C30\support\gld
This folder will have the device GLD file, it is used for building the project.
This file was provided with the MPLAB C30 toolsuite.
b. C:\Program Files\Microchip\MPLAB C30\support\h
This folder contains C header files useful in building this
project. Device register and bit definitions are provided in
the *.h file that follows the device name. These files were provided
with the MPLAB C30 toolsuite.
c. C:\Program Files\Microchip\MPLAB C30\lib
This folder contains library archive files, which are a
collection of precompiled object files. The file
named "libpic30-coff.a" contains the C run-time start-up
library. These file were provided with the
MPLAB C30 toolsuite.
d. 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 dsPIC instructions specified in the source and library
code. The *.hex file contains a binary file that may be
programmed into the dsPIC device. The *.coff file contains
a binary file that is used by MPLAB IDE for simulation.
e. h
This folder contains include files for the code example.
f. 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.
3. Suggested Development Resources:
-----------------------------------
a. dsPICDEM1.1+ board with dsPIC33FJ256GP710 controller
4. Reconfiguring the project for a different dsPIC33F device:
-------------------------------------------------------------
The Project/Workspace can be easily reconfigured for any dsPIC33F device.
Please use the following general guidelines:
a. Change device selection within MPLAB IDE to a dsPIC33F 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:
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 :
---------------------
04/01/2006 - Initial Release of the Code Example
近期下载者:
相关文件:
收藏者: