Elapsed timer not working as expected at 64MHz


Closed Thread
Results 1 to 40 of 56

Hybrid View

  1. #1
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838


    Did you find this post helpful? Yes | No

    Default Re: Elapsed timer not working as expected at 64MHz

    ticks should be 2.5ms , 1/100 is 4 x tick = 10ms , 1 sec should be 100 x 1/100th or 400 tick = 1sec

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


    Did you find this post helpful? Yes | No

    Default Re: Elapsed timer not working as expected at 64MHz

    Quote Originally Posted by longpole001 View Post
    ticks should be 2.5ms , 1/100 is 4 x tick = 10ms , 1 sec should be 100 x 1/100th or 400 tick = 1sec
    From my observations so far:

    I think this is the core of the problem. With older PICs (I'm thinking up to 40MHz), a tick of 1/100 of a second was the smallest unit Darrel was able to attain. Now with newer PICs reaching 64MHz, a tick was now 4 times smaller. I can only guess that the old way of doing things in the background by Microchip was based on 16MHz processing, that would explain ticks becoming 4 times faster when using 64MHz.

    As I mentionned in the chatbox last night, this is a PIC-specific issue. Sheldon mentionned that Darrel has released a 18FxxK22 version of the Elapsed Timer. I totally missed the release of this include. There's no mention of it in the archived web pages of Darrel's work (not surprising - they are old).

    So I'll remove my modified version and leave people use Darrel's new version instead.

    Robert

  3. #3
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: Elapsed timer not working as expected at 64MHz

    No need to remove it - there's nothing wrong with having more than one program that does the same thing!

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


    Did you find this post helpful? Yes | No

    Default Re: Elapsed timer not working as expected at 64MHz

    The problem with multiple versions is maintenance. If a problem is found in one version, it must also be corrected in the other - duplicating work. For example, when Microchip decides to change how things work in the background.


    Right now I can't seem to find a post where Darrel released his Elapsed Timer for 18FxxK22 PICs. Has anyone else seen it?

    Or was it possibly distributed through PM?

    Robert

Similar Threads

  1. I2CRead & I2CWrite not working as expected
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 30
    Last Post: - 27th October 2021, 18:36
  2. PORTB.3 Input not working as expected.
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 5th March 2013, 09:58
  3. Elapsed Timer Demo
    By Darrel Taylor in forum Code Examples
    Replies: 111
    Last Post: - 29th October 2012, 17:39
  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 : 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