Quote Originally Posted by mister_e View Post
The link to the code is broken
Sorry. I edited my post. Now the linked is fixed.

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.
I take care of TRIS, PORTA, OPTION_REG, WPUA before I use INTCON=%00001000.
Your suggestion would be to use INTCON=0 before any other register setting and end with INTCON=%00001000
?
I will try this.



would suggest
enable the internal pull-up
clear interrupt flags
enable interrupts.
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.
Maybe there is something else triggering an int (a timer???) but only porta change interrupts
are enabled.
Oh boy, these interrupts are so tricky...

Did you also tried with real pull-up resistors?
No because I need to enable and disable WPU in software.