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.

TMS470MF03107: PWM及其Capture功能配置疑问

Part Number: TMS470MF03107
    看了好多论坛PCNT配置不是很难的,但是自己还是没有把Capture功能使用起来。记录下配置过程:
1、时钟配置使用默认;
2、Pwm0-7设置,选用HET[2]作为PWM输出,周期10000us,50%,Enable,Pin2;
3、pwm interrupt、Edge0-7、Edge interrupts没有使用;
4、Cap0-7,Capture使用HET6,使用默认的CAP3;
5、Pin0-7,HET2配置为输出,HET6配置为输入;
6、配置完生成代码,然后根据论坛中讲HR share功能需要去修改代码,参考
    /* PCNT: Capture Duty 3
    *         - Instruction                  = 31
    *         - Next instruction             = 32
    *         - Conditional next instruction = na
    *         - Interrupt                    = na
    *         - Pin                          = 6
    */
    {
        /* Program */
        0x00020700U | (1U << 5U)  | (6U),
        /* Control */
        0x00000000U,
        /* Data */
        0x00000000U,
		/* Reserved */
		0x00000000U
    },
    /* PCNT: Capture Period 3
    *         - Instruction                  = 32
    *         - Next instruction             = 33
    *         - Conditional next instruction = na
    *         - Interrupt                    = na
    *         - Pin                          = 6  + 1
    */
    {
        /* Program */
        /*原代码0x00021700U | (1U << 5U)  | ((6U) + 1U),*/
        0x00021700U | (3U << 5U)  | ((6U) + 0U),
        /* Control */
        0x00000000U,
        /* Data */
        0x00000000U,
		/* Reserved */
		0x00000000U
    },
7、main部分代码;
#include "system.h"
#include "het.h"
/* USER CODE BEGIN (0) */
hetSIGNAL_t pluse10;
hetSIGNAL_t pluse_pwm;
/* USER CODE END */

/* USER CODE BEGIN (1) */
/* USER CODE END */

int main(void)
{
/* USER CODE BEGIN (2) */
    hetInit();

    pwmStart(pwm0);

    while (1)
    {
        pwmSetDuty(pwm0, 30);

        pluse_pwm = pwmGetSignal(pwm0);

        pluse10 = capGetSignal(cap3);
    }

/* USER CODE END */

    return 0;
}
8、PWM使用示波器实测波形如下:
9、读取变量值如下;
    实物已经将HET2和HET6连接到一起了,pluse10变量中值一直是0,疑问???
附件是相关工程。