DT_Elapsed timer constant for 40 MHz?


Results 1 to 5 of 5

Threaded View

  1. #2
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    40mhz is too fast to get a 100hz interrupt without a pre-scaler.

    So what you will have to do is add this to the frequency part of Elapsed_INT-18.bas

    Code:
      If OSC == 40
    TimerConst = 0CF2Dh
      EndIF
    And then add this line somewhere near the start of your program to set a 1:8 prescaler on TMR1.

    Code:
    T1CON.4=1
    T1CON.5=1
    *note* untested

    *edit* changed values to make it more accurate
    Last edited by Kamikaze47; - 11th July 2010 at 08:16.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

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