Using CCP1 and CCP2 in capture mode with Timer1.


Closed Thread
Results 1 to 5 of 5

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    You would probably get better results if you enable 1 capture at a time, stop timer1 before clearing it & entering CaptureLoop2.

    Are you trying to measure the period or high-going pulse width?
    Regards,

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

  2. #2
    Join Date
    Dec 2010
    Location
    Colchester England
    Posts
    20


    Did you find this post helpful? Yes | No

    Default

    Hi thanks for your reply

    I am measuring the period of the incoming pulses.

    I have to say I had not considered enabling one CCP at a time. Would I acheive this changing the CCPxCON statement? (x being 1 or 2). Such as CCP1CON = %00000000.

    Thanks.

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Would I acheive this changing the CCPxCON statement?
    Yes. Enable 1. Wait for capture. Disable 1, Enable 2, wait for capture, etc. It's a good idea to stop Timer1 before clearing it also.
    Regards,

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

  4. #4
    Join Date
    Dec 2010
    Location
    Colchester England
    Posts
    20


    Did you find this post helpful? Yes | No

    Smile

    Many thanks Bruce for your advice.

    I have done as you have suggested, including stopping Timer1 (T1CON = 0) before clearing, and all appears to be operating as it should. I am a happy chappie.....

    Once again many thanks. Sorted.....

    Chris.

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