Digital Filter Simulation Using Atmel Studio and Proteus

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 8

Digital Filter Simulation

using Atmel Studio and


Proteus
Simulation Block Diagram
Reset Port C

Crystal
Clock

Atmega32 Port D
Signal Port A
Generator (8 bit ADC) Processor

Oscilloscope Digital Filtering Power


Power
Supply of Signal Supply

DAC Port B

2
Steps
• FIR Filter design using MATLAB Filter Design tool FIR filter coefficients

• Assembly coding in Atmel Studio with the coefficients

• Circuit Connections in Proteus

• Load assembly HEX file in Proteus and Simulate

3
Filter design using MATLAB Filter Designer
tool
In MATLAB, go to APPS then Filter Designer under Signal Processing and
Communications

1. Select Filter Response type


2. Select Design Method
3. Specify Filter Order
(No. of coefficients = Order+1)
4. Give Frequency Specifications
5. Design Filter
6. Go to Filter Coefficients

4
Fixed Point Quantization of Filter Coefficients
1. Filter coefficients are 64bit precision
2. Convert to 8 bit fixed point
3. Go to Set quantization parameters
4. Select Filter Arithmetic as fixed point
5. Set Numerator word length as 8
6. Uncheck Best-precision fraction lengths
7. Set fraction length as 7
8. Apply
9. Go to File – Export – Export to Workspace
10. Multiply coefficients with 2^8
11. Convert to HEX using dec2hex command
5
Assembly coding in Atmel Studio
Create New Project Select Assembler Browse project Select Atmega32 as
in Atmel Studio option folder location device

Write code in .asm file

Under project properties, Under project properties, go to


Build the Solution go to Tool. Select Toolchain then general. Enable
Simulator as Debugger the HEX file generation option

HEX file is generated in


Debugger folder in the
project folder location 6
Circuit Connections & Simulation in Proteus
Create New Project in Proteus

Select circuit components from Parts


Library and place them in the schematic

Select voltage source from Generator Mode


and ground from Terminal Mode

For Atmega32, load its HEX file from the


Atmel Studio project folder

Do Simulation
7
Circuit Diagram in Proteus

You might also like