lake_of_fire
Newbie level 5
Hi
Is it possible to use PWM function and timer2 as a timer at the same time. I dont want to do anything with timer 2 other than get a value of elapsed time
Timer 2 will be used as the time elapsed in a PID function, both PWM modules are in use so capture/compare is not available.
(my timer0 and timer1 are both in use already or I would use one of them)
Thanks
---------- Post added at 01:29 ---------- Previous post was at 01:06 ----------
I think I have found my own answer apologies,
an interrupt is triggered when PR2 meets TMR2, so I can just use the interrupt to increment a value as and when TMR2 is reset (the problem I could see with timer2 and PWM is that TMR2 is reset when PR2 meets TMR2)
Is it possible to use PWM function and timer2 as a timer at the same time. I dont want to do anything with timer 2 other than get a value of elapsed time
Timer 2 will be used as the time elapsed in a PID function, both PWM modules are in use so capture/compare is not available.
(my timer0 and timer1 are both in use already or I would use one of them)
Thanks
---------- Post added at 01:29 ---------- Previous post was at 01:06 ----------
I think I have found my own answer apologies,
an interrupt is triggered when PR2 meets TMR2, so I can just use the interrupt to increment a value as and when TMR2 is reset (the problem I could see with timer2 and PWM is that TMR2 is reset when PR2 meets TMR2)