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

📄 msp430x22x4_tb_09.c

📁 msp430 22x c语言 编程例程
💻 C
字号:
//******************************************************************************
//   MSP430F22x4 Demo - Timer_B, Toggle P4.0-2, Cont. Mode ISR, HF XTAL ACLK
//
//   Description: Use Timer_B CCRx units and overflow to generate eight
//   independent timing intervals. For demonstration, TBCCR0-2 output
//   units are optionally selected with P4.0-2 respectively in toggle
//   mode. As such, these pins will toggle when respective TBCCRx registers
//   match the TBR counter. Interrupts are also enabled with all TBCCRx units,
//   software only adds offset to next interval - as long as the interval
//   offset is aded to TBCCRx, toggle rate is generated in hardware. Timer_B
//   overflow ISR is used to toggle P1.0 with software. Proper use of the
//   TBIV interrupt vector generator is demonstrated.
//   MCLK = ACLK = TBCLK = LFXT1 = HF XTAL
//   //* Min Vcc required varies with MCLK frequency - refer to datasheet *//
//
//   As coded with TBCLK= HF XTAL and assuming HF XTAL= 8MHz, toggle rates are:
//   P4.0 = TBCCR0 = 8MHz/(2*200) = 20kHz
//   P4.1 = TBCCR1 = 8MHz/(2*400) = 10kHz
//   P4.2 = TBCCR2 = 8MHz/(2*500) = 8000Hz
//   P1.0 = overflow = 8MHz/(2*65536) = 61Hz
//
//                MSP430F22x4
//             -----------------
//         /|\|              XIN|-
//          | |                 | HF XTAL (3 

⌨️ 快捷键说明

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