Congratulations for the purchase of your new mTouch CVD Evaluation Kit.
Although the kit will run right out of the box, this document will walk you through the setup process to quickly configure the kit. Should you need any custom configuration, this will get you up and running.
The kit comes pre-programmed and set to operate in the configuration listed below. If you need to alter any of the parameters, then a new hex file will need to be generated and the main board will need to be reprogrammed with the new firmware. MPLAB IDE will then be required as well as a C compiler.
#define CVD_SENSOR0 AN12 #define CVD_SENSOR1 AN10 #define CVD_SENSOR2 AN8 #define CVD_SENSOR3 AN9 #define CVD_SENSOR4 AN11 #define CVD_SENSOR5 AN13 #define CVD_SENSOR6 AN4
#define THRESHOLD_PRESS_SENSOR0 1245 #define THRESHOLD_PRESS_SENSOR1 1566 #define THRESHOLD_PRESS_SENSOR2 2021 #define THRESHOLD_PRESS_SENSOR3 1688 #define THRESHOLD_PRESS_SENSOR4 2154 #define THRESHOLD_PRESS_SENSOR5 1466 #define THRESHOLD_PRESS_SENSOR6 1783
If you need the stack to manage more or less than the default number, all you need to do is update the constant CVD_NUMBER_SENSORS to any other value from 1 to 15. This constant can be found in the mTouchCVD_Config.h file.
Depending on how the daughter board is connected to the main board, the sensors may be connected to different A/D inputs on the PIC microcontroller. In the mTouch framework, sensors can be mapped to a specific index in the application. Go to mTouchCVD_Config.h and look for the section with the definitions shown below, and map the sensor indexes on the left side to the correct A/D channels for your setup.
#define CVD_SENSOR0 AN0 #define CVD_SENSOR1 AN1 #define CVD_SENSOR2 AN2 #define CVD_SENSOR3 AN3 #define CVD_SENSOR4 AN4 #define CVD_SENSOR5 AN5 #define CVD_SENSOR6 AN6 #define CVD_SENSOR7 AN7 #define CVD_SENSOR8 AN8 #define CVD_SENSOR9 AN9 #define CVD_SENSOR10 AN10 #define CVD_SENSOR11 AN11 #define CVD_SENSOR12 AN12 #define CVD_SENSOR13 AN13
The number of samples taken in an application will be based on a trade-off between sensitivity and response time. The more samples taken, the better the signal-to-noise ratio of the system, but the slower its response to a finger. Typical response times are less than 100ms to eliminate delay that is visible to the human eye. If a specific response time is required, example equations are provided in the configuration file to show how to calculate the rate that will be chosen based on this value.
Your mTouch evaluation kit comes already preconfigured with the sensor threshold values for the 8-button daughter board. If different sensitivities are needed, go to the mTouchCVD_Config.h file, locate the section with the definitions shown below, and set the new values. A general rule of thumb to finding and setting correct values is to determine the range of shift for the sensor (min and max shift) and set the threshold to about 75% of the range. The following formula can be used:
#define THRESHOLD_PRESS_SENSOR0 65 #define THRESHOLD_PRESS_SENSOR1 65 #define THRESHOLD_PRESS_SENSOR2 65 #define THRESHOLD_PRESS_SENSOR3 65 #define THRESHOLD_PRESS_SENSOR4 65 #define THRESHOLD_PRESS_SENSOR5 65 #define THRESHOLD_PRESS_SENSOR6 65