Creating a Driven Shield Project with MHC

 Objective

This page shows you how to create a Driven Shield Touch MPLAB® Harmony project from scratch.

 Materials

Hardware Tools

Software Tools

 Procedure

1

Create a New Project

Create a new Harmony 3 project

2

Launch MHC

Open the MPLAB Harmony Configurator (MHC) by going to Tools > Embedded > MPLAB Harmony 3 Configurator

OpenMHC.png

3

Touch Library

Add the Touch Library, and when prompted, allow the Real Time Clock (RTC) Peripheral connection.

TouchLibrary.png

4

Open the Touch Configurator

Open the Touch Configurator by going to MHC > Tools > Touch Configuration.

TouchConfiguration.png

5

Add Buttons, Sliders, and Wheels

Add buttons, sliders, and wheels as required and assign the Y lines to each.

Driven Shield and Driven Shield+ only function with self-capacitance sensing

Sensors.png
PinSelection.png

6

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.

Choosing the Driven Shield Option

  1. Select the Enable Dedicated Driven Shield checkbox
  2. Choose from the available TC/TCC to set the Timer Instance.
  3. Choose the Shield pin.
  4. Click Apply to update the Project Configuration. Allow the use of the TC/TCC as prompted.
DrivenShield.png

Choosing the Driven Shield+ Option

  1. Select the Enable Driven Shield Plus checkbox
  2. Choose from the available TC /TCC to set the Timer Instance.
  3. 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 “I/O Multiplexing and Considerations” in the SAMD21 datasheet.

DrivenShieldP.png

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.

DataVisualizer.png

7

Generate Code

Generate the Example Code to create the source code by going to MHC > Generate Code

GenerateCode.png

8

Enable Touch

Enable touch in the main application by adding touch_process(); within the main loop

MainLoop.png
© 2020 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.