Interrupt based timer outputting wrong frequency


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Interrupt based timer outputting wrong frequency

    In the first part of the ISR, it doesn't clear the interrupt flag if the value isn't 10.
    So it exits and re-enters the ISR 10 times really fast.

    Once it gets to 10, it toggles the pin and finally clears the flag, which all happens from a single interrupt.
    DT

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: Interrupt based timer outputting wrong frequency

    Darrel,
    Thanks, it's working now ... getting 5 hz toggle. Added this line at the beginning of the ISR routine:

    BCF PIR1,1 ;clear tmr2 interrupt flag

Members who have read this thread : 0

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