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.

Help for interrupt using MicroC for Pic

Status
Not open for further replies.

uxmanghani108

Newbie level 2
Joined
Nov 18, 2013
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
12
Sir ,
I have a problems using interrupt in MicroC for PIC. Am using PIC 16F877A
Sir e.g I have two square waves , when first wave rise interrupt 1 start and timer also start , after some time 2nd square wave rise at that time timer should be off , and the value of timer should be stored in a variable , this is the part of my project , please Help
Regards Usman Ghani
 
Last edited:

Use INT0 interrupt. When first rising edge is detected start timer and clear INT0IF bit. On 2nd rising interrupt stop timer. Use a counter inside isr which increments on every timerx interrupt. If timer interrupt you used was for say 20 us then counter will have number of timerx interrupts and the remaining time after the last timerx interrupt is got from TMRx register. If 1000 timerx interrupts had occured then counter value will be 1000. 1000 * 20 us + remaining time in TMRx register gives total time.
 

Sir , Thanks for the reply , It will be more clear if you give me any exapmle of code in MicroC for PIC ,
Regrads
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top