MSP430 Learning Notes (1) Watchdog

Publisher:快乐的舞蹈Latest update time:2015-09-17 Source: eefocusKeywords:MSP430 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1. The MSP430 series has rich timer resources: watchdog timer (WDT), basic timer (Basic Timer1), timer A (Timer_A) and timer B (Timer_B), real-time clock (RTC), etc.

a) Watchdog Timer: Basic timing, performs a controlled system restart when a program error occurs

b) Basic timer: basic timing, supporting software and various peripheral modules to work under low frequency and low power consumption conditions

c) Real-time clock: basic timing, calendar function

d) Timer A: Basic timing, supports multiple timing controls, multiple capture/compare functions and multiple output waveforms (PWM) at the same time, and can support serial communication in hardware

e) Timer B: basic timing, the functions are basically the same as Timer A, but more flexible and powerful than Timer A

2. Watchdog timer:

a) WDT register

a) Counting unit WDTCNT: 16-bit up-counting, the fixed-period pulse signal generated by the clock circuit selected by the MSP430 adds to the counter from the beginning until the count overflows. WDTCNT cannot be accessed directly by software, but must be controlled by the control register WDTCTL of the watchdog timer.

b) Control register WDTCL

  WDTCTL consists of two parts: the upper 8 bits are used as a password, and the lower 8 bits are the control commands for WDT operations.

                  To write the control command to operate WDT, you must first write the correct password. The password is 5AH. Errors will cause

The system is reset. No password is required to read WDTCTL, and it can be read directly. The low byte of the read data is the value of WDTCTL, and the high byte is always 69H.

                                      i. WDTHOLD: stop the watchdog, 1 stop

                                    ii. WDTNMIES: Watchdog NMI (non-maskable interrupt) trigger edge selection. When WDTNMI is 1, modifying this bit generates an interrupt, and when it is 0, it does not generate an interrupt. If this bit is 0, NMI is triggered on the rising edge, and if it is 1, NMI is triggered on the falling edge.

                                   iii. WDTNMI: Watchdog NMI selection, select the function of the RST/NMI pin. When it is 0, it is the reset function, and when it is 1, it is the NMI function.

                                   iv. WDTTMSEL: Watchdog working mode selection, 0 is watchdog mode, 1 is timer mode.

                                    v. WDTCNTCL: When it is 1, the watchdog counter is cleared.

                                   vi. WDTSSEL: Watchdog clock source selection, select SMCLK when it is 0, and select ACLK when it is 1.

                                 vii. WDTISx: Timing output of the watchdog timer, 00 counts 32768, 01 counts 8192, 10 counts 512, 11 counts 64.

c) Interrupt enable register IE1:

                                      i. NMIE: interrupt enable when 1

                                    ii. WDTIE: Watchdog timer enable. This bit is set to 1 when working in timer mode. It is not necessary to set this bit to 1 when working in watchdog mode because other interrupts may occupy this bit.

d) Interrupt flag register IFG1:

                                      i. NMIFG: 1 indicates an interrupt has occurred, 0 indicates no interrupt has occurred. This bit must be cleared by software.

                                    ii. WDTIFG: Watchdog timer interrupt bit. In watchdog mode, it needs to be cleared by software. In timer mode, it will be automatically cleared when an interrupt is processed. When it is 1, there is an interrupt, and when it is 0, there is no interrupt.

Keywords:MSP430 Reference address:MSP430 Learning Notes (1) Watchdog

Previous article:MSP430 Learning Notes (2) Timer A
Next article:12864 control forMSP430

Recommended ReadingLatest update time:2024-11-16 22:40

Problems with defining very large arrays in MSP430
The IAR compilation method causes the watchdog to overflow. The watchdog is already started when the microcontroller is powered on, but before entering the main function, the software will first initialize some of the data you use, such as arrays. If your array is defined to be large, the initialization time will be ve
[Microcontroller]
MSP430 single-chip microcomputer system application structure design and selection
1 Introduction to MSP430 MSP430 is a 16-bit microcontroller series product launched by TI, which has unique advantages in battery-powered low-power applications. Its operating voltage is 1.8~3.6 V, and the power consumption can be controlled at about 200μA during normal operation. The low-power mode ca
[Microcontroller]
MSP430 single-chip microcomputer system application structure design and selection
Use of MSP430 MCU Watchdog
1. The watchdog has three working modes: stop mode, timer mode and watchdog mode. 2. The clock sources that can be selected in the latter two modes are: SMCLK and ACLK. 3. When using the last two modes, pay attention to whether the watchdog can work under the state of the MCU. For example, when the MCU is in LPM3,
[Microcontroller]
MSP430 porting printf and scanf
Hardware Introduction: The hardware part only needs character input and output devices: scanf reads characters from the input character device, and printf outputs to the character output device. Here, the character input device I chose is the hyperterminal, which is connected to the microcontroller through the serial
[Microcontroller]
MSP430 porting printf and scanf
MSP430F5529 (I) General I/O port settings-2
This section talks about external interrupts. Reading the introduction and understanding the program is the best way. External interrupts are the lowest priority interrupts of MSP430 and are maskable interrupts. They are relatively simple to use.   1.2.7 Simple port interrupts (external interrupts)                
[Microcontroller]
Design of cardiopulmonary auscultation skills training system based on MSP430
Based on the development of modern medical simulation teaching, the cardiopulmonary auscultation skill training system based on MSP430 has changed the past use of radio frequency and special stethoscopes to imitate the cardiopulmonary auscultation process, and the operation is more realistic in the clinical real env
[Microcontroller]
Design of cardiopulmonary auscultation skills training system based on MSP430
How to solve the problem of "INF cannot find the required section" when installing MSP430 USB JTAG
I have done experiments before and found that the INF error of this emulator appeared on my computer. I guessed that it might be the system problem, because I have taken the emulator to a computer with the same non-simplified system and there was no problem. Today I finally found a solution: 1. First, follow the steps
[Microcontroller]
Clock signal of MSP430 microcontroller
  MSP430 has three clock signals: MCLK system main clock; SMCLK system sub-clock; ACLK auxiliary clock.      (1) MCLK system main clock. In addition to the CPU operation using this clock, peripheral modules can also use it. MCLK can select the clock signal generated by any oscillator and divide it by 1, 2, 4, or 8 as
[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号