1099 views|0 replies

3836

Posts

19

Resources
The OP
 

About MSP430-Timer WDT [Copy link]

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.

Their basic functions are as follows:

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 (RTC): basic timing and calendar functions;

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 it is more flexible and powerful than Timer A;

Watchdog Timer (WDT):


a)WDT register

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 passwords, and the lower 8 bits are control commands for WDT operations. To write control commands for WDT operations, you must first write the correct password. The password is 5AH, and an error will cause the system to reset. Reading WDTCTL does not require a password and can be read directly. The low byte of the read data is the value of WDTCTL, and the high byte is always 69H.

1. WDTHOLD: stop watchdog, 1 stop

2. 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.

3. 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.

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

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

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

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

c) Interrupt enable register IE1:

1. NMIE: interrupt enable when 1

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

d) Interrupt flag register IFG1:

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

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

This post is from Microcontroller MCU
 

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