Searching \ for 'Tmr1 interrupt on a 16C73' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/ints.htm?key=interrupt
Search entire site for: 'Tmr1 interrupt on a 16C73'.

Truncated match.
PICList Thread
'Tmr1 interrupt on a 16C73'
1997\03\20@155652 by mike

flavicon
picon face
Hi,

I am having problems with the interrupt on Tmr1 on a C73.

I have it configured to interrupt from a RC0, I set Tmr1H
and Tmr1L to $FF.

The first time a +ve edge comes along I get the interrupt,
which is then followed by 3 other +ve edges, I do what I have
to do, then on leaving the interrupt handler set Tmr1H and
Tmr1L back to $FF and clear the Tmr1IF ready for the next time.

The next +ve edge comes along and gets ignored. The one after
that causes an interrupt and off I go, but this time I am
one edge out of sync.

Anyone got any ideas?

Thanks and regards,


Mike Watson

1997\03\20@190855 by Andrew Warren

face
flavicon
face
Mayes uk <spam_OUTmikeTakeThisOuTspamd-m-g.demon.co.uk> wrote:

> I am having problems with the interrupt on Tmr1 on a C73.
>
> I have it configured to interrupt from a RC0, I set Tmr1H
> and Tmr1L to $FF.
>
> The first time a +ve edge comes along I get the interrupt,
> which is then followed by 3 other +ve edges, I do what I have
> to do, then on leaving the interrupt handler set Tmr1H and
> Tmr1L back to $FF and clear the Tmr1IF ready for the next time.
>
> The next +ve edge comes along and gets ignored. The one after
> that causes an interrupt and off I go, but this time I am
> one edge out of sync.
>
> Anyone got any ideas?

Mike:

Is it possible that, rather than ignoring 3 edges while you're in
your interrupt service routine, you're actually ignoring FOUR?  If
you're still in the interrupt routine when the edge you want comes
through, clearing the TMR1IF flag will keep it from being processed.

I don't know how you're ignoring those three edges, but if you're
actually counting those edges in the ISR, you should clear the TMR1IF
flag IMMEDIATELY after seeing the third ignored edge.  That way, if
the fourth edge comes through before you exit the ISR, it'll generate
an interrupt as soon as your RETFIE is executed.

Did that make sense?  If not, let me know and I'll rephrase it... I'm
pretty tired right now.

-Andy

=== Andrew Warren - .....fastfwdKILLspamspam@spam@ix.netcom.com
=== Fast Forward Engineering, Vista, California
=== http://www.geocities.com/SiliconValley/2499

1997\03\21@044541 by mike

flavicon
picon face
In message  <199703210007.SAA21738spamKILLspamdfw-ix9.ix.netcom.com> .....PICLISTKILLspamspam.....MITVMA.MIT.EDU
writes:
> Mike:
>
> Is it possible that, rather than ignoring 3 edges while you're in
> your interrupt service routine, you're actually ignoring FOUR?  If
> you're still in the interrupt routine when the edge you want comes
> through, clearing the TMR1IF flag will keep it from being processed.
>
> I don't know how you're ignoring those three edges, but if you're
> actually counting those edges in the ISR, you should clear the TMR1IF
> flag IMMEDIATELY after seeing the third ignored edge.  That way, if
> the fourth edge comes through before you exit the ISR, it'll generate
> an interrupt as soon as your RETFIE is executed.
>
> Did that make sense?  If not, let me know and I'll rephrase it... I'm
> pretty tired right now.
>
Andy,

That made perfect sense - thanks.

I am counting the edges in the ISR. The edges are about 100us
apart. The next group is some 5ms later. I have a port pin
set when I enter the ISR and clear when I leave, and I have
left the ISR before the 1st edge of the second group.

Regards,


Mike Watson

1997\03\21@205315 by The LeBlanc's

flavicon
face
----------
{Quote hidden}

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