Solved - ELAPSED TIMER: TimerConst not defined


+ Reply to Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: ELAPSED TIMER: TimerConst not defined

    Quote Originally Posted by Demon View Post
    Attachment 9731

    It's either something totally obvious, or painfully obscure.

    I can see the future! It turns out it's a combination of totally obvious and painfully obscure. It was looking at me right in the face.


    I added in Elapsed_INT.bas and it compiled without TimerConst errors.

    Code:
      If OSC == 32
    TimerConst = 0FFB7h
      EndIF
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default Re: Solved - ELAPSED TIMER: TimerConst not defined

    Great! Just confirm it counts correctly now.

    Ioannis

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: Solved - ELAPSED TIMER: TimerConst not defined

    It compiles, but now I have to find the correct value.

    I'm now on Art's thread trying to find that out:

    https://www.picbasic.co.uk/forum/sho...020#post156020


    EDIT: Darrel talks about the Prescaler and adding NOPs here:

    https://www.picbasic.co.uk/forum/sho...9649#post69649

    And that's about where my eyes start glossing over. I had also read a comment (somewhere) about Darrel using a prescaler of 2 for 64MHz, so I'm pretty sure I'm on the right track.


    EDIT SOME MORE: For future me when I'm looking for the same answer, Prescaler is controlled in T1CON.
    Last edited by Demon; - 23rd August 2024 at 01:37.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: Solved - ELAPSED TIMER: TimerConst not defined

    Ok, I couldn't figure out how to incorporate Prescaler in Art's formula, so I took another route:

    - used Preload from 16MHz
    - set Prescaler to 1:2

    Counter on LCD worked as expected.

    https://www.picbasic.co.uk/forum/sho...025#post156025
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  5. #5
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: Solved - ELAPSED TIMER: TimerConst not defined

    Art's formula with Prescaler:

    65535 - (((( MHz / Prescaler ) / 4 ) x 10000 ) - 8 )
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Similar Threads

  1. Elapsed Timer findings
    By Art in forum General
    Replies: 47
    Last Post: - 23rd August 2024, 06:40
  2. PIC16F18855 and DT elapsed timer
    By nomada in forum PBP3
    Replies: 2
    Last Post: - 18th October 2018, 05:58
  3. DT Elapsed Timer
    By retepsnikrep in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th December 2017, 23:21
  4. SPWM and Elapsed Timer
    By CocaColaKid in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 8th May 2008, 03:16
  5. DT Elapsed Timer
    By rwskinner in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 9th March 2008, 23:17

Members who have read this thread : 6

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