This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] MSP430FR5994:Code Composer 示例中的计时器问题

Guru**** 2539500 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1043769/msp430fr5994-timer-question-in-code-composer-example

器件型号:MSP430FR5994
主题中讨论的其他器件:MSPWARE

我对 Timer_A 配置有疑问。 附件是 MSPWare 中示例 msp430fr599x_ADC12_11中的代码片段:

    ADC12CTL0 = ADC12SHT0_0 | ADC12ON;      // Sampling time, S&H=4, ADC12 on
    // Use TA0.1 to trigger, and repeated-single-channel
    ADC12CTL1 = ADC12SHP | ADC12SHS_1 | ADC12CONSEQ_2;
    // A1 ADC input select; Vref+ = AVCC
    ADC12MCTL0 = ADC12INCH_1 | ADC12EOS;

    ADC12IER0 |= ADC12IE0;                  // Enable ADC interrupt
    ADC12CTL0 |= ADC12ENC | ADC12SC;        // Start sampling/conversion
 
 // Configure Timer0_A3 to periodically trigger the ADC12
    TA0CCR0 = 2048-1;                       // PWM Period
    TA0CCTL1 = OUTMOD_3;                    // TACCR1 set/reset
    TA0CCR1 = 2047;                         // TACCR1 PWM Duty Cycle
    TA0CTL = TASSEL__ACLK | MC__UP;         // ACLK, up mode

该计时器用于触发 ADC 采集。 我对周期与占空比相同感到困惑。 计时器输出在开启时似乎关闭。 这是正确的、如果是、脉冲持续时间是多少? 一个时钟周期? 此应用是否需要短接?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    我认为占空比不会对该代码产生影响。 定时器在一个周期结束时将产生一个中断。 该中断将触发 ADC 进行转换。  

    此致、

    现金 Hao