Searching \ for 'Pulsewidth measuring' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=pulsewidth+measuring
Search entire site for: 'Pulsewidth measuring'.

Truncated match.
PICList Thread
'Pulsewidth measuring'
2000\01\22@073025 by Peter Keller

flavicon
face
I'm using Timer1 and the #INT_CCP2 interrupt for measuring pulsewidth.
As soon as the frequency drops below approx. 15 Hz there is a
zerocrossing (overflow) in timer1.
Any idea how to detect this ?
Peter Keller

2000\01\22@095841 by Ken Webster

flavicon
face
>I'm using Timer1 and the #INT_CCP2 interrupt for measuring pulsewidth.
>As soon as the frequency drops below approx. 15 Hz there is a
>zerocrossing (overflow) in timer1.
>Any idea how to detect this ?
>Peter Keller

Use TMR1IF.  Even if you don't enable the interrupt (by setting PIE1:TMR1IE)
the interrupt flag (PIR1:TMR1IF) will still get set when the count
overflows.  Clear PIR1:TMR1IF prior to taking a reading .. then if it is set
after the capture the count overflowed so add 0x10000 to your result.

Cheers,

Ken

2000\01\22@100654 by Ken Webster

flavicon
face
I wrote:
>>I'm using Timer1 and the #INT_CCP2 interrupt for measuring pulsewidth.

>>As soon as the frequency drops below approx. 15 Hz there is a
>>zerocrossing (overflow) in timer1.
>>Any idea how to detect this ?
>>Peter Keller
>
>Use TMR1IF.  Even if you don't enable the interrupt (by setting
PIE1:TMR1IE)
>the interrupt flag (PIR1:TMR1IF) will still get set when the count
>overflows.  Clear PIR1:TMR1IF prior to taking a reading .. then if it is
set
>after the capture the count overflowed so add 0x10000 to your result.


Do check the count captured.  If it is large (near 0xffff) then ignore the
PIR1:TMR1IF even if it is set since it was probably set shortly after the
capture event and before your interrupt service routine could get a look at
it.

2000\01\22@103610 by Peter Keller

flavicon
face
Thanks.

Ken Webster schrieb:

{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...