Touch Host Driver
Getting Started with the Touch Host Driver
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.
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. AT42QT2120 is selected in this example.
Add the SERCOM module
I2C is the only interface for the host driver and the selected AT42QT2120 turnkey device. Serial Peripheral Interface (SPI) is supported for AT42QT1110. 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.
Generate the files
Click on the Generate button to start generating the MCC files for the project.
Add code and compile
Add code (touchDeviceProcess() and touchTuneProcess()) to main.c. Refer to host_example.c file for reference and compile the project.
How to Connect to Data Visualizer
Flash the project and open Data Visualizer.
Select the COM port, set the Baud rate and click Connect.
When data starts streaming, under Touch Session, choose the same COM port and click Connect.
See the streaming data in the Touch window.
Error codes are shown in the General Status window. Go to common and individual parameters to tune them accordingly.