msp430x22x4_adc10_17.c

来自「MSP430的开发程序的例子+中文注释」· C语言 代码 · 共 19 行

C
19
字号
//******************************************************************************
//   MSP430F22x4 Demo - ADC10, DTC Sample A0 -> TA1, AVcc, HF XTAL
//
//   Description: Use DTC to sample A0 with reference to AVcc continously and
//   directly transfer code to Timer_A CCR1 output unit. Timer_A has been
//   configured for 10-bit PWM mode. CCR1 duty cycle is automatically
//   proportional to ADC10 A0. No CPU resources are required and in this
//   example the CPU is turned off. ADC10 A0 sampling and transfer to TA1 done
//   continuously and automatically by the DTC.
//   MCLK = SMCLK = HF XTAL = 8MHz, ACLK = (HF XTAL)/8
//   As coded, ADC10CLK = ACLK/8 = 125kHz, and each A0 sample and transfer to
//   TA1 requires 77 ADC10CLK. With an 8MHz HF XTAL, loop transfer rate is
//   125k/77 = 1623/second.
//   //* An external HF XTAL on XIN XOUT is required for ACLK *//
//
//                MSP430F22x4
//             -----------------
//         /|\|              XIN|-
//          | |                 | HF XTAL (3 

⌨️ 快捷键说明

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