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.

【紧急】MSP430FR2522 触碰触摸通道无反应

Other Parts Discussed in Thread: MSP430FR2522

Dear TI Team :

        在帮客户开发一款滑条的产品(100级/4个自电容),使用的是MSP430FR2522 CAP0.0-CAP0.3三个触摸通道 , 通过CDC(V1.6)生成代码

发现触摸触摸通道回调函数进不了(即无法检测到触摸). 请问到底是怎么一回事?

  

        Ps:

        1. 相同的软件我通过BSWP EVM是可以实现功能的,但转到FR2522就连触摸都没反应

        2. 一开始我以为是BSP_configureMCU(void) 里面CAP0.0-CAP0.3没有完成复用,又去做了复用,发现效果还是一样.

        3. 硬件检查了触摸PAD确实是连到我MCU CAP管脚上的,但debug时我直接去触碰CAP 管脚回调函数也还是进不去

 

       以下是我的注册函数和回调函数

void Application_Init()
{
  MAP_CAPT_registerCallback(&SLD00,&SLD00EventHandler);   
}

void SLD00EventHandler(tSensor *pSensor)               
{                                                      
                                                        
                                                        
    volume =0x00;
   
   tSliderSensorParams * pSliderParams;  
   if(pSensor->bSensorTouch == true)           
   {
     pSliderParams = (tSliderSensorParams *)(pSensor->pSensorParams) ;  
     volume = pSliderParams->SliderPosition.ui16Natural;              
     UCA0TXBUF = volume;
   }

以上,项目非常紧急,迫切希望得到您的回复!

  • 这是我的main函数,程序都能正常跑,就只是进不去callback函数
    void main(void)
    {
    //
    // Initialize the MCU
    // BSP_configureMCU() sets up the device IO and clocking
    // The global interrupt enable is set to allow peripherals
    // to wake the MCU.
    //
    WDTCTL = WDTPW | WDTHOLD;

    BSP_configureMCU();
    __bis_SR_register(GIE);
    Application_Init();
    //
    // Start the CapTIvate application
    //
    CAPT_appStart();
    UART_Init();
    //
    // Background Loop
    //
    while(1)
    {
    //
    // Run the captivate application handler.
    // Set LED1 while the app handler is running,
    // and set LED2 if proximity is detected
    // on any sensor.
    //
    /*
    LED1_ON;
    if(CAPT_appHandler()==true)
    LED2_ON;
    else
    LED2_OFF;
    LED1_OFF;
    */
    //
    // This is a great place to add in any
    // background application code.
    //
    __no_operation();

    //
    // End of background loop iteration
    // Go to sleep if there is nothing left to do
    //
    //CAPT_appSleep();

    } // End background loop
    } // End main()
  • 感觉您的代码没有什么问题。能否请您单步调试一下?另外建议您写一下最简单的触摸测试程序看是否是硬件部分的问题
  • Susan:
    问题已经解决了,While循环中CAPT_appHandler(); 不小心删除了导致无法进入callback函数,谢谢您的支持!
  • 很高兴您能解决问题!