DT_Interrupts - TMR1 Issue With 16F88


Results 1 to 7 of 7

Threaded View

  1. #4
    Join Date
    Jan 2013
    Location
    Texas USA
    Posts
    229


    Did you find this post helpful? Yes | No

    Default Re: DT_Interrupts - TMR1 Issue With 16F88

    To achieve your target .5sec on/off with. TMR0 you can do the following.
    Set the internal oscillator to 4MHz via the OSCCON register.
    Set the TMR0 Prescaler to 1:32 via the OPTION_REG register.
    Then set your T0Count test to "=>61" in the interrupt handler.

    When the values are plugged into the equation you get the following.
    Internal instruction cycle = 1 / [Oscillator Frequency / 4] = 1 / [4000000 / 4] = 1us
    Timer0 Overflow Interrupt = Internal instruction cycle * Prescaler * 2^8 = 1us * 32 * 256 = 8.192ms
    Time to Toggle LED2: T0Count * Timer0 Overflow Interrupt = 61 * 8.192ms = .4997 seconds
    Last edited by Tabsoft; - 23rd March 2015 at 21:20.
    Regards,
    TABSoft

Similar Threads

  1. TMR1 issue
    By Lestat in forum General
    Replies: 6
    Last Post: - 29th August 2012, 15:41
  2. Replies: 6
    Last Post: - 24th November 2011, 16:46
  3. Issue with 16F88 startup
    By Plcguy in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 21st October 2010, 15:11
  4. Question on DT_Interrupts
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 9th May 2010, 17:32
  5. Code Issue - select case or 'if' issue - not sure why
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th October 2007, 08:52

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