Continue to Site

Welcome to

Welcome to our site! 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.

how to use the pic16f877 to detect pwm output sensor to pic

Not open for further replies.


Newbie level 2
Jan 9, 2006
Reaction score
Trophy points
Activity points
pic pwm sensor

can anyone tell me how to use the counter of pic16f877 to detect pwm output sensor (accelerometer) to pic input??

pic sensör pwm

I think there are a number of solutions to your problem. One solution is outlined below. And I think using PICF877 is too much to use for this application You can use Pic16F84A instead.

Solution 1.) Connect you PWM output to RB0 Interrupt pin. As soon as an interrupt occurs during rising edge of the PWM, Reset TMR0 or load proper TMR0 count, and change Interrupt edge definition from rising edge to falling edge. At falling edge of the PWM, get the TMR0 count then multiply to its TMR0 period, you get your PWM pulse width. the problem with this scheme is when TMR0 overflows before falling edge. So you need proper prescaling of the TMR0 so that the overflow period is longer than the PWM width.

Re: how to use the pic16f877 to detect pwm output sensor to

Does you have any idea about how the PWM output will look like? Because I want to give an PWM input to PIC16F877 in Proteus (ISIS) . So how can i give such an input.

PWM is nothing but an pulses(square Wave) with Width of Pulses modulated with information...
if u like to Measure the width of pulses read content of above post ..

use wikipedia to read more on PWM

Re: how to use the pic16f877 to detect pwm output sensor to

Hello de_student2003,

Did you manage to find the answer for your question?
We are also in need of knowing how to detect PWM output of a acclerometer using a pic16F877.

Not open for further replies.

Part and Inventory Search

Welcome to