Branch Unspecified
09 May 2008

Ignore Input from PIC

I'm using the PIC 16-series to program something. I was wondering if anyone knows how I can ignore a certain input... E.g. i want to turn off the 5th bit of Port B(which I have initialised as my input) so that the program code that I have written may ignore any input at that pin.. How may I be able to do that?... and ofcourse, switch it on again at a later time in the program...
In summary:
1) ignore/turn off bit-5 of portB
2)switch on/enable it back again

any ideas?'s urgent...


Branch Unspecified
10 years ago
Assuming you want to do this in C then mask the 5th bit off. If the variable 'A' is you input register then:

A &= 0x0010;

Add a conditional to turn it on and off.


Share this content on your social channels -

Only logged in users can reply.