📄 fet430_dac12_01.c
字号:
//*******************************************************************************
// MSP-FET430P430 Demo - DAC12.0 Output 1V
//
// Description; Using DAC12.0 and 2.5V ADC12REF reference with a gain of 1,
// ouput 2V on P6.6. Ouput accuracy is specified by that of the ADC12REF.
//
// MSP430FG439
// -----------------
// /|\| XIN|-
// | | |
// --|RST XOUT|-
// | |
// | DAC0/P6.6|--> 1V
// | |
//
// M.Buccini
// Texas Instruments, Inc
// June 2004
// Built with IAR Embedded Workbench Version: 2.21B
//******************************************************************************
#include <msp430xG43x.h>
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
ADC12CTL0 = REF2_5V + REFON; // Internal 2.5V ref on
DAC12_0CTL = DAC12IR + DAC12AMP_5 + DAC12ENC; // Internal ref gain 1
DAC12_0DAT = 0x0666; // 1V
_BIS_SR(LPM4_bits); // Enter LPM4
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -