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.

edge detection in PIC16F877A

Status
Not open for further replies.

sana_akhtar

Member level 2
Member level 2
Joined
Apr 21, 2012
Messages
47
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,606
Hey

I want to detect the low to high voltage transition at pin RA4 of PIC16F877A. I can't use any other pin.
What can be done? The project is taking input from the sensor. In case, something just stop in front of sensor, controller still count it as single entity. So I need to check the change from low to high value of sensor. Please help.
 
Last edited:

configure port A pin RA4 as input and poll it periodically for change from low to high in main while loop.

If the change can occur for very small amount of time then i suggest better use an external interrupt on RB port or external interrupt pin INT, bcoz in this case you need to continuously check for change on pin which will take all time of microcontroller in checking the change on pin, instead of doing anything else in code. So, if you still insist on using RA4 then keep polling for change but nothing else.

Hope that helps.
 

Scan the input in timer interrupt with sufficient rate, e.g. 1 kHz, detect low-high transition by comparing with previous state.
 

should I take the difference in transition for the time 1/Fosc ?
I was trying this but there was something wrong and it wasnt displaying it on LCD.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top