I am programming PIC18F4520, and using picos18 for multitasking. I need to control buttons with PORTB. I am using interrupts, b开发者_JS百科ut I am facing a problem.
Out of nowhere (while I am not pressing buttons), my interrupt handler executes. My pic handles many interrupts.
What could be the reason??
You need to tell as which kind of hardware interrupt you are using!
I suppose on RB port change interrupt. So did you enable pull-ups resistors on PORTB? If you didn't than PORTB input pins have floating potential.
精彩评论