10
Atmel AVR32931
32162A-AVR-03/11
6 Example applications
Several examples are available in ASF that can be downloaded from the ASF section
of the Atmel website:
http://asf.atmel.no
. Each example has full source code with
documentation, and also ready made binaries to get started quickly. The examples
can be compiled by using either GCC or IAR compilers.
6.1 Preprogrammed firmware
The
Atmel AT32UC3L064
on the
Atmel UC3-L0 Xplained
kit is preprogrammed with a
UART bootloader and a default example firmware.
6.1.1 Functionality of the preprogrammed firmware
The preprogrammed firmware in the
AT32UC3L064
is a demonstration of the Atmel
QTouch
®
button and Atmel QMatrix slider. By pushing the QTouch button (QTB0),
LED1 will light up. The QTouch button will cycle through the selection of the colors
red, green, and blue for the RGB LED. When moving a finger on the QMatrix slider
(QMSlider), the intensity of the color selected by the QTouch button will change. The
RGB colors are controlled with 8-bit resolution PWM, which theoretically gives the
user the ability to mix up to 16.7 million colors.
6.1.1.1 Capacitive touch module
The preprogrammed firmware was made to demonstrate the built-in hardware
functionality of the
AT32UC3L064
device. The device has a capacitive touch (CAT)
module, which can be used for both QTouch and QMatrix sensors. To demonstrate
this, the
UC3-L0 Xplained
board has one of each sensor; one QTouch button and one
QMatrix slider.
The design of the sensor defines if it is a QTouch or a QMatrix sensor. One of each is
included for demonstration. The QMatrix slider can also be used as four separate
QMatrix buttons.
The preprogrammed firmware uses the QTouch button to select among the three
colors of the RGB LED to control with the QMatrix slider. When touching the QTouch
button, LED1 will also light up while a touch is registered.
The QMatrix slider has an 8-bit resolution, which gives 256 different values according
to where on the slider the touch is held. This value is passed on to the PWM module,
which will set the brightness of the selected color on the RGB LED.
NOTE
Register and accept the license to get access to the QTouch libraries included in the
source zip file provided with this application note.
6.1.1.2 Pulse width modulation controller
The
AT32UC3L064
device has a pulse width modulation controller (PWMA), which
can output an 8-bit PWM signal on any of the I/O pins of the device. This module is
used to control the brightness of each of the colors on the kit’s RGB LED with the
value received from the QMatrix slider and the color selected by the QTouch button.
6.1.1.3 UART
The preprogrammed firmware has a UART module set up for transferring serial data
through the board controller to a PC. This can be used for sending data to the PC to
implement any communication in a custom design. This gateway is currently used to