Hi everyone!
I am just getting close to c language with mikro c compiler with pic16f887 .
At present, Im finding problems trying to initialise my portb pin state change interrupt. I have tried reading datasheet but cant find solution.I only know there is a intcon, config_reg, iocb and cant fix them together .I need ur help to configure It.
thanks
You're looking to set RBIE and GIE in the intcon reg, The IOCB sets which pins you want to affect a change. once an interrupt occurs clear RBIF in the intcon reg.
REMEMBER to clear your ANSELH reg as some RB pins are analogue inputs by default...
Sorry!! The option reg is for enabling weak pullups and INT pin triggering on portb