MPLAB® Code Configurator for Touch Host Driver

Last modified by Microchip on 2026/03/26 08:23

Getting Started With Touch Host Driver

This tutorial provides a detailed, step-by-step guide for configuring and generating host driver firmware for the MTHC2120. It also includes the procedure for connecting the external host interface, offering additional clarity on hardware connections.

Information

Note: MTCH2120 and SAMD21 XPRO are used as an example. 

Create a new 32-bit MPLAB® Code Configurator (MCC) Harmony project.

New Project window
Upon clicking the Finish button of the New Project Wizard, the MCC Content Manager will open along with the newly created project.

Information

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.

Content Manager tab

Select Touch Host Driver from the optional content and click Finish.

MCC Content Manager Wizard

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.

Device Resources pane

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.

Project Graph


From the Select Turnkey Device supported list of devices drop-down, choose the turnkey device. MTCH2120 is selected in this example.

Configuration Options


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.

SERCOM


Add the 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.

Enable Tuning option selected


Configure the SERCOM module.

Configure the UART settings as follows.

UART configuration

Configure the I2C settings as follows.

I2C configuration


Configure INTERRUPT.

Change INTERRUPT Pin Name as you want and copy the name.

INTERRUPT Pin Name


Configure the pins.

Open Pin Configuration from Windows > MPLAB Code Configurator > Harmony.

Windows tab drop down

Configure the UART pins in the Pin Configuration window as follows.

Pin Configuration

Configure the I2C pins in the Pin Configuration window as follows.

Pin Configuration

Configure the Interrupt pin in the Pin Configuration window.

Interrupt pin configuration


Disable SysTick.

Click System in the Project Graph.

Go to Cortex-M0+ Configuration.

Go to SysTick.

Uncheck the Enable SysTick option.

SysTick disabled


Generate the files.

Click on the Generate button to start generating the MCC files for the project.

Generate button


Add code and compile.

Add code (touch_init_example() and touch_mainloop_example()) to main.c. Refer to the mtch2120_host_example.c file for reference and compile the project.

int main

Connect to MPLAB Data Visualizer.

Refer to the "How to Connect to Data Visualizer" section for more details on how to connect the kit to Data Visualizer.

Back to Top

External Host Interface Connection Procedure

External Host Interface Connection Procedure

External Host Jumper Settings

External Host Interface Connection Procedure

Disconnect the SCL connection between J4 and J5, and connect the EVK SCL (I²C clock) pin to PA09 on the SAMD21 Xplained Pro.


Disconnect the SDA connection between J4 and J5, and connect the EVK SDA (I²C data) pin to PA08 on the SAMD21 Xplained Pro.


Disconnect the INTR connection between J4 and J5, and connect the interrupt (INTR) pin to PA04 on the SAMD21 Xplained Pro.


Connect the ground (GND) between the SAMD21 Xplained Pro and the MTCH2120 EVK.


Disconnect the VDD connection between J4 and J5, and supply external power to the MTCH2120 EVK.

Back to Top

Release Information

Release notes for Touch Host Driver are available on the Microchip MPLAB® Harmony 3 Touch Host Driver Release Notes GitHub® page.

Back to Top