Basic C programming knowledge in msp430 and Stm32

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.