touble with a time calculation


Closed Thread
Results 1 to 40 of 59

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: touble with a time calculation

    hI GUYS , using the code by steve seems to work , a small change cos i use EL1 values to show the current time value , so any changes that change the EL1 values in the calculating the EL2 , is not possible so i need to copy the values of EL1 to EL3 , then use EL3 as a temp group

    I am trying to disable the interupt whilest in the ISR subroutine , before the copy of EL0 to EL1-3 , then re -enable interrupt after ,

    but i get a interrupt priority state not found error when compile atm

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    Did you find this post helpful? Yes | No

    Default Re: touble with a time calculation

    it serves no purpose to stop the isr from within the isr , its a waste of time copying the el vars to a buffered copy inside the isr .
    time in your case is in essence a multi byte var , the value is volatile and cannot be guaranteed outside the isr when the isr is running.
    the correct procedure is
    disable isr
    copy bytes to buffer
    enable isr
    do your subtraction

Similar Threads

  1. Help with calculation
    By Megahertz in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 28th August 2012, 17:10
  2. CHECKSUM CALCULATION, Please Help!
    By wasilus in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 2nd August 2012, 07:55
  3. Calculation Problem - value goes to zero after 65
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 12th March 2010, 05:10
  4. calculation
    By lerameur in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 20th May 2008, 16:28
  5. CRC Calculation - Need a little help
    By Steve43 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 13th March 2005, 01:23

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