Creating a Driven Shield Project with MHC
Creating a Driven Shield Project with MPLAB Code Configurator (MCC)
Objective
This page shows you how to create a Driven Shield Touch MPLAB® Harmony project from scratch.
Reference Materials
Procedure
Touch Library
Add the Touch Library, and when prompted, allow the Real Time Clock (RTC) Peripheral connection.
Open the Touch Configurator
Open the Touch Configurator by going to MHC > Tools > Touch Configuration.
Add Buttons, Sliders, and Wheels
Add buttons, sliders, and wheels as required and assign the Y lines to each.
Configure the Driven Shield
Refer to the "Guide for Timer-based Driven Shield on SAM Devices".
Simultaneous use of both Driven shield and Driven Shield+ is possible.
Refer to the “I/O Multiplexing and Considerations” section of the target device datasheet to examine the various touch pins that also support the TC or TCC outputs.
For the PIC32MZDA device, refer to
.Choosing the Driven Shield Option
- Select the Enable Dedicated Driven Shield checkbox
- Choose from the available TC/TCC to set the Timer Instance.
- Choose the Shield pin.
- Click Apply to update the Project Configuration. Allow the use of the TC/TCC as prompted.
Choosing the Driven Shield+ Option
- Select the Enable Driven Shield Plus checkbox
- Choose from the available TC /TCC to set the Timer Instance.
- Click Apply to update the Project Configuration. Allow the use of the TC/TCC as prompted.
In Step 2 above, not all pins support Timer Output in this QT7 example, see the “I/O Multiplexing and Considerations” section in the SAMD21 datasheet.
When applied, the Project Graph should now contain the relevant timers for Driven Shield/Driven Shield+ in addition to the RTC.
In this example, Data Visualizer was also enabled.
Generate Code
Generate the Example Code to create the source code by going to MHC > Generate Code.
Enable Touch
Enable touch in the main application by adding touch_process(); within the main loop.