16F690 TIMER0 and TIMER1


Closed Thread
Results 1 to 3 of 3
  1. #1
    nickdaprick's Avatar
    nickdaprick Guest

    Default 16F690 TIMER0 and TIMER1

    I'm really new with this stuff so bare with me please. I need to read the RPM of a spining shaft using two timers. Timer0 will generate an interrupt on the overflow that will read timer 1 which will be clocked every rotation of the shaft. If I know how many times the shaft spun in the time it tkes for timer 0 to overflow then I can manipulate the data into RPM. I undestand the concept of the timers however I've never used them before and I'm not clear on the sintax of the code. Can anyone give me some suggestions as how to set up the timers to do this in the proper sintax. Never mind the data manipulation.

    example code:

    #byte TMR0 = 0x01
    #byte OPTION_REG = 0x81

    OPTION_REG = 0xC7;

    I thought this would be the right sintax but I;m getting an error on the last line when I compile. What am I doing wrong. Any help would be appreciated.

  2. #2
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hi Nick,

    What program are you using to generate your program? It appears you are using assembly. This is not the correct forum for assembly language programming. You should go to www.electro-tech-online.com for help.

    If you are using PIC Basic or PIC Basic Pro then there is alot of information on our forums here that should answer your questions. Use the SEARCH feature or try Google.

    BobK.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    i'll bet on C Language...
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. ASM code
    By Bill Legge in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 1st March 2010, 23:55
  2. Synchronising Timer0 and Timer1
    By manxman in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 9th April 2008, 23:12
  3. Need help with INTerrupts
    By Srigopal007 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd August 2007, 00:53
  4. Low-Frequency Counter
    By Zeke in forum General
    Replies: 7
    Last Post: - 19th January 2006, 18:06

Members who have read this thread : 1

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