ELAPSED.PBP modification question


Closed Thread
Results 1 to 5 of 5
  1. #1

    Default ELAPSED.PBP modification question

    Can I change the interrupt hertz from 100 to 1000 and then have 0.001 resolution?

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    You can.

    You would need to change the TimerConst so that it interrupts at 1khz.
    You can use mister-e's calculator for that.

    Change the Ticks variable to a WORD.

    Then in the ClockCount routine, change to this ...
    Code:
        Ticks = Ticks + 1
        if Ticks = 1000 then
           Ticks = 0
           Seconds = Seconds + 1
    ; etc.
    Happy Holiday's,
    DT

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Great. I downloaded the calculator and am using the 'timer helper' module. I am using a 20 Mhz OSC. I am not too sure as to what I need for a reload number. I enter in 1 Khz for the interrupt frequency. Using 10 for the reload number I get 60546 for the preload result. Hex is then ec82. If this correct? I am going to reverse engineer using your numbers for 0.01 resolution to see if its right. I am at the in-laws without my scope so I can't check this today.
    Thanks for the help
    Toby

  4. #4


    Did you find this post helpful? Yes | No

    Default

    I better clarify, I am using Elapsed-18.pbp if it matters.

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Very good.

    Elapsed-18 uses an 8-instruction reload.
    So, 60544 (EC80) should be a little more accurate.

    Can't help with the in-laws ... Sorry.
    <br>
    DT

Similar Threads

  1. AN Question for "word" variable read The serial port
    By redfoen in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 14th December 2007, 17:39
  2. FREQOUT - PWM question
    By Etcho in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 25th February 2007, 23:51
  3. PIC16F684 Program question
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th December 2006, 14:30
  4. Question for a math guru
    By Christopher4187 in forum General
    Replies: 3
    Last Post: - 22nd November 2006, 09:45
  5. Please answer my first question
    By John_001 in forum Off Topic
    Replies: 1
    Last Post: - 15th September 2006, 06:49

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