TMR0 as counter


Closed Thread
Results 1 to 24 of 24

Thread: TMR0 as counter

Hybrid View

  1. #1
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302


    Did you find this post helpful? Yes | No

    Default No

    Quote Originally Posted by Joe S. View Post
    So did you solve the problem, or not solve the problem?
    No.
    I use TMR0 as counter to measure the input frequency at RA4 for 256ms.
    The frequency is between 0.3mhz and 8mhz.
    My problem is how many times the TMR0 overflow.
    I use pic16f88 and 4 mhz xtal. (I don't to change these)

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by savnik View Post
    No.
    I use TMR0 as counter to measure the input frequency at RA4 for 256ms.
    The frequency is between 0.3mhz and 8mhz.
    My problem is how many times the TMR0 overflow.
    I use pic16f88 and 4 mhz xtal. (I don't to change these)
    Here is a link to an example Mister_e posted on ME Labs site.
    http://www.melabs.com/resources/samp...ed/counter.zip

    Personally, I do not understand how a PIC can count faster than it's own oscillator is running 4mhz vs 8mhz, I think you will have to up the Frequency to 20, but I may be wrong too. I thought it took 4 cycles per instruction, likely that's wrong too.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. Conway's Game Of Life
    By wellyboot in forum mel PIC BASIC Pro
    Replies: 45
    Last Post: - 28th May 2020, 06:14
  2. help: TMR0 interrupts disabling PORTAchange interrupts???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th August 2008, 15:10
  3. 20 Digit Virtual LED Counter
    By T.Jackson in forum Code Examples
    Replies: 9
    Last Post: - 19th November 2007, 05:02
  4. using TMR0 as a counter..
    By sirvo in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 28th July 2007, 02:56
  5. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27

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