MSP430 PIN Operation Register

Publisher:梦中徐来Latest update time:2017-11-03 Source: eefocusKeywords:MSP430 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. P port register:

   (1) PxDIR Input/Output Direction Register

            (0: Input mode 1: Output mode)

   (2) PxIN input register

           The input register is a read-only register. The user cannot write to it. The input signal of the I/O port can only be known by reading the contents of the register.

   (3) PxOUT output register

          The contents of the registers are not affected by pin direction changes.

   (4) PxIFG interrupt flag register

            (0: No interrupt request 1: Interrupt request)

            This register has 8 flag bits, corresponding to whether the corresponding pin has a pending interrupt request;

            These 8 interrupt flags share one interrupt vector. The interrupt flags will not be reset automatically and must be reset by software.

            The time of the external interrupt event must be greater than or equal to 1.5 times the MCLK time to ensure that the interrupt request is accepted;

   (5) PxIES interrupt trigger edge selection register

           (0: rising edge interrupt 1: falling edge interrupt)

   (6) PxSEL function selection register

           (0: Select pin as I/O port 1: Select pin as peripheral module function)

   (7) PxREN pull-up/pull-down resistor enable register

           (0: Disable 1: Enable)

 

(1) All P ports can be used as general IO ports

(2) All P ports can perform byte operations and bit operations

                Byte-wise operations:

                 Example: P1DIR=0xff; //Use P1 port as output port

                                  PIOUT=0x20; //P1 port output 0x20

                                  P1DIR=0x00; //Use P1 port as input port

                                  data=P1IN //Read the external input value of P1 port

                Bitwise operations:

                 Example: P1DIR=BIT0; //Use P1.0 as output port

                            P1OUT|=BIT0; //P1.0 output 1

                            P1OUT&=~BIT0; //P1.0 output 0

                            P1DIR&=~BIT0 //Use P1.0 as input

                            data=P1IN&BIT0 //Read the external input value of P1.0 port


Keywords:MSP430 Reference address:MSP430 PIN Operation Register

Previous article:MSP430: Introduction to Interrupts
Next article:SPI hardware communication configuration of stm8s10X

Recommended ReadingLatest update time:2024-11-16 16:43

MSP430 PIN Operation Register
1. P port register:    (1) PxDIR Input/Output Direction Register             (0: Input mode 1: Output mode)    (2) PxIN input register            The input register is a read-only register. The user cannot write to it. The input signal of the I/O port can only be known by reading the contents of the register.    (3) P
[Microcontroller]
TV backlight 3D infrared signal transmission solution based on MSP430G2303
Liquid crystal (LCD) TVs have become popular in the home appliance consumer market, because LCD displays require backlights, and traditional CCFL backlights have been gradually replaced by LED backlights. In LED backlight solutions, an MCU is often required to control the LED Driver. At the same time, as the market sha
[Microcontroller]
TV backlight 3D infrared signal transmission solution based on MSP430G2303
MSP430 interrupt priority and interrupt nesting
The interrupt priority of MSP430 is arranged according to the size of the vector where it is located. The higher the interrupt vector address, the higher the priority. However, the default MSP430 cannot nest interrupts. In order to respond to higher priority interrupts when executing a certain interrupt, it is necessar
[Microcontroller]
Defining your own flags with bit segments in MSP430
   When writing programs, you often need to define flags (bits) yourself. If each flag occupies one byte, it will take up a lot of space. You can use bit segments to implement this, and concentrate several flags in one storage unit. 1. Definition of bit segment   I won't go into detail about the definition of bit se
[Microcontroller]
Electric shaver system design based on MSP430x09x MCU
  1 Introduction to MSP430x09x   MSP430x09x is the first 0.9V operating voltage MCU in the MSP430 series. This series is powerful and can be easily applied to micro motor control, infrared transmission, power supply detection and other occasions. In addition, its 0.9V operating characteristics can be widely used in
[Microcontroller]
Electric shaver system design based on MSP430x09x MCU
Design of ambient light adaptive LED display based on MSP430F169
This design mainly realizes that the LED display changes its brightness with the ambient light to avoid unclear display during the day or dazzling at night due to too bright; and communicates with the host computer. This system consists of MSP430F169 microcontroller, 16*32 common anode LED dot matrix display, row dr
[Industrial Control]
Design of ambient light adaptive LED display based on MSP430F169
Intelligent battery monitoring system based on MSP430F series microcontroller
1 Introduction In the maintenance of battery packs in power systems, in addition to the conventional floating charge management of batteries, it is also necessary to inspect the terminal voltage and single-cell voltage of the battery pack; regularly perform constant current discharge tests on the battery pack t
[Power Management]
Intelligent battery monitoring system based on MSP430F series microcontroller
MSP430 FLASH reading and writing
The FLASH memory module of the MSP430 FLASH microcontroller is divided into several segments according to different capacities, among which the information memory SegmengA and SegmentB each have 128 bytes, and the other segments have 512 bytes. The address of SegmentB is: 0x01000h to 0x107F, and the address of SegmentA
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号