> > Best Pic'ers, > > I have a problem when using interrupts on my PIC16F84. > > I have a button connected to pin6 (pulled high and grounded when = > pressed), that's RB0 or Interruppt 'INTE' > > When I press the button it goes into the interrupt function, just as it = > shall, but then it doesn=B4t return to my forever loop in the main = > function. > > However, if I press the button again it goes into the interrupt = > function again... where in the world does it go after my interrupt? > > If I wait like two or three minutes after an interrupt occurs it = > returns to my main function....as I want... but why does it take so = > long time? I only toggle a LED in my interrupt function, clears the = > INTF bit and then end of function. > > > H E L P! Two things right off the top of my head. 1) It's very unlikely that your button is debounced. So pushing it will generate a bunch of pulses. Check out debounce routines in the PICLIST archive. Most revolve around waiting a period of time after the initial pulse and then check the botton again. 2) Do you have a RETFIE at the end of your interrupt routine? If not then your PIC will cycle through all available memory until it hits your mainline loop again. Check out those two items. Hope it helps. BAJ -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu