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.

CapTIvateDesignCenter例程问题

Other Parts Discussed in Thread: MSP430FR2633, MSPCAPTDSNCTR

你好,我最近在学习CapTIvateDesignCenter,申请了一个demo板,但是在安装对应的软件时候,一直搞不定,生成的代码有ccs和IAR for msp430两种,其中,用ccs6.1打开的时候,总是例程导入失败,details提示Error:Devices is either null or unrecognized,check update也没用,TI培训中心中的视频提示的是6.1及以上版本均可,然后IAR for msp430安装总是打开的时候提示不是有效的win32应用程序,一直搞不定。

  • 你好?你用的哪个msp430呢?

  • 开发板自带的, MSP430FR2633; 这个链接的http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/CapTIvate_Design_Center/latest/exports/docs/users_guide/html/ch_workshop.html    guild上面显示的需要工具TI Code Composer Studio v6.10 or greater with MSP430 support and MSP430FR2633 service packs,但是这个msp430 support和这款430的service packs我找不到,而且没办法通过check update来搞定。。

  • 开发板自带的, MSP430FR2633; 这个链接的http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/CapTIvate_Design_Center/latest/exports/docs/users_guide/html/ch_workshop.html    guild上面显示的需要工具TI Code Composer Studio v6.10 or greater with MSP430 support andMSP430FR2633 service packs,但是这个msp430 support和这款430的service packs我找不到,而且没办法通过check update来搞定。

  • 这个啊,意思是使用v6.10或者更新的版本,并且安装上MSP430FR2633 支持包。

    推荐你使用最新的v7.10版本,估计不需要另外安装包就可以。

  • 你好,这个问题我初步解决了,例程里面有一个检测slider位置与阈值500的关系,我想做个试验把位置数据通过串口传递出来,电容触摸最终还是要把数据传递出来,然后去执行相应的函数吧,但是生成的程序包和库里面没看到相应的串口的例子,刚接触理解的不是很深,你有这方面的例程吗?谢谢。

  • yuqing he 说:

    你好,这个问题我初步解决了,例程里面有一个检测slider位置与阈值500的关系,我想做个试验把位置数据通过串口传递出来,电容触摸最终还是要把数据传递出来,然后去执行相应的函数吧,但是生成的程序包和库里面没看到相应的串口的例子,刚接触理解的不是很深,你有这方面的例程吗?谢谢。

    打开 design center 

    Help->Topic

    里面找到软件那一章,有详细说明

    Access Slider or Wheel Position Data

    Slider and wheel sensors output a position in addition to touch and proximity status. The position value is available as a IQ16-style value, with 16 integer bits and 16 fractional bits. For almost all applications, the integer bits are the bits of interest, and the fractional bits are merely there to support filtering.

    When a slider or wheel sensor is updated (via CAPT_updateUI()CAPT_updateSensor(), or CAPT_updateSensorWithEMC()), the position value is updated.

    NOTE: When a slider or wheel sensor is not being touched, a value of 0xFFFF (UINT16_MAX) is reported.

    Accessing the Slider or Wheel Position Directly

    The example below shows how to directly access the slider and wheel position parameters in the tSliderSensorParams and tWheelSensorParams structures, respectively. The application assigns the values to the speakerVolume and optionSelection variables, which are intended to represent functionality in an application.

    uint16_t speakerVolume;
    uint16_t optionSelection;
    extern tSliderSensorParams volumeSlider_Params;
    extern tWheelSensorParams scrollWheel_Params;
    void updateVolumeAndOptionSelection(void)
    {
    // Set the speaker volume to the natural (integer) 16 bit slider position
    if (volumeSlider_Params.SliderPosition.ui16Natural != UINT16_MAX)
    {
    speakerVolume = volumeSlider_Params.SliderPosition.ui16Natural;
    }
    // Set the option selection to the natural (integer) 16 bit wheel position
    if (scrollWheel_Params.SliderPosition.ui16Natural != UINT16_MAX)
    {
    optionSelection = scrollWheel_Params.SliderPosition.ui16Natural;
    }
    }

    Accessing the Slider or Wheel Position Indirectly

    Note that in the example above, it was necessary to forward declare volumeSlider_Params and scrollWheel_Params. It is also possible to "look up" these parameter structures through the parent sensor structure, as shown below. All sensor structures are forward declared in the user configuration header file (CAPT_UserConfig.h), and do not need to be re-declared. It is necessary to type-cast the parameter structure based on the type of sensor.

    uint16_t speakerVolume;
    uint16_t optionSelection;
    void updateVolumeAndOptionSelection(void)
    {
    uint16_t position;
    // Set the speaker volume to the natural (integer) 16 bit slider position
    position = ((tSliderSensorParams*)(volumeSlider.pSensorParams))->SliderPosition.ui16Natural;
    if (position != UINT16_MAX)
    {
    speakerVolume = position;
    }
    // Set the option selection to the natural (integer) 16 bit wheel position
    position = ((tWheelSensorParams*)(scrollWheel.pSensorParams))->SliderPosition.ui16Natural;
    if (position != UINT16_MAX)
    {
    optionSelection = position;
    }
    }

    Note that for both slider and wheel parameter structures, the parameter for position is called SliderPosition. This is because both of these sensor types utilize the same processing algorithm.

    Accessing the Slider or Wheel Position with a Function Call

    The final (and simplest) way to access slider or wheel position is via a function call to CAPT_getSensorPosition(). This function will return 0xFFFF (UINT16_MAX) if no touch is present.

    uint16_t speakerVolume;
    uint16_t optionSelection;
    void updateVolumeAndOptionSelection(void)
    {
    uint16_t position;
    // Set the speaker volume to the natural (integer) 16 bit slider position
    position = CAPT_getSensorPosition(&volumeSlider);
    if (position != UINT16_MAX)
    {
    speakerVolume = position;
    }
    // Set the option selection to the natural (integer) 16 bit wheel position
    position = CAPT_getSensorPosition(&scrollWheel);
    if (position != UINT16_MAX)
    {
    optionSelection = position;
    }
    }

    Using the function call allows the software implementation to be clearer, at the penalty of function overhead.

  • 你好,根据教程能够获取相应的参数值,但是串口那边还是搞不定,我觉得获取相应的触摸动作后,应该是通过一定的方式传送相应的命令到执行机构吧,我这边想通过串口传送到别的单片机,但是串口一直抓不到数据,即使在CDC软件中生成代码时候选择UART,在串口助手中也抓不到数据,这方面有相应的例程吗?

  • yuqing he 说:

    你好,根据教程能够获取相应的参数值,但是串口那边还是搞不定,我觉得获取相应的触摸动作后,应该是通过一定的方式传送相应的命令到执行机构吧,我这边想通过串口传送到别的单片机,但是串口一直抓不到数据,即使在CDC软件中生成代码时候选择UART,在串口助手中也抓不到数据,这方面有相应的例程吗?

    CDC中选的UART是用来跟上位机通信的。

    触摸的处理建议用 回调函数

    Register a Callback Function

    Callbacks provide a mechanism for the application to be notified when a sensor has been updated. The application must first register its "callback" function for each sensor before it can receive updates. When the callback is executed, the application can query the sensor's data structure to determine the status of the sensor.

    The library function CAPT_registerCallback() provides the registration.

    Format

    Sensor callback functions are passed a pointer to the calling sensor, and they must return void. An example skeleton callback function is shown below:

    void my_button_callback(tSensor* pSensor)
    {
    // DO SOMETHING ...
    }

    Example

    This is what it would look like to register the callback function named "my_button_callback" to the sensor BTN0000.

    MAP_CAPT_registerCallback(&BTN0000, &my_button_callback);

    Once an application's callback function is registered, the callback is executed each time the corresponding sensor is scanned and processed, regardless if a proximity or touch detection has occurred. Inside the user callback, the application can perform any required sensor data and status post-processing. In a typical button application, this is where the application will check for a proximity, touch detection or slider/wheel position.

    Example

    Here is a typical callback example for a button that checks both when a touch is detected and a release.

    void my_button_callback(tSensor* pSensor)
    {
    if((pSensor->bSensorTouch == true) && (pSensor->bSensorPrevTouch == false))
    {
    // BUTTON PRESSED
    // DO SOMETHING ...
    }
    else if((pSensor->bSensorTouch == false) && (pSensor->bSensorPrevTouch == true))
    {
    // BUTTON RELEASED
    // DO SOMETHING ...
    }
    }

    Here is a callback example for a proximity sensor.

    void my_proximity_callback(tSensor* pSensor)
    {
    if(pSensor->bSensorProx == true)
    {
    // PROXIMITY DETECTED
    // DO SOMETHING ...
    }
    }

    In addition to proximity and touch status, sliders and wheels also provide position status. Here is a typical callback example for a slider or wheel that checks a sensor's position.

    void my_slider_callback(tSensor* pSensor)
    {
    uint16_t ui16Position;
    // FIRST CHECK IF THERE IS VALID TOUCH
    if(pSensor->bSensorTouch == true)
    {
    // THEN GET THE CURRENT TOUCH POSITION ON THE SLIDER/WHEEL
    ui16Position = (uint16_t)((tSliderSensorParams*)pSensor->pSensorParams)->SliderPosition.ui16Natural;
    // DO SOMETHING WITH POSITION ...
    }
    }
  • 你好,如果按照你说的

    1.cdc定义的UART是用来跟上位机通信,那我可以也应该可以用来传递自己的参数;但实际我在对应的串口中所有数据都接受不到。。。

    2.如果不用这个串口,实际好像就两个串口吧,一个用来跟上位机通信,一个用来跟触摸面板连接,没有可以自己用来通讯的,那用户怎么把想要的控制参数导出?

    实际应用中肯定不只是和上位机通信啊,肯定要把参数传给别的单片机。。。。。这个要怎么去实现,谢谢

  • yuqing he 说:

    你好,如果按照你说的

    1.cdc定义的UART是用来跟上位机通信,那我可以也应该可以用来传递自己的参数;但实际我在对应的串口中所有数据都接受不到。。。

    2.如果不用这个串口,实际好像就两个串口吧,一个用来跟上位机通信,一个用来跟触摸面板连接,没有可以自己用来通讯的,那用户怎么把想要的控制参数导出?

    实际应用中肯定不只是和上位机通信啊,肯定要把参数传给别的单片机。。。。。这个要怎么去实现,谢谢

    同意你的说法。

    1.可以,如果收不到的话可能波特率没有对上。关于CDC的传输协议,参考 Topics 里面 Communications Module 这一章

    2.一个用来跟上位机通信,是的。

    一个用来跟触摸面板连接,何出此言?

  • 是我表述的不够明白,开发板上面P1_4,P1_5对应UCA0的TXD和RXD,连接的是debug板连接到上位机;P2_6和P2_5对应UCA1的TXD和RXD因为引脚复用的关系,被配置成CAP1.2,CAP1.3用来跟触摸面板连接了,所以在这个套件里面,用户只能使用UCA0,而这个串口被用来和上位机通信,所以要想使用这个套件做实验或者去开发产品,就只能在原有的通讯协议里面添加自己的协议么?没有简便一点的方式或者已经有相应的案例么。。。。

  • yuqing he 说:

    是我表述的不够明白,开发板上面P1_4,P1_5对应UCA0的TXD和RXD,连接的是debug板连接到上位机;P2_6和P2_5对应UCA1的TXD和RXD因为引脚复用的关系,被配置成CAP1.2,CAP1.3用来跟触摸面板连接了,所以在这个套件里面,用户只能使用UCA0,而这个串口被用来和上位机通信,所以要想使用这个套件做实验或者去开发产品,就只能在原有的通讯协议里面添加自己的协议么?没有简便一点的方式或者已经有相应的案例么。。。。

    如果在CDC里面没有选UART, 那么P1.4 P1.5 就可以空出来给用户使用。

  • 你好,请问你所说的:

    打开 design center 

    Help->Topic

    里面找到软件那一章,有详细说明

    是指哪个软件?还是指TI官网?

  • jiaqing wang2 说:

    你好,请问你所说的:

    打开 design center 

    Help->Topic

    里面找到软件那一章,有详细说明

    是指哪个软件?还是指TI官网?

    这里的软件 指的是单片机里面的固件 source code

  • 我是说:

    打开design center ,是指这个design center 在哪里?

    这个design center 是一个单独的软件?还是。。。?

  • jiaqing wang2 说:

    我是说:

    打开design center ,是指这个design center 在哪里?

    这个design center 是一个单独的软件?还是。。。?

    在这里,是一个单独软件

    http://www.ti.com.cn/tool/cn/mspcaptdsnctr

  • 好的,找到了,谢谢您的回答!

    另外想问下:

    Negative Touch Detect  这个是什么意思?是一种触摸吗?

  • jiaqing wang2 说:

    好的,找到了,谢谢您的回答!

    另外想问下:

    Negative Touch Detect  这个是什么意思?是一种触摸吗?

    反向触摸事件。 

    正常情况下,假设触摸会引起测量结果的减小。

    那么,校准 ->触摸->测量结果减小->正向触摸

    如果,手放在上面校准->手拿开->测量结果变大->反向触摸

  • 您好,msp430fr2633这个芯片用了已经一个多月了,触摸功能根据官方例程序也调通了。

    但是对于用于64个触摸按键上,互电容的工作过程总是似懂非懂,比如采样周期,计数值等等。。。

    请问有没有介绍这方面专业技术的中文资料提供下啊?

    另外这两个参数分别是什么意思,可以解答下吗?

    Conversion Count

    Conversion Gain

    谢谢!