fet430_oa0_comp_01.c
来自「msp430F435做的医疗器械,包括语音模块,知识源于网络」· C语言 代码 · 共 36 行
C
36 行
//******************************************************************************
// MSP-FET430P430 Demo - OA0 Configured For Comparator Mode
//
// Description; Configure OA0 of the MSP430FG439 for Comparator mode. In this
// example, the OA0 is configured as a comparator. The comparator reference is
// on the - input and comes from the integrated R ladder. The reference level
// is selected with the OAFBR bits. The + terminal is connected to the OA0I0
// signal at the pin.
// //* MSP430FG439 Device Required*//
//
// MSP430FG439
// -------------------
// /|\| XIN|-
// | | |
// --|RST XOUT|-
// | |
// | P6.0/A0/OA0I0|<- Input
// | P6.1/A1/OA0O|-> OA0 Output (comparator mode)
// | |
//
// M.Mitchell
// Texas Instruments, Inc
// April 2004
// Built with IAR Embedded Workbench Version: 2.21B
//******************************************************************************
#include <msp430xG43x.h>
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
OA0CTL0 = OAPM_1 + OAADC1; // Select inputs, power mode
OA0CTL1 = OAFC_3 + OAFBR_1 + OARRIP; // Mode, OAFBRx sets level
LPM3; // LPM3
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?