Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PID controller using pic f877

Status
Not open for further replies.

zoubir

Junior Member level 1
Joined
Apr 18, 2007
Messages
17
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,370
Hi everybody,
I want a clue to calculate the pic 16f877 computation time for the processing of an input sample with the filtering diff equation:eg.
y(n)=0.123*x(n)+0.223*x(n-1)+0.08*x(n-2)+.....
The diff equation I manipulated is order 9 and so there is much time consuming in the pic algorithm which I fear will not work properly for real time processes.
Kind regard,
 

zoubir said:
Hi everybody,
I want a clue to calculate the pic 16f877 computation time for the processing of an input sample with the filtering diff equation:eg.
y(n)=0.123*x(n)+0.223*x(n-1)+0.08*x(n-2)+.....
The diff equation I manipulated is order 9 and so there is much time consuming in the pic algorithm which I fear will not work properly for real time processes.
Kind regard,


I have no better ideea than measuring the computational time for every constant multiplication on every sample. Limit the number of samples to a reasonable value. Use this trick for multiplication with a constant:
http://www.piclist.com/techref/piclist/codegen/constdivmul.htm
 

zoubir said:
Hi everybody,
I want a clue to calculate the pic 16f877 computation time for the processing of an input sample with the filtering diff equation:eg.
y(n)=0.123*x(n)+0.223*x(n-1)+0.08*x(n-2)+.....
The diff equation I manipulated is order 9 and so there is much time consuming in the pic algorithm which I fear will not work properly for real time processes.
Kind regard,

hi pal, i know i am just a beginner but i am very sure i have seen something like that in this link. **broken link removed** i hope you it helps. pls anyway to make grow in microcontroller programing and interfacing will be apprciate. cheers

Added after 8 minutes:

here is another for you but this is based on the avr microcontroller
**broken link removed**
have fun
 

mathematical computation time in pic based digital filters is a an important issue.
I myself confronted this problem and to answer your question I recommend that you follow the following steps.
1-In a loop under ASM or C language set port B pin 1 as output
2-set port B pin 1 to HIGH
3-compute your diff equation y(n)=sum{ai*x(n-i)+bj*y(n-j)} or any expression
4-set port B pin 1 to LOW
5-go to step 1
After compiling and loading the hex code into your PIC platform or simulator such as Proteus (ISIS),you use the oscilloscope to display the square wave at pin 1 and measure the period.You will notice that duty cycle is important; the ON-TIME or high state of the output of port B pin1 will correspond to the math computation time.
robertdesantos@yahoo.fr
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top