msp430x22x4_adc10_18.c

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

C
21
字号
//******************************************************************************
//   MSP430F22x4 Demo - ADC10, DTC Sample A1/0 -> TA1/2, 2.5V, HF XTAL
//
//   Description: Use DTC to sample both A1 and A0 with reference to internal
//   2.5V Vref continously and directly transfer codes to Timer_A CCR1 and CCR2
//   output units. Timer_A has been configured for 10-bit PWM mode. TACCR1 and
//   TACCR2 duty cycles are automatically proportional to ADC10 A1 and A0
//   respectively. No CPU resources are required and in this example the CPU is
//   turned off. ADC10 A1/A0 sampling and transfers to TA1/TA2 done continously
//   and automatically by the DTC.
//   MCLK = SMCLK = HF XTAL = 8MHz, ACLK = (HF XTAL)/8
//   As coded, ADC10CLK = ACLK/8 = 125kHz, and each Ax sample and transfer to
//   TAx requires 77 ADC10CLK. With an 8MHz HF XTAL, loop transfer rate is
//   125k/(2*77) = 812/second.
//   //* An external 8MHz XTAL on XIN XOUT is required for ACLK *//
//   //* Min Vcc required varies with MCLK frequency - refer to datasheet *//
//
//                MSP430F22x4
//             -----------------
//         /|\|              XIN|-
//          | |                 | HF XTAL (3 

⌨️ 快捷键说明

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