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.

Program to detect PWM signals using CCP modules in Pic16f877

Status
Not open for further replies.

Anuradha1

Member level 2
Joined
Nov 11, 2009
Messages
49
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
India
Activity points
1,570
Hi,
I have written a program in Assembly, to capture PWM signals. The CCP modules of pic16f877 are used.

The algorithm i followed was taken from "micro chip PicMicro CCP and ECCP Tips and tricks"


It works well. compiled and simulated. But for certain values i.e. when the duty cycle of PWM input is small (below 20% pulse width is 160 clock cycles), and it is very large (95% pulse width is 160 clock cycles) it provides error results.

As I noticed this happens bcz the micro controller miss the relevant edge, while saving current CCPR1L value.


Can some one help me to solve out this issue.

Thanks.
PS
cade attached
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top