Why I use P1out ^= 0x01; and p1out = 0x01
^ is a different or calculated symbol so each operation is reversed. This operator, however, is maintained at a state of 1.
P1out|=bit6 the value of P1out if it is 1, if it is 0, take the value of BIT6
What do you mean, p1out |= BIT7?
Define the P1.7, which is different from the definition of 51, 51 needs sbit, if you need to define p1.2,p1.3, you can write: P1out |=bit2 + BIT3, and then you can operate on it, such as P1out ^= BIT0, so P1.0 output high level, 1 output is high
P1dir |= BIT7, what does that mean? What does BIT7 represent?
Set P1.7 to output, BIT7 is 0x40, or 1 is output.
MSP430 single-chip programming, "~" and "^" What is meant?
P4out &= ~bit0 equivalent to p4out = p4out ^ (~bit0); The bitwise AND the other IO ports of this P4 output state unchanged only changed the P4 BIT0 to Low
P4out ^= ~bit0 equivalent to p4out = p4out ^ (~bit0); Bitwise XOR OR
P4out |= ~bit0 equivalent to p4out = P4out | (~BIT0); Bitwise OR
P1out |= 0x01;//is P1.0 to high
P1out ^= 0x01;//is P1.0 take the reverse
P1out &= ~0x01;//is P1.0 to low
Basic C programming knowledge in msp430 and Stm32