0% found this document useful (0 votes)
81 views4 pages

Using Dspic30F A/D Converters and The DSP Library For Signal Filtering

Uploaded by

Manoj kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views4 pages

Using Dspic30F A/D Converters and The DSP Library For Signal Filtering

Uploaded by

Manoj kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

CE001

Using dsPIC30F A/D Converters and the DSP library for


Signal Filtering
signal analysis and filtering will benefit from the
Author: Hrushikesh “Rishi” Vasuki dsPIC30F product family. Key features in the dsPIC30F
Microchip Technology Inc. architecture that enable such applications are briefly
described to help you understand the example source
OVERVIEW code. We will summarize how the example source
code demonstrates these capabilities. We will also
This Code Example document briefly describes and provide a list of the software and hardware
demonstrates the capabilities of the dsPIC30F Digital development tools and libraries used in building the
Signal Controller product family for performing signal example project.
analysis and filtering. The accompanying MPLAB® IDE
workspace exemplifies why applications that require

FIGURE 1: SIGNAL ANALYSIS AND FILTERING WITH dsPIC® DSC

+2.5V

dsPIC® DSC

4 kHz 2.5 VDC High Pass


A/D Further D/A
Anti-aliasing Level Converter Processing Converter
Filter Shifter Filter

-2.5V

Note: Check the schematics for the development board you are using to determine if analog circuitry,
level shifting and D/A conversion are provided on that board. You may need to provide some of
this circuitry externally.

BENEFITS digital result to an Infinite Impulse Response (IIR) filter.


IIR filters can be used to attenuate or amplify a range
The dsPIC® DSC devices feature a DSP engine that is of frequencies from an incoming signal.
seamlessly integrated into the CPU. They also provide
The Digital IIR filter used in this example is a C-callable
an on-chip 10-bit (1M SPS) or 12-bit (200K SPS) A/D
function provided in the dsPIC30F DSP library
Converter peripheral module. This combination of the
software. Such digital filters are typically implemented
A/D converter peripheral module and DSP engine
in software using Multiply-Accumulate (MAC) class of
allows applications to perform complex operations like
DSP instructions, featured in the dsPIC DSC
signal filtering and frequency estimation with the dsPIC
architecture. The MAC-class of instructions requires
DSC. This capability reduces on-board analog circuitry,
input data to be presented in 1.15 signed-fractional
saves space on the board and provides the additional
number format. The 1.15 format is described in detail in
benefits of field re-programmability and improving
the dsPIC30F Programmer's Reference Manual
temperature characteristics of your circuit.
(DS70030). The dsPIC30F A/D converters provide
conversion results in many number formats, including
OPERATION the 1.15 signed fractional format. Further details on the
dsPIC30F A/D converters may be found in the
The example dsPIC30F project in the attached MPLAB dsPIC30F Family Reference Manual (DS70046).
IDE workspace demonstrates how the dsPIC30F A/D
converter can be configured for converting an analog Figure 1 illustrates the operation of the dsPIC30F
signal and providing a signed fractional (1.15 format) device demonstrated by the example project.

© 2005 Microchip Technology Inc. DS92001A-page 1


CE001
The example dsPIC30F project configures the The project/workspace assumes that a 7.37 MHz
dsPIC30F A/D converter for a sampling analog input crystal provides device clocking. Such crystals are
pin, AN7, at a rate of 8 kHz. Any single-ended input provided on several dsPIC30F development boards,
signal band-limited to 4 kHz may be applied on the for example dsPICDEM™ 64-Pin Starter Development
input pin. A single-ended input signal (not differential) Board, dsPICDEM 1.1, dsPICDEM 2,
is one that has a DC bias that is half the reference dsPICDEM.net™, and dsPICDEM MC1. Additional
voltage. oscillator and PLL options have been configured in
The A/D converter is set up for interrupting the CPU source code to operate the device at a throughput of
after converting 16 samples. At each interrupt, a High- 29.4 MIPS. All Microchip software tools and dsPIC30F
Pass Elliptic IIR filter function is invoked. The high- documentation described in this document can be
pass filter heavily attenuates any signals in the downloaded from http://www.microchip.com.
frequency range, 0 to 500 Hz. The filtering is performed
on a block of 16 samples using a cascade of SUMMARY
transposed biquadratic (Direct Form II) IIR filter
sections provided by the DSP library. The biquadratic The example project lets you set up the dsPIC30F
filter section is a commonly used filter topology that 12-bit A/D converter for sampling an analog input
implements the difference equations required for signal at 8 KHz in an interrupt-driven fashion using C
filtering a digital signal. language. The example also demonstrates how you
can invoke an IIR filter function provided in the
dsPIC30F DSP library software, as well as, how
DEVELOPMENT TOOLS AND coefficients generated by the dsPIC DSC Filter
LIBRARIES Design software can be incorporated into the project.
dsPICworks™ tool and dsPIC DSC Filter Design
The example workspace was created using MPLAB
screen shots and simulation files are also provided in
IDE v7.11. All source code in the project is written
the Zip file. Refer to the Readme.txt file for a sum-
in C. Source-level comments have been provided to
mary description of the various files and folders pro-
aid understanding. The project also uses an IIR
vided in the project. Operational aspects are
filtering function from the DSP Library archive file,
described in source-level comments in each file.
libdsp-coff.a, which is provided in the MPLAB
C30 v1.32 C compiler tools suite. The IIR filter uses
filter coefficients generated by dsPIC DSC Filter
Design, a graphical tool that designs digital filters
for the dsPIC30F device. The example MPLAB IDE
workspace is configured for a dsPIC30F6014
device, but it is easily re-configured for any
dsPIC30F device with a 10-bit or 12-bit A/D
converter. Analog input pin, AN7, used in this
project is available for use on all dsPIC DSC
development boards and many dsPIC DSC devices.

DS92001A-page 2 © 2005 Microchip Technology Inc.


Note the following details of the code protection feature on Microchip devices:
• Microchip products meet the specification contained in their particular Microchip Data Sheet.

• Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.

• There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.

• Microchip is willing to work with the customer who is concerned about the integrity of their code.

• Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable.”

Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.

Information contained in this publication regarding device Trademarks


applications and the like is provided only for your convenience
The Microchip name and logo, the Microchip logo, Accuron,
and may be superseded by updates. It is your responsibility to
dsPIC, KEELOQ, microID, MPLAB, PIC, PICmicro, PICSTART,
ensure that your application meets with your specifications.
PRO MATE, PowerSmart, rfPIC, and SmartShunt are
MICROCHIP MAKES NO REPRESENTATIONS OR WAR-
registered trademarks of Microchip Technology Incorporated
RANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED,
in the U.S.A. and other countries.
WRITTEN OR ORAL, STATUTORY OR OTHERWISE,
RELATED TO THE INFORMATION, INCLUDING BUT NOT AmpLab, FilterLab, Migratable Memory, MXDEV, MXLAB,
LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, PICMASTER, SEEVAL, SmartSensor and The Embedded
MERCHANTABILITY OR FITNESS FOR PURPOSE. Control Solutions Company are registered trademarks of
Microchip disclaims all liability arising from this information and Microchip Technology Incorporated in the U.S.A.
its use. Use of Microchip’s products as critical components in Analog-for-the-Digital Age, Application Maestro, dsPICDEM,
life support systems is not authorized except with express dsPICDEM.net, dsPICworks, ECAN, ECONOMONITOR,
written approval by Microchip. No licenses are conveyed, FanSense, FlexROM, fuzzyLAB, In-Circuit Serial
implicitly or otherwise, under any Microchip intellectual property Programming, ICSP, ICEPIC, Linear Active Thermistor,
rights. MPASM, MPLIB, MPLINK, MPSIM, PICkit, PICDEM,
PICDEM.net, PICLAB, PICtail, PowerCal, PowerInfo,
PowerMate, PowerTool, rfLAB, rfPICDEM, Select Mode,
Smart Serial, SmartTel, Total Endurance and WiperLock are
trademarks of Microchip Technology Incorporated in the
U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated
in the U.S.A.
All other trademarks mentioned herein are property of their
respective companies.
© 2005, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.

Microchip received ISO/TS-16949:2002 quality system certification for


its worldwide headquarters, design and wafer fabrication facilities in
Chandler and Tempe, Arizona and Mountain View, California in
October 2003. The Company’s quality system processes and
procedures are for its PICmicro® 8-bit MCUs, KEELOQ® code hopping
devices, Serial EEPROMs, microperipherals, nonvolatile memory and
analog products. In addition, Microchip’s quality system for the design
and manufacture of development systems is ISO 9001:2000 certified.

© 2005 Microchip Technology Inc. DS92001A-page 3


WORLDWIDE SALES AND SERVICE
AMERICAS ASIA/PACIFIC ASIA/PACIFIC EUROPE
Corporate Office Australia - Sydney India - Bangalore Austria - Weis
2355 West Chandler Blvd. Tel: 61-2-9868-6733 Tel: 91-80-2229-0061 Tel: 43-7242-2244-399
Chandler, AZ 85224-6199 Fax: 61-2-9868-6755 Fax: 91-80-2229-0062 Fax: 43-7242-2244-393
Tel: 480-792-7200 China - Beijing Denmark - Ballerup
India - New Delhi
Fax: 480-792-7277 Tel: 86-10-8528-2100 Tel: 45-4450-2828
Tel: 91-11-5160-8631
Technical Support: Fax: 86-10-8528-2104 Fax: 45-4485-2829
Fax: 91-11-5160-8632
http://support.microchip.com
China - Chengdu Japan - Kanagawa France - Massy
Web Address:
Tel: 86-28-8676-6200 Tel: 81-45-471- 6166 Tel: 33-1-69-53-63-20
www.microchip.com
Fax: 86-28-8676-6599 Fax: 81-45-471-6122 Fax: 33-1-69-30-90-79
Atlanta
Alpharetta, GA China - Fuzhou Korea - Seoul Germany - Ismaning
Tel: 86-591-8750-3506 Tel: 82-2-554-7200 Tel: 49-89-627-144-0
Tel: 770-640-0034
Fax: 86-591-8750-3521 Fax: 82-2-558-5932 or Fax: 49-89-627-144-44
Fax: 770-640-0307
China - Hong Kong SAR 82-2-558-5934 Italy - Milan
Boston
Tel: 852-2401-1200 Tel: 39-0331-742611
Westborough, MA Malaysia - Penang
Fax: 852-2401-3431 Tel:011-604-646-8870 Fax: 39-0331-466781
Tel: 774-760-0087
Fax: 774-760-0088 China - Shanghai Fax:011-604-646-5086 Netherlands - Drunen
Tel: 86-21-5407-5533 Philippines - Manila Tel: 31-416-690399
Chicago
Fax: 86-21-5407-5066 Fax: 31-416-690340
Itasca, IL Tel: 011-632-634-9065
Tel: 630-285-0071 China - Shenyang Fax: 011-632-634-9069 England - Berkshire
Fax: 630-285-0075 Tel: 86-24-2334-2829 Tel: 44-118-921-5869
Singapore
Fax: 86-24-2334-2393 Fax: 44-118-921-5820
Dallas Tel: 65-6334-8870
Addison, TX China - Shenzhen Fax: 65-6334-8850
Tel: 972-818-7423 Tel: 86-755-8203-2660
Taiwan - Kaohsiung
Fax: 972-818-2924 Fax: 86-755-8203-1760
Tel: 886-7-536-4818
Detroit China - Shunde Fax: 886-7-536-4803
Farmington Hills, MI Tel: 86-757-2839-5507
Taiwan - Taipei
Tel: 248-538-2250 Fax: 86-757-2839-5571 Tel: 886-2-2500-6610
Fax: 248-538-2260 China - Qingdao Fax: 886-2-2508-0102
Kokomo Tel: 86-532-502-7355 Taiwan - Hsinchu
Kokomo, IN Fax: 86-532-502-7205 Tel: 886-3-572-9526
Tel: 765-864-8360 Fax: 886-3-572-6459
Fax: 765-864-8387
Los Angeles
Mission Viejo, CA
Tel: 949-462-9523
Fax: 949-462-9608
San Jose
Mountain View, CA
Tel: 650-215-1444
Fax: 650-961-0286
Toronto
Mississauga, Ontario,
Canada
Tel: 905-673-0699
Fax: 905-673-6509

04/20/05

DS92001A-page 4 © 2005 Microchip Technology Inc.

You might also like