5
Run the Demos
TWRK20D50M Demo software
This code is pre‐programmed in your TWRK20D50M, and shows some of the features of the K20 family
and the TWRK20D50M board. Following table show how different modules are used in this application
Table 1 K20 Modules used on TWRK20 Demo software
Module
Function
ADC
Reads 2 signals
Potentiometer
Microphone
PDB
Creates a sampling frequency of 8 kHz for the ADC
converter
DMA
Store microphone readings in a double buffer of
128 samples each
DSP
Calculates FFT of 128 samples and magnitude of
each harmonic
I2C
Reads accelerometer, acceleration in each axes x, y,
and z
PIT
CH0 Generates a 1 msec periodic interrupt
CH1 Generates a 125 msec periodic interrupt
GPIO
4 LED, 2 Push button
HSCMP
Reads signal for IR receiver, and output is
connected to UART0 receiver
MCG+OSC
Oscillator of 8MHz crystal, MCG creates a 50 MHz
signal from 8MHz crystal with the PLL
CMT
Create a 40KHz carrier frequency, and 600 Baud
modulation signal for the IR transmitter.
UART0
Receives signal from HSCMP(IR receiver) 600,8,n,1
TSI
Configured to read 2 Electrodes
RTC
A real time clock (seconds only) based on 32Khz
Crystal
JTAG
Interface of debugging and programming of the
parts.
Programmed through the OSJTAG
UART1
User communication interface 38400,8,n,1
FTM0
Generate buzzer frequency
TWR‐K20D50M Quick Start Demo Lab Guide
Details
12 bits mode
Hardware triggered
Continous mode
at 8 Khz
Triggers ADC0
Interrupt when 128 samples are
sampled and perform
calculation of FFT, and filters.
Uses CMSIS integrated library in
IAR 6.3
K20 calculates tilt angle and fall
detection based on axes
acceleration.
DAC6 used as HSCMP minus
input, IR receiver connected to
HSCMP plus input,
Inverted reception
Page 5 of 23