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.

PIC18F452 Timers/Counters Interrupts,...

Status
Not open for further replies.

bobx

Junior Member level 3
Joined
Jan 11, 2010
Messages
29
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,283
Location
TEHRAN
Activity points
1,531
Hello everybody.I want to write a program using PIC18F452&XTAL=20MHZ in C or mikroC to do the followings;

1.Simultaneously turn a timer on[timer0 or...] to count for 1 sec. and
also count the number of High[transition from H to L] state of the
input signal.

2.Turn a timer on[timer0 or...] for 1 sec. and as soon as a input signal injected or entered to a PIC pin the timer[timer0 or...]immediately turned off and calculate the time of passed by that timer.

Would you please help and give me some example codes to write those programs?

Thanks,:?:
 

Here's examples of interrupt and timer use:

PIC Interrupts - Part 1

PIC16F877 Timer Modules tutorials

Introduction to PIC18′s Timers

**broken link removed**

The above examples are have similarities to both your scenarios.

Scenario 1 uses an external interrupt edge transition or external clock input and timer overflow interrupt.

Scenario 2 uses an external interrupt edge transition and timer overflow interrupt.

Hope the info helps in your endeavors.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top