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.

calculates time between rising edge and falling edge

Status
Not open for further replies.

MARWEN007

Junior Member level 2
Joined
Apr 16, 2011
Messages
24
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,481
I am willing calculated the time of a width of a square wave of frequency 50Hz and amplitude 5V basis of a 16F877, my algorithm
capture rising edge
falling edge capture
/ / for the 1st time catching front just to take them as reference / /
loading timer
capture rising edge
countdown timer
until the falling edge
read timer (if I work with 16-bit timer1 model and I read it to say 0AFF Xtemps = FFFF-0AFF
This gives time = (180 * Xtemps) / 4096
{FOR 4096 that correspond to 180 °
I just work with the timer 1 MODE not pre-divided internal clock with the CCP1 module in Capture Mode and authorize those corresponding interrupt



I want to translate it in C language or if there are examples of code?or if there is another idea

I need your help because it was about my pfe is urgent
 
Last edited:

I dunno but the goal is to calculate this time with a such way thanks for your interest

you can help me??
 

i recomment you to look the portb change interrupt. This interrupt will activated when a change in portb msb bits.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top