⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 msp430x21x2_ta1_09.c

📁 msp430f21x2程序例程
💻 C
字号:
//******************************************************************************
//  MSP430F21x2 Demo - Timer1_A2, Toggle P1.0, 3.6,3.7, Cont. Mode ISR, HF XTAL ACLK
//
//  Description: Use Timer1_A2 CCRx units and overflow to generate four
//  independent timing intervals. For demonstration, TA1CCR0, TA1CCR1
//  output units are optionally selected with port pins P3.6 and P3.7
//  in toggle mode. As such, these pins will toggle when respective TA1CCRx
//  registers match the TA1R counter. Interrupts are also enabled with all
//  TA1CCRx units, software loads offset to next interval only - as long as the
//  interval offset is added to TA1CCRx, toggle rate is generated in hardware.
//  Timer1_A1 overflow ISR is used to toggle P1.0 with software. Proper use
//  of the TA1IV interrupt vector generator is demonstrated.
//  ACLK = MCLK = TA1CLK = LFXT1 = HF XTAL
//  //* Min Vcc required varies with MCLK frequency - refer to datasheet *//
//
//  As coded with TACLK= HF XTAL and assuming HF XTAL = 8MHz, toggle rates are:
//  P1.1 = TA1CCR0 = 8MHz/(2*200) = 20kHz
//  P1.2 = TA1CCR1 = 8MHz/(2*1000) = 4kHz
//  P1.0 = overflow = 8MHz/(2*65536) = 61Hz
//
//               MSP430F21x2
//            -----------------
//        /|\|              XIN|-
//         | |                 | HF XTAL (3 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -