1506 views|0 replies

3836

Posts

19

Resources
The OP
 

MSP430G2553 pinout for easy use [Copy link]

1. Select pin function -- PxSEL, PxSEL2

PxSEL2 PxSEL pin function

0 0 Used as IO port

0 1 Used as the first function pin

1 0 Reserved, refer to the manual of the specific model

1 1 Used as the second function pin

When setting a pin as a peripheral function, the chip will not automatically set the input and output direction of the pin. The user needs to set the direction register according to the function.

PxDIR.

2. Select pin input/output direction -- PxDIR

Bit = 0: Input

Bit = 1: Output

3. Select whether to enable pull-up and pull-down resistors on the pin -- PxREN

Bit = 0: Disable

Bit = 1: Enable

4. Output register -- PxOUT

Bit = 0: Output low level or pull down

Bit = 1: Output high level or pull-up

5. Pin Status Register -- PxIN

Bit = 0: The pin is currently low

Bit = 1: The pin is currently high

P1DIR|=BIT1+BIT3+BIT4; // Set P1.1, P1.3, and P1.4 as outputs (set to 1)

P1DIR &=~ (BIT5+BIT6+BIT7); // P1.5, P1.6, P1.7 are set as input (set to 0)

P1OUT ^= BIT1; //Invert

This post is from Microcontroller MCU
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list