Sorry. I edited my post. Now the linked is fixed.
I take care of TRIS, PORTA, OPTION_REG, WPUA before I use INTCON=%00001000.Probably it would be safer to clear all interrupts flags before enabling any of them. When you enable the internal pull-up, this could trigger an interrupt.
Your suggestion would be to use INTCON=0 before any other register setting and end with INTCON=%00001000
?
I will try this.
That's what I was doing in my code (in fact I enable porta change interrupts at the same time I clear all int flags). Still an interrupt is occuring but my int handler does not see what pin triggered the int so the handler is left with no action taken.would suggest
enable the internal pull-up
clear interrupt flags
enable interrupts.
Maybe there is something else triggering an int (a timer???) but only porta change interrupts
are enabled.
Oh boy, these interrupts are so tricky...
No because I need to enable and disable WPU in software.Did you also tried with real pull-up resistors?
Bookmarks