Re: [bascom] INT0 causes RESET ?


From "John Johnson" <jj5412@earthlink.net>
Date Sat, 16 Dec 2000 17:29:16 -0500

----- Original Message -----
From: "Michael Wieser" <m.k.w@nextra.at>
To: <bascom@grote.net>
Sent: Saturday, December 16, 2000 12:46 PM
Subject: Re: [bascom] INT0 causes RESET ?


> >Apparently this got lost the first time I sent it. Apologies if it's a
dupe.
>
> Apologied,  (at least from my point of view)
> but no apologies for no info which bascom (avr, 51) or compilerrelease nor
> info about the CPU, Spped of the CPU and other stuff..... (discussed only
> some days ago here on the list !! )

True. I forgot this is a BASCOM list, and not a BASCOM-AVR list. So:

AT90S2313-10PI (i.e. AVR) clocked at 4 MHz

BASCOM-AVR IDE Version : 1.11.0.0
Compiler: Version 1.11a
Serial : Serial  DEMO

> anyway, it seems that your push button does bounce(?) and the cpu is very
> fast, so it "sees" this bouncing as 2 independent keystrokes, try  to
> debounce the keys.

Sounds feasible, except:
I'm not using the DEBOUNCE instruction.
When in the interrupt service routine (ISR) there are two possible
scenarios. If another interrupt is ignored while in the ISR, it would not
cause the problem. Another possibility is an interrupt causing another jump
to the ISR while already in the ISR. This could in theory blow the stack if
too many interrupts occured. I don't believe this to be the case since the
problem occurs with an IR sensor connected to the pin (which doesn't
bounce). Should I explicity turn off interrupts (or this interrupt) at the
start of the ISR, then re-enable at the end? Think I'll try that.

Thanks for the reply and the reminder.

Regards,
  JJ