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.

MSP432P401R: 输入捕获相关问题

Part Number: MSP432P401R

我自己写的输入捕获要么乱进中断,要末进不去中断,要末计数错吴

  • 请问能否详细说明一下?另外建议您先参考例程

    https://dev.ti.com/tirex/explore/node?node=AG7JOJNuvDb6UGmBsWvn2Q__z-lQYNj__LATEST 

    Capture a number of periods of the VLO clock and store them in an array.

  • 我就时参考例程写的

  • volatile uint_fast16_t Capture_Value=0;
    Timer_A_ContinuousModeConfig continuousModeConfig=
    {
    TIMER_A_CLOCKSOURCE_SMCLK,
    TIMER_A_CLOCKSOURCE_DIVIDER_1,
    TIMER_A_TAIE_INTERRUPT_DISABLE,
    TIMER_A_SKIP_CLEAR
    };

    Timer_A_CaptureModeConfig captureModeConfig =
    {
    TIMER_A_CAPTURECOMPARE_REGISTER_1,
    TIMER_A_CAPTUREMODE_RISING_EDGE,
    TIMER_A_CAPTURE_INPUTSELECT_CCIxA,
    TIMER_A_CAPTURE_SYNCHRONOUS,
    TIMER_A_CAPTURECOMPARE_INTERRUPT_ENABLE,
    TIMER_A_OUTPUTMODE_OUTBITVALUE,
    };
    void Capture_Base_Init(void)
    {
    MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2,GPIO_PIN4,GPIO_PRIMARY_MODULE_FUNCTION);
    MAP_Timer_A_initCapture(TIMER_A0_BASE, &captureModeConfig);
    MAP_Timer_A_configureContinuousMode(TIMER_A0_BASE,&continuousModeConfig);
    MAP_Interrupt_enableInterrupt(INT_TA0_N);
    MAP_Interrupt_enableMaster();
    MAP_Timer_A_startCounter(TIMER_A0_BASE,TIMER_A_CONTINUOUS_MODE);
    }
    void TA0_N_IRQHandler(void)
    {
    Timer_A_clearCaptureCompareInterrupt(TIMER_A0_BASE,TIMER_A_CAPTURECOMPARE_REGISTER_1);
    // BITBAND_PERI(TIMER_A_CMSIS(TIMER_A0_BASE)->CCTL[1],TIMER_A_CCTLN_COV_OFS) = 0;//软件复位COV
    Capture_Value=MAP_Timer_A_getCaptureCompareCount(TIMER_A0_BASE,TIMER_A_CAPTURECOMPARE_REGISTER_1);
    }

  • 我自己写的输入捕获要么乱进中断,要末进不去中断

    那能否说一下您想要具体实现什么功能?您现在使用的是开发板还是自制板?

    另外请您以“插入-->代码”的形式上传代码,以便于阅读

  • 先清除cov位,再把main里面的MAP_Interrupt_enableSleepOnIsrExit();删掉