Part Number: MSP430FR5994
I've seen code that sets an GPIO pin low defined two ways
P1DIR |= BIT0; //set P1.1 as an output
P1OUT &= ~BIT0; //drive P1.1 low
and (using the driverlib)
GPIO_setOutputLowOnPin (GPIO_PORT_P1, GPIO_PIN2);
GPIO_setAsOutputPin)GPIO_PORT_P1, GPIO_PIN2);
I assume the first approach can potentially cause an output glitch (enabling the output pin before setting its state). . The second approach (driverlib) averts a potential output glitch by setting the pin state before enabling the output, Can anyone confirm my rationale? It seems obvious but I've seen the first approach in so many examples I am questioning if I really understand this (I guess it doesn't matter if the pin is driving an LED).
thanks jim