Re: [bascom] INT0 causes RESET ?
Hi
>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 !! )
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.
>> I'm having trouble understanding interrupts. It appears that when the
>> interrupt service routine for INT0 is called, the whole program is started
>> over at the beginning.
>>
>> For example, this program:
>>
>> Config Pind.2 = Input
>> Portd.2 = 1
>>
>> Config Int0 = Falling
>> On Int0 Int0_isr
>>
>> Print "Ready"
>>
>> Do
>> ' wait
>> Loop
>>
>> Int0_isr:
>> Print "*";
>> Return
>>
>> with a pushbutton connected to pind.2 produces this output (sporadically):
>> Ready
>> **Ready
>> *Ready
>> *Ready
>>
>> *Ready
>> *Ready
>> *Ready
>>
>> My thinking is it should sit in the DO...LOOP until INT0 falls, jump to
>> Int0_isr, then return back into the DO...LOOP.
>> Obviously I must be missing something. Can anyone help?
>>
>> Thanks,
>> JJ
>> Be Kind, Be Careful, Be Yourself
>> --
>> Solid, reliable software at reasonable prices
>> http://www.johnjohnsonsoftware.com
>>
>>
>
>
>
Michael Wieser
m.k.w@nextra.at
Service and Audiodesign