PDA

View Full Version : Timer2



swordman
- 17th September 2004, 07:01
Hi,
How can I use timer2 with pause command?(16f877)

For example:
pause 7000 ' with tmr2

Melanie
- 17th September 2004, 11:05
Timer2 is not very versatile as it's an 8-bit Timer (eg 16F628). With both the Postscaler and Prescaler enabled you can only get 16*256*2 oscillator ticks out of it (check your PICs Datasheet). The longest timing sequence (at 4MHz) is therefore 8.192mS. You need some additional external variable as a counter (and associated processing code) to time intervals as long as your 7 second example. Is there a reason you don't want to use Pause?

swordman
- 17th September 2004, 12:50
Hi,
I want to use tmr2 ,like this

for i = 1 to 900
pause 8 'tmr2
next i

Can I set tmr2 to work with pause command?