Timer2


Closed Thread
Results 1 to 3 of 3

Thread: Timer2

  1. #1
    swordman's Avatar
    swordman Guest

    Default Timer2

    Hi,
    How can I use timer2 with pause command?(16f877)

    For example:
    pause 7000 ' with tmr2

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    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?

  3. #3
    swordman's Avatar
    swordman Guest


    Did you find this post helpful? Yes | No

    Default

    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?

Similar Threads

  1. 16F726 Capacitive sensing module
    By Byte_Butcher in forum General
    Replies: 39
    Last Post: - 15th May 2014, 19:40
  2. Half-bridge PWM with a 16F684 ?
    By Byte_Butcher in forum General
    Replies: 7
    Last Post: - 17th January 2010, 22:18
  3. Timer1 and Timer2 interrupts, Darrel Taylor
    By ronbowalker in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th December 2009, 18:38
  4. PWM pic16f873a(can i use timer2?)
    By Jadavjd in forum General
    Replies: 3
    Last Post: - 3rd April 2007, 20:44
  5. using counter using basic
    By islambadr in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 20th August 2006, 20:13

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts