Help setting an output pin high.

Discussion in 'Programmer's Corner' started by ATM, Jan 13, 2010.

  1. ATM

    Thread Starter Member

    Oct 8, 2009
    Greetings all,

    I'm in the middle of a project at the minute and i'm stumped. Basically i'm using one of the internal comparators of the PIC16F88 to monitor a sensor input on pin RA1, when this input drops below the reference voltage, I want to induce an output on pin RB4. This part of my project works correctly.

    However I also want to set pin RB4 high if another input pin RA4 is high. I have wrote the following 'C' code in Source Boost;
    If the result of the comparison is high I am receiving an output on Pin RB4, but if the result of the comparison is low and I set Pin RA4 high, there is no output on pin RB4 when I plug the PIC into my circuit which is what I require.

    Can anyone see anything wrong with the above code?