430 header file explanation

Publisher:玉米哥哥Latest update time:2016-09-24 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
__no_init volatile union

{

  unsigned short WDTCTL; /* Watchdog Timer Control */

 

  struct

  {

    unsigned short WDTIS0 : 1; /* */

    unsigned short WDTIS1 : 1; /* */

    unsigned short WDTSSEL : 1; /* */

    unsigned short WDTCNTCL : 1; /* */

    unsigned short WDTTMSEL : 1; /* */

    unsigned short WDTNMI : 1; /* */

    unsigned short WDTNMIES : 1; /* */

    unsigned short WDTHOLD : 1; /* */

  }WDTCTL_bit;

} @0x0120;

 

enum {

  WDTIS0 = 0x0001,

  WDTIS1 = 0x0002,

  WDTSSEL = 0x0004,

  WDTCNTCL = 0x0008,

  WDTTMSEL = 0x0010,

  WDTNMI = 0x0020,

  WDTNMIES = 0x0040,

  WDTHOLD = 0x0080

};

 

The address unit of WDTCTL is 0x0120. What does the following paragraph mean? Commonwealth?

unsigned short WDTIS0 : 1; // 1 represents the field width (binary), which means WDTISO is either 1 or 0

The latter 8 bits share the memory unit with WDTCTL. Looking at the user guide, WDTCTL is a 16-bit register, WDTIS0 is located at bit0, and so on, WDTHOLD is bit7, and these bits are all 0 after reset. In MSP's C language, bit variables are not supported. In the IO header file of 430, bit variable access to registers is implemented in this way of definition.

 

WDTCTL=WDTPW+WDTHOLD; // Stop watchdog. How to explain this operation of stopping watchdog?

WDTCTL is obviously a watchdog control register, and WDTPW is a macro definition. The header file looks like this, #define WDTPW (0x5A00u). In the user guide, WDTCTL is a 16-bit register, and the names of bit15-bit8 are WDTPW, must be written as 0x5a, these 8 bits must be initialized to 0x5a. This sentence completes the initialization of WDTPW and sets WDTHOLD. The result of setting WDTHOLD is that the watchdog timer stops.

 

unsigned short WDTNMIES : 1; // Watchdog timer non-maskable interrupt edge selection bit.

unsigned short WDTNMI : 1; // Watchdog timer non-maskable interrupt selection

unsigned short WDTTMSEL : 1; //Watchdog timer mode selection

unsigned short WDTCNTCL : 1; // Watchdog timer counter clear selection bit

unsigned short WDTSSEL : 1; //Watchdog timer clock source selection

unsigned short WDTIS0 : 1; // Watchdog time interval selection

unsigned short WDTIS1 : 1; // time interval selection

 

PUC power up clear

Reference address:430 header file explanation

Previous article:The problem of debugging 430 routines not being able to be burned in is solved
Next article:What programmers should do every day

Recommended ReadingLatest update time:2024-11-23 12:38

Capacitive touch MSP430 circuit and LED drive circuit design explanation
  The MSP430 series of microcontrollers are famous for their low power consumption and rich peripheral modules. For capacitive touch applications, the PIN RO capacitive touch detection method of MSP430 supports direct connection of the IO port to the detection electrode without any peripheral devices, which greatly si
[Power Management]
Capacitive touch MSP430 circuit and LED drive circuit design explanation
In-depth understanding of MSP430 microcontroller IO
1. Overview of MSP430 MCU ports P1~P6 each group has 8 I/O ports, P3, P4, P5, P6 have I/O and other on-chip peripheral functions, each group has 4 registers. In addition to the above functions, P1 and P2 also have interrupt capabilities, each group has 7 registers. 2. PX Port 1. P1, P2 ports (1) PxDIR Input/ou
[Microcontroller]
MSP430F5529 (VII) Timer B
  Timer B and Timer A have a lot in common. When learning, remember to recall the knowledge about Timer_A. Note that there is only one Timer B in MSP430F5529.                                                                                                                                                                  
[Microcontroller]
MSP430F5529 (VII) Timer B
Design of Intelligent Digital Voltage Meter Based on MSP430 Single Chip Microcomputer
  Voltage measurement is very common in current electronic technology, and the accuracy and functional requirements for instruments are becoming increasingly higher. Especially when the strength of the measured signal differs greatly, it is necessary to ensure the measurement accuracy of the weak signal while taking i
[Microcontroller]
Design of Intelligent Digital Voltage Meter Based on MSP430 Single Chip Microcomputer
MSP430 MCU Practice - Digital Tube Display - 74HC595 Dynamic Scanning
1. Key points of learning:        Using 74HC595 for digital tube display can complete the function of digital tube display by occupying only 3 I/O ports of the microcontroller. The dynamic scanning method further saves hardware resources, and only 2 74HC595 can display up to 8 digital tubes. 2. Program execution effe
[Microcontroller]
Analysis of the significance of using M430/OS on the microcontroller to the system
introduction 1 The significance of using RTOS on MSP430 It is understandable that it is meaningless to use RTOS on MSP430. Because the hardware resources of MSP430 are limited (for example, MSP430F149 has only 2KB RAM), it is impossible to port any commercial operating system to MSP430. Currently, the only
[Microcontroller]
Getting Started with MSP430: Hardware Basics
A few points worth noting: 1. The reset signal is the starting point of the MCU. There are two reset signals for 430: the power-on reset signal POR and the power-on clear signal PUC. The POR signal is only used when the power is on and the RST/NMI reset pin is set to the reset function, and the system is reset when it
[Microcontroller]
An AC frequency detection system based on MSP430 single chip microcomputer
1 Introduction Since frequency signals have the advantages of strong anti-interference, easy transmission, and high measurement accuracy, many non-frequency sensor signals are converted into frequency quantities for measurement and processing. Therefore, frequency measurement methods are attractin
[Microcontroller]
An AC frequency detection system based on MSP430 single chip microcomputer
Latest Microcontroller Articles
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号