2.1.1 Getting Started with the Touch Host Driver
MTCH2120 and SAMD21 XPRO are used as an example.
Create a New 32-bit MCC Harmony Project
Upon clicking the Finish button of the New Project Wizard, the MCC Content Manager will open along with the newly created project.
Note: Refer to the "Create a New MPLAB® Harmony v3 Project" page for more details on how to create your project.-
Add the Touch Host Driver to the MCC content
-
From the Content Manager, click the Select MPLAB Harmony button.
-
Select Touch Host Driver from the optional content and click Finish.
-
This will close the Content Manager and open the MCC Resource Management and Project Graph windows.
-
- Add the Touch Host Driver to the project
-
In the Device Resources pane of the Resource Management tab, expand the Touch Turnkey library to find the Touch Host Interface component.
-
Click on the Add button (green square with white cross) next to Touch Host Interface to add it to the Project Graph. The configuration options are shown in the right-hand pane.
-
- Choose a Turnkey device
Select the turnkey device from the supported list of devices. MTCH2120 is selected in this example.
- Add the SERCOM module
I2C is the only interface for the host driver and the selected MTCH2120 turnkey device. Choose a satisfying Serial Communication (SERCOM) and select the corresponding pins from the PIN configurator.
- Add Tuning Option
Check Enable Tuning option and select a SERCOM for Universal Asynchronous Receiver Transmitter (UART) and choose the corresponding pins from the pin manager.
- Configuring SERCOM module
Configuring UART
Configure UART settings as follows.
Configuring I2C
Configure I2C settings as follows.
- Configure INTERRUPT
Change INTERRUPT pin Name as you want and copy the name.
- Pin Configuration
- Open Pin Configuration
- Configure UART pin
Configure UART pins as follows in Pin Configuration window.
- Configure I2C pin
Configure I2C pins as follows in Pin Configuration window.
- Configure Interrupt pin
Configure the Interrupt pin in Pin Configuration window.
- Open Pin Configuration
Disable "SysTick"
Click System in Project Graph
Goto Cortex-M0+ Configuration
Goto SysTick
Uncheck "Enable SysTick" option
Generate the files
Click on the Generate button to start generating the MCC files for the project.
Add code and compile
Add code (touch_init_example() and touch_mainloop_example()) to main.c. Refer to mtch2120_host_example.c file for reference and compile the project.
- How to Connect to Data Visualizer
Refer to the "How to Connect to Data Visualizer" section for more details on how to connect the kit to Data Visualizer.
External Host Interface Connection Procedure.
Connection between SAMD21 Xplained Pro with MTCH2120 (EVK)

External Host Jumper Settings
