Can I use two timers at the same time?

General discussion on mikroC PRO for PIC.
Post Reply
Author
Message
wb9ixs
Posts: 21
Joined: 02 Feb 2014 21:26
Location: Wisconsin

Can I use two timers at the same time?

#1 Post by wb9ixs » 25 Mar 2014 16:32

I am using a 16F886 for this project. I want to use timer0 as a counter and use either timer1 or timer2 as a accurate timer source. My goal is to count pulses on timer0 for a specific time then stop counting and get the counts. If I do this "stop and read" at very accurate time intervals I should be able to calculate the frequency of the pulses. So, can I use one timer as an external counter and another timer as a timer at the same time?? I have the counter working fine but have not tried the second timer yet.

Thanks
Jim

Sparky1039
Posts: 1179
Joined: 24 Nov 2005 20:07
Location: Colorado, USA

Re: Can I use two timers at the same time?

#2 Post by Sparky1039 » 25 Mar 2014 16:39

Can I use two timers at the same time?
yes. However, to do so properly you will want to use interrupts to manage the timer events quickly and efficiently.

kanecharles04@gmail.com
Posts: 1
Joined: 01 Mar 2024 09:10

Re: Can I use two timers at the same time?

#3 Post by kanecharles04@gmail.com » 01 Mar 2024 09:17

Hi,

It is possible to use one timer as an external counter and another as a precise time source at the same time. You already have a working timer, just haven't tried the second timer yet.

Wishing you success in your project, Jim!
Revolutionize your time with time calculator.

Post Reply

Return to “mikroC PRO for PIC General”