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.

[参考译文] MSP430FR2673:MSP430电容式触摸控制

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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1364244/msp430fr2673-msp430-capacitive-touch-controlling

器件型号:MSP430FR2673

您好!

我 使用 MSP430FR2673来接触控制定制电路板。 我想提高我的触控灵敏度、以便尽可能做到这一点。 我使用16 MHz 频率、而代码是使用 CapTIvate 设计工具生成的。  

谢谢!

阿图利亚

#include <msp430.h>                      // Generic MSP430 Device Include
#include "driverlib.h"                   // MSPWare Driver Library
#include "captivate.h"                   // CapTIvate Touch Software Library
#include "CAPT_App.h"                    // CapTIvate Application Code
#include "CAPT_BSP.h"                    // CapTIvate EVM Board Support Package


 extern tSensor *sensor ;


extern tElement keypadSensor_E00;
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; //Ban watchdog.

	P2DIR |= BIT6;                          // Set P2.6 to output direction for idication

	BSP_configureMCU(); // Configure the communication IO pin, configure the clock

	__bis_SR_register(GIE);

	// Start the CapTIvate application

	CAPT_appStart(); //Capacitive touch module initialization and calibration, while enabling communication peripherals.

	//

	//CAPIO2CTL = 0x0126;
	// Background Loop
	//
	while(1)
	{
		//
		// Run the captivate application handler.
		//test

	    if(CAPT_appHandler()==true)
	    {
	        P2OUT |= BIT6;  // turn on the LED

	    }
	    else
	    {
	        P2OUT &= ~BIT6;  // turn off the LED
	    }
		__no_operation();

		//
		// End of background loop iteration
		// Go to sleep if there is nothing left to do
		//
		CAPT_appSleep(); //CPU enters sleep, waiting for periodic interrupt to wake up
		
	} // End background loop
} // End main()

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

    我 建议您参阅此应用手册:https://www.ti.com/lit/ug/slau857a/slau857a.pdf (5.4.3灵敏度参数调整)

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

    您好!

    提供了一个优化代码来提高灵敏度。 不在 CapTIvate 设计工具中。

    谢谢!

    阿图利亚

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

    实际上、您更改了设计工具、然后您可以生成具有已更改灵敏度的代码。

    如果您要在此文件中直接更改它:

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

     TouchThreshold 的最小值和最大值是多少?

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

    如果触控灵敏度可以在动态过程中控制?,如果有任何校准甲氧?

    谢谢!

    阿图利亚

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

    最大值为128、最小值为1。 您可以在运行中更改灵敏度(触摸阈值)。 我不建议您进行校准。 如果用户触摸校准时发生校准、它会使功能异常。