Interrupt RPM and Taylors Elapsed time on 18F4620


Results 1 to 40 of 71

Threaded View

  1. #12
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Nope...

    Lets say we had ten thousand captures after this;
    Code:
    Loop:
    TMR1H = 0    'Clear 8-bit register                              
    TMR1L = 0    'Clear 8-bit register
    capture = 0  'Clear Timer
    'SEROUT2 LCD,84, [Prefix,CursorPS,0,"Capture ", dec Capture," ",DEC Period]
    Start:
          If Capture = 0 then
             Goto Start
          endif
    
          T1CON.0=1
          Capture = 0 
          
    CaptureLoop:
      If Capture = 0 then 
        'SEROUT2 LCD,84, [Prefix,CursorPS,0,"Dont Capture ", dec Capture," ",DEC Period]
        Goto CaptureLoop
      endif
    T1Con.0=0  
    period.LowByte=CCPR1L
    period.HighByte=CCPR1H
    They would all be zero since TMR1 was disabled after the T1CON.0=0.
    Once period = CCPR1L & CPR1H it's a done deal until the next capture,
    and Timer1 is re-enabled.

    Capture works wether or not Timer1 is enabled. It just returns 0 if it's off.

    Yet - I may be missing something...
    Last edited by Bruce; - 29th January 2010 at 04:20.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

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