Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Autonomous QTouch Example on UC3L_EK Documentation

Introduction

The Example projects demonstrates:

  • Sleepwalking Feature in AT32UC3L devices :
    SleepWalking feature allows to reduce the power consumption of the peripherals in sleep modes. It allows the UC3L Event System to handle asynchronous events in various sleep modes by requesting a module local clock for the duration of the Event processing. When the event processing ends, the clock request is disserted and the module goes back to sleep.
  • Autonomous QTouch in Deep Sleep modes using Sleepwalking feature:
    The example is used to test the sleepwalking feature in deep Sleep mode since an external 32KHz crystal is available on this board. The Asynchronous timer is configured to periodically generate an peripheral event. When the device is set to STATIC Sleep mode, the Asynchronous Timer (AST) uses the 32KHz external clock. A single peripheral event from AST triggers one Autonomous QTouch measurement. This happens periodically using the Sleepwalking feature without waking the entire CPU. The CPU is not woken up unless there is a IN_TOUCH or OUT_OF_TOUCH detection in the Autonomous QTouch sensor.
  • QTouch Studio mode:
    When the define DEF_TOUCH_QDEBUG_ENABLE in the touch_config_at32uc3l.h file is set to 1, this example project can be used to connect to QTouch studio. STK600 board and QT600 USB Bridge can be used to verify this. The CPU will not enter sleep mode in this configuration.

Main Files

For support queries on,

QTouch Library Documentation

  • Refer doc8207: Atmel QTouch Library User Guide.
  • Refer QTAN0062: QTouch and QMatrix Sensitivity Tuning for Keys, Sliders and Wheels. -> For Capacitive Touch Sensor tuning guidelines.
  • Refer doc10620.pdf: Touch Sensors Design Guide. -> For Capacitive Touch Sensor design.

Touch Library Configuration Information

  • The Example application uses a CPU, PBA and PBB clock of 48MHz. When using a different frequency setting, the following parameters must be changed accordingly to ensure proper QTouch operation.
    • AT_CAT_CLK_DIV.
    • TOUCH_SPREAD_SPECTRUM_MAX_DEV, when Spread spectrum is enabled.
    • PBA_HZ, when using qdebug/SPI_Master.c
    • TARGET_PBA_FREQ_HZ and TARGET_CPU_FREQ_HZ, when using qdebug/SERIAL.c
  • For the case of Autonomous QTouch, the following settings can be modified by the QTouch Studio.
    • Detect Threshold (Sense level) - AT_SENSE.
    • Detect Integration - AT_FILTER.
    • Negative Drift rate - AT_NDRIFT.
    • Positive Drift rate - AT_PDRIFT.
  • When two or more acquisition methods are used, care must be taken such that a given port pin is not used by more than one method at the same time. The following pin configuration options available in touch_config_at32uc3l.h must be carefully chosen to avoid overlapping.
    • QMatrix Pin Configuration Options.
    • Autonomous QTouch Pin Configuration Options.
    • QTouch Group A Pin Configuration Options.
    • QTouch Group B Pin Configuration Options.
    • Touch Sync Pin option.

Compiler Support

The example application supports:

  • IAR EWAVR32
  • GNU GCC for AVR32

Device Support

  • AT32UC3L0 Series

Test Information

This example has been tested with the following setup:

  • AVR Studio 5.0
  • IAR32 Embedded Workbench
  • STK600 development board, UC3-L0-XPLAINED & UC3L-EK evaluation kits
  • 1.8V and 3.3V Supply mode

Setup Information

  • CPU Clock Source : DFLL with internal RCSYS as its source
  • AST Clock Source : 32KHz external oscillator
  • CPU Speed : 48MHz
  • PBA Speed : 48MHz
  • PBB Speed : 48MHz
  • AST Trigger Period: Every 62.5ms
  • UC3L-EK: Sense Pair 3 (SP3) is used
    Important Note: The (csa3/csb3) Touch channel connections are multiplexed with the JTAG pins. So, when using the JTAG debugging mode, these Touch channel connections MUST be removed. In the Flash mode, this will not cause any issues.
    ---------------------------------------------—
    CAT CSA/CSB name - UC3L-EK board Port-pin name
    ---------------------------------------------—
    KEY 1
    csa3 (SNS3) - PA02 //Pin 3 on JTAG Header
    csb3 (SNSK3) - PA03 //Pin 9 on JTAG Header
  • UC3-L0-XPLAINED: Sense Pair 15 (SP15) is used
    ---------------------------------------------—
    CAT CSA/CSB name - UC3L-EK board Port-pin name
    ---------------------------------------------—
    QT0 Button
    csa15 (SNS15) - PB12 //Pin 5 on J3 Header
    csb15 (SNSK15) - PB09 //Pin 6 on J3 Header
  • STK600-RCUC3L0: Sense Pair 15 (SP15) is used
    ---------------------------------------------—
    CAT CSA/CSB name - STK600 board Port-pin name
    ---------------------------------------------—
    KEY 1
    csa15 (SNS15) - pe4
    csb15 (SNSK15) - pe1
    ---------------------------------------------—
    QT600 USB Bridge
    'TOUCH DATA' Header Pin name - STK600 board Port-pin name
    ---------------------------------------------—
    PA22 - 'TOUCH DATA' header pin 8 - clk - pc6
    PA21 - 'TOUCH DATA' header pin 7 - miso - pc5
    PA20 - 'TOUCH DATA' header pin 6 - mosi - pc4
    PA14 - 'TOUCH DATA' header pin 5 - nss - pb6

Contact Information

For further information, visit : Atmel AVR32 .
Technical support & faq, visit : Support and FAQ .

Author
Microchip Technology Inc: http://www.microchip.com