help: countdown with timer0 interrupt


Results 1 to 13 of 13

Threaded View

  1. #5
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Default

    8MHz & Fosc/4 = 2MHz = 0.5Us per instruction cycle.
    Id 1:256 prescaler, it will count 256 instruction cycle before incrementing TMR0.
    With a TMR0 preset to 176 and a prescaler of 256 it will interrupt every 10ms.

    Skimask, you say:
    "Tmr0 overflows every 256 instruction cycles, 7812.5 timers per second".
    I don't get it.
    256*0.5ns = 128 ns per overflow if 1:1 prescaler.
    1000000000ns / 128 = 7812500 iterations per second
    Last edited by xnihilo; - 8th August 2008 at 21:05.

Similar Threads

  1. Won't go back to SLEEP after 1st Interrupt
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 29th June 2009, 10:00
  2. Can't ID interrupt source with this IntHandler??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd June 2009, 03:35
  3. Sleep Mode
    By Pesticida in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th March 2008, 11:31
  4. Ping Darrel Taylor - Timer0 Instant Interrupt
    By JEC in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 9th January 2007, 12:20
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 02:07

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