Elapsed Timer Demo


Results 1 to 40 of 112

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    The DS1820 takes 750 ms to do a conversion.

    In this section here, you have the interrupts turned off the whole time while waiting 3/4 of a second for it to finish. Missing a few (75) interrupts.
    Code:
    Update_The_Temperature:
    
             INTCON.7 = 0 ' Disables all interrupts
             OWOut DQ, 1, [$CC, $44]              ' Start temperature conversion
             waitloop:OWIn DQ, 4, [count_remain]  ' Check for still busy converting
             IF count_remain = 0 THEN waitloop
             OWOut DQ, 1, [$CC, $BE]              ' Read the temperature
             OWIn DQ, 0, [temperature.LOWBYTE, temperature.HIGHBYTE, Skip 4, _ 
                                                       count_remain,count_per_c]
             'Gosub StartTimer
             INTCON.7 = 1 ' Enables all unmasked interrupts
       RETURN
    Since you have the Elapsed timer going, maybe you could send the convert command, then go back 1 second later and read the results. "Quickly"
    <br>
    Last edited by Darrel Taylor; - 10th November 2005 at 08:05.
    DT

Similar Threads

  1. Instant Interrupts - Revisited
    By Darrel Taylor in forum Code Examples
    Replies: 772
    Last Post: - 17th February 2016, 23:14
  2. Get elapsed time while TIMER samples pulses
    By RodSTAR in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th March 2009, 17:27
  3. Elapsed Timer Demo in a PIC12F675
    By Leonardo in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 21st November 2008, 01:01
  4. Totally Baffled with Elapsed Timer
    By CocaColaKid in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th June 2008, 22:01
  5. Darrel Taylor Elapsed Timer
    By rwskinner in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 13th March 2008, 02:22

Members who have read this thread : 5

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