CrazyEngineers
  • eccentronix
    eccentronix

    MemberMay 1, 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?...it's urgent...
    😕
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • arga

    MemberMay 9, 2008

    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.

    Frank
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register