Hi,
I'm aware this is a basic question as I'm a newbie to uC.
I've spent an hour trying to figure out why the first run of my program runs ok, while the subsequently triggerred loops don't. My P1.0 didn't want to drop to logical zero upon P1OUT &= ~BIT0, in the previous run I turned on the pull-up resistor:
Code:
P1DIR &= ~BIT0; //set P1.0 as input P1REN |= BIT0; //enable pull-up
... P1DIR |= BIT0; //set P1.0 as output P1OUT &= ~BIT0; //here I'd expect the zero logical signal on the output,
//but it's reported by logic analyzer as 1 -
// - I guess it's pulled up to the Vcc with the P1REN |= BIT0, is that correct?
So I wonder, why isn't this pull-up resistor automatically disabled when the pin gets output mode? What is the real life use of such case?