1. Trang chủ
  2. » Kỹ Thuật - Công Nghệ

msp430g2xx1 wdt 01

1 115 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 1
Dung lượng 1,37 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Toggle rate // is approximately 30ms based on default DCO/SMCLK clock source // used in this example for the WDT.. Dang // Texas Instruments Inc.

Trang 1

//****************************************************************************** // MSP430G2xx1 Demo - WDT, Toggle P1.0, Interval Overflow ISR, DCO SMCLK

//

// Description: Toggle P1.0 using software timed by the WDT ISR Toggle rate // is approximately 30ms based on default DCO/SMCLK clock source

// used in this example for the WDT

// ACLK = n/a, MCLK = SMCLK = default

//

// MSP430G2xx1

//

-// /|\|

XIN|-// | | |

// |RST

XOUT|-// | |

// | P1.0| >LED

//

// D Dang

// Texas Instruments Inc

// October 2010

// Built with CCS Version 4.2.0 and IAR Embedded Workbench Version: 5.10

//******************************************************************************

#include <msp430g2231.h>

void main(void)

{

WDTCTL = WDT_MDLY_32; // Set Watchdog Timer interval to

~30ms

IE1 |= WDTIE; // Enable WDT interrupt

P1DIR |= 0x01; // Set P1.0 to output direction _BIS_SR(LPM0_bits + GIE); // Enter LPM0 w/ interrupt

}

// Watchdog Timer interrupt service routine

#pragma vector=WDT_VECTOR

interrupt void watchdog_timer(void)

{

P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR }

Ngày đăng: 26/12/2017, 07:24

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w