Home
Creating an Atmel QTouchTM Library Project Section 1 What is TLib
Contents
1. AVRTS2080A Keys Slider Rotor o CSTACK 2 0x40 64 Data o RSTACK 2 0x2C 44 AVRTS2080A only Keys o CSTACK 2 0x30 48 o RSTACK 2 0x28 40 Data AVRTS2080B Keys Slider Rotor o CSTACK 2 0x35 53 Data o RSTACK 2 0x20 32 AVRTS2080B only Keys o CSTACK 2 0x25 53 o RSTACK 2 0x20 32 Data QTouch Keys Slider Rotor QTOUCH_ QT NUM CHANNELS 8 QT DELAY CYCLES 1 SNS D SNSK B DEBUG INTERFACE ROTOR_SLIDER_ QMatrix Keys Slider Rotor _QMATRIX_ QT NUM CHANNELS 8 DELAY CYCLES 4 PORT_X B PORT _YA D PORT_YB C PORT SMP D SMP_BIT 7 _DEBUG_INTERFACE_ _ROTOR_SLIDER_ Return Addresses Return Addresses Return Addresses If application performs any additional functions then stack sizes should be appropriately adjusted Return Addresses QTouch only Keys QTOUCH_ QT_NUM_CHANNELS 8 QT DELAY _CYCLES 1 SNS D SNSK B _DEBUG_INTERFACE _ QMatrix only Keys _QMATRIX QT_NUM_CHANNELS 8 DELAY _CYCLES 4 PORT_X B PORT _YA D PORT _YB C PORT SMP D SMP_BIT 7 _DEBUG_INTERFACE _ QT_MAX_NUM_ROTORS_SLIDERS 2 QT_MAX_NUM_ROTORS_SLIDERS 0 i11 Optional Settings Depending on project requirements Optimization Size High Option No Heap Option Multi File Options ter Fochop Satins W Nu be Compilation 5 eeltid G ptiors W Nuk te Connie Dirai Uremed Pubber Ctt Coe S Coe Oiee Uramed Pubbcr Languaje Code Ootinastioes mapat Lit Praprocesice D 41 Orton 8 Tapti Dut Litesy Co
2. Ver 4 17 5666 fie Ce Co Ca Project Wizard New Project Open Project Save Project Close Project Recent Projects o Refer to the Tables and Examples listed in the Atmel QTouch Library User Guide o Default TLib install path o TLib API Header Copy to Project Folder All TLib projects TLib Path include touch_api h o Library Copy file to Project Folder TLib Path C Program Files Atmel Atmel QTouch Libraries 3 1 Select debug platform and device Debug platform AVA Dragon AVR ONE AVR Simulate AVR Simulate Debug 1 ICE200 CEJ ICE50 JTAG ICE JTAGICE mkll j General m laal Include Directories Custom Optior aag ANR Studio Device ATmegad48P Tmeaad48P Tmega g Project wizard egado New Project ATmega88F y ATmegabh Open Project ATmega8U2 ATtiny 3 ATtinyl 34 ATtiny16 ATtiny2313 ATtiny23134 Recent Projects j l ta Configuration Options E External Dependencies E Other Files E era Part Information ATtiny88 Flash Size 01000 Sram Size 0x200 Eeprom Size 0x40 Memory Segments Address Add Remove Memory Type Name ok or add from original location Header h Library a Example c Use actual path of your TLib installation AVRTS2080A Keys Slider Rotor TLib Path megaAVR tinyAVRand XMEGA libray QTouch library library files libavr4g2 8qt k 2rs a AVRTS2080A only Keys TLib Path megaAVR tinyAVRand XMEGA lib
3. Sania DQT_NUM_CHANNELS 8 DQT_NUM_CHANNELS 8 Z Use WindvR DDELAY_CYCLES 4 DDELAY_CYCLES 4 avrgee C Win VR 2009031 3 bin avr gec exe DPORT X B DPORT X B make C WindVR 2009031 3 utils bin make exe DPORT YA D DPORT YA D DPORT_YB C DPORT_YB C mie DPORT_SMP D DPORT_SMP D TLib Configuration see details in QTouch Library User Guide DSMP_BIT 7 DSMP_BIT 7 D DEBUG INTERFACE D DEBUG INTERFACE D DEBUG INTERFACE Remove to save memory or s a S f 7 7 add for QTouch Studio or Hawkeye D QT_MAX_NUM_ROTORS_SLIDERS 2 DQT_MAX_NUM_ROTORS_SLIDERS 0 DQT_DELAY_CYCLES Match to Sensor Tuning QTouch Charge Time D_ROTOR_SLIDER_ DDELAY_CYCLES Match to Sensor Tuning QMatrix Dwell Time g7 Build Build gt Rebuild All AVR Studio If any errors then check that you have a matching set of Target IC Header h Library a Main c File Project Build view Tools Debug Helg J a GeLbuig WinAVR GCC Notes com pared to IAR Trace Disabled e There is no difference between Debug Build and Release Build a re A E ee e There is no need to set Stack sizes ompile g8 Connect Programmer For photos of ICE connections see QTouch Studio Help In Circuit reprogramming e Powerdown Target and ICE or unplug USB from each e Connect ICE to Target ISP 6wire or djW 2wire if debugWire was already enabled e Recheck Pin is correctly connected to Target Label PCB and ICE Cable e Connect ICE to PC USB or RS 232 If po
4. bytes Depth levels ec AVR ONE a A CCR ICE200 JTAGICE JTAGICE mkII Dragon Simulator Third Party Driver F Multi file Compilation j Language Code Optimizations Output List Ignore standard include directories TOOLKI T_DInS SIN TOOLKIT_DIR SINCSCLIBS Additional include directories one per line Third Party Driver Defined symbols one per line Preprocessor output to file OTOUCH_ DEBUG_INTERFACE r T_NUM_CHANNELS 9 SNS D TLib Configuration see details in QTouch Library User Guide Remove to save memory EEU leh tee Add for QTouch Studio or Hawkeye QT_DELAY_CYCLES Match to Sensor Tuning QTouch Charge Time DELAY_CYCLES Match to Sensor Tuning QMatrix Dwell Time o AVRTS2080A ATmega88 o AVRTS2080B ATtiny88 This is Default for new IAR Projects Options for node 2080A Category Factory Settings General Options C C Compiler Assembler Custom Build Output Extra Output Hdefine Diagnostics List Config Proce_4 gt Output file AVR ONE Override default Secondary output file CCR ICE200 ITAGICE JTAGICE mkII Dragon Simulator Third Party Driver None for the selected format ormat Debug information for C SPY V With runtime control modules IY With 1 0 emulation modules fa Allow C SPY specific extra output file Module local symbols Include all Project Options General Options System
5. Creating an Atmel QTouch Library Project using GCC or IAR 2009 11 17 v14 Paul Russell Atmel QRG FAE This document is intended only as a quick start guide for Atmel QTouch Library TLib This Guide will show you how to make a new TLib project from scratch and get to Debug amp Run using either IAR Embedded Workbench or AVR Studio with WinAVR GCC For further details please refer to the appropriate documents listed in TLib is a Library Module that can be linked with your application to provide Capacitive Touch Sensing For those not familiar with libraries or libraries linked to hardware then it may help to think of TLib as just AVR MCU another MCU Module that can optionally control some I O pins similar to hardware modules like WDT I2C UART Timer ADC All the modules provide registers or settings to select which MCU pins they use There are AppNotes with sample code showing how to use the hardware modules similarly there are a Guide and examples showing how to use the software TLib module Much of ROM and Stacks used by a TLib example would be required for a non touch application so incremental resource usage to add Touch is less than in the TLib guide Ensure you have all the required software installed and the appropriate equipment and documentation You may wish to completely uninstall previous versions of all software packages for a fresh start a Install Atmel Tools http www atmel com Products gt Touch Solutions g
6. II Dragon JAR Embedded Workbench IDE o Build format Project gt Options gt Linker gt Format Debug Information for C Sp eneral Option ssembler ICE200 ITAGICE ITAGICE mkII Dragon Simulator river Project must be highlighted to access Project Options V Run to main ebug Tool M Use UBROF reset vector Device description file Factory Settings M Use macro file M Override default Selected Debug Tool is shown in the Menu bar Cancel 5 IAR Embedded Workbench IDE File Edit view Project Debug Tool Te O ca Debug i8 Select the appropriate Target IC Project gt Options gt General options gt Target Options for node m88qt8 General Options Assembler Custom Build Build Actions Linker Debugger CCR ICE200 JTAGICE JTAGICE mkII Dragon Iv Simulator Third Party Driver Target Output Library Configuration Library Options Heap Configu_4 gt Processor configuration Target IC Use b4 bit doubles Memory model Small nd System configuration V Configure system using dialogs not in CL file T Cancel i9 Enable I O Bit Definitions and set size of Stacks Options for node 20804 General Options l Assembler Custom Build Library Options Heap cutout sm omc 2004 MISR _4 gt Build Actions Data stack C Retum addres Linker 4 Debugger Size
7. Incpading Upgrade successful Firmware successfully upgraded Cycle power rat Uparadna race Disable si A 2 e ICESO Selftest as on the AVRDragon before reconnecting to it lt Source Files AVR ONE Upgrade b 3 Header Files AVRISP mkII Upgrade Time elapsed OK Done J External Dependenci E Other Files 4 R Dragon Upgrade or STK600 Upgrade Customize USB Driver To update USB Driver install Atmel FLIP package and check installation notes in files Flip Install Folder Readme Update USB Disconnect other USB devices before doing this procedure USB port may show with different driver names Plug Unplug ICE or TLib Demo device to find which device in the list is correct If issue connecting to ICE by USB try ICE with RS 232 or a USB to RS 232 adapter ex JTAG ICE MKII has both USB and RS 232 USB issues are usually due to Windows Driver issues and corrected by updating the driver but in some rare instance it is possible that some other software may conflict A reformat and clean Windows install will certainly cure the issue by clearing software history but that isn t always reasonable i2 Prepare project files copy to Project Folder created in step i1 or add from original location Header h Library r90 Example c o Refer to the Tables and Examples listed in the Atmel QTouch Library User Guide o Default TLib install path TLib Path C Program Files Atmel Atmel QTouch Libraries 3 1 Use actual pa
8. eet ciel 3 macr iver Wor ks pace I Use o file AYR ONE ICE200 JTAGICE JTAGICE mkII Third Party Driver z Output format motorola Selected IAR Embedded Workbench IDE _D_ _ Debug Tool File Edit View Proje I Te Modulelocal symbols incudeal is shown in Oe Hg the Menu bar bebus sss i22 Select the appropriate Target IC see Step i8 Project gt Options gt General options gt Target i23 Enable I O Bit Definitions and set size of Stacks see Step i9 Project Options gt General Options gt System i24 Set TLib build options for Release Project gt Options gt C C compiler Preprocessor Tab NDEBUG This IAR definition is used for Release Builds kkk see Step i10 for required TLib Definitions _DEBUG_INTERFACE_ Release code usually has a dedicated interface so if unused remove the TLib Diagnostics code i25 Save the Workspace File Save Workspace i26 Build the Project see Step i113 Project Rebuild All or Projects Make For programming with other software it may be necessary to disable DebugWire see step Recheck Pin is correctly connected to Target Label PCB and ICE Cable i29 Load into Programming Tool Stack Warning Debug information Project Download and Debug The stack plug in Failed to set a breakpoint on main The Stack window will not be able to display stack contents isnt included in Don t Click RUN You can change this setting in
9. es5 ch_references6 ch_references7 sensor_deltasO sensor_deltas1 sensor_deltas2 sensor_deltas3 sensor_deltas4 sensor_deltas5 sensor_deltas6 sensor_deltas7 sensor_states rotor_sliderO rotor_slider1 sensorcfgO sensorcfg1 sensorcfg2 sensorcfg3 sensorcfg4 sensorcfg5 sensorcfg6 sensorcfg7 AppDataBO AppDataB1 AppDataB2 CycleCounter sensor_delta gt_get_sensor_delta i output_to_debugger uint8_t amp sensor_delta sizeof int16 t eek oh a ke OMNODNAWNOONDODAWNA PASSE NS amp qt_measure_data qt_touch_ status uint8 t sizeof qt_measure_data qt_touch_status output_to_debugger uint8_t amp sensor_config 0 uint8_t sizeof sensor_config Channels output_to_debugger uint8_t send_debug_byte b appdata0 send_debug_byte b_appdatat send_debug_byte b_appdata2 send_debug_byte b count DODDDDDDDOOAWOODEY 000 pop VUVNNNNNNNNNNNNNYN SSSASSAAAAAAOWOO DO UUNNNNYYNNNNNNASABBBBBB Minimized Diagnostic Data output for one key Ref Sig Delta Status and an application status word Minimized Hawkeye File static void report_debug_data void Tur a 1 3 Delta int16_t sensor_delta re oe output_to_debugger uint8_t amp qt_measure_data channel_references 0 uint8_t sizeof qt_measure_data channel_references 0 output_to_debugger uint8_t amp qt_measure_data channel_signals 0 uint8_t sizeof qt_measure_data channel_
10. mal FastDebug This can be temporary assignment during code development o Design code to run CPU as needed when pin is HI internal pullup but to keep CPU at full speed when this pin is LO o Use a switch or jumper wire to connect Debug Pin to Gnd when need to interrupt code for debugging Reload Breakpoint View memory Interface and Protocol options In some projects the AVR will be both the Host processor and the Touch controller such that an interface isn t required while in other cases the interface will be predefined by existing equipment possibly as either a serial protocol or Pin Per Key interface PPK For cases where a simple new interface protocol is required the below ideas may help as the diagnostic output for QTouch Studio and Hawkeye isn t suitable for real products do to the high volume of data output An example of a simple single byte protocol with optional host control of timing power and sensor configuration o Tx 1 byte of 8 touch status bits or 1 slider position 255 NoTouch or if AKS enabled the can Encode the Touch status like Ox00 0x7F Slider7bit Ox80 0OxBF Wheel6bit OxCO OxEF Key0 47 OxFO OxFD Error0 13 OxFE Calibrating OxFF NoTouch o Rx 1 2 bits of received byte to control sampling response time power Fast Low Power and FullSleep Can t Touch see t1 o Rx Use some bits to select configuration so one firmware file can be used for many products or operating modes reducing programmed IC stock and
11. nfinastion Litesy Orsoy Heep Conky a Custos Lapuaze Code Optineastions Dapat Lit Praprocesior O41 lt Sos C Speed High eanan of ort Bal at CUB heap rine Language ee HEAP D an eC Enabled opaniaabor DLE haw ares wi Crowe rojo IN M Regas peototypes Saves Laue contomence y A ty w lt Aim Hunter cf conecalpaiwen Lndrwted inne iiaii eae Released 50 ANS Stact ISOLASI Shanes do over call opirarakbon Note Thehaape vl or te 3777 mied i he oe Enable ra ist support If any errors then check that you have a matching set of Target AVR IC Header h Library r90 Application c re ae Debug libv1 g4 8qt k Ors r90 g E main_atmega88 c eee Known Issue Linker Warning w6 ouput define BOARD_ID EVK2080A Builds for some AVR will present this warning please ignore 20608 Messages Linking unsigned char PORTC_PORTCS 1 disp 5 Warning w6 Type conflict for external entry _A_DDRC in module main_atmega88 unsigned char PORTC_PORTCS 1 disp 6 against external entry in module burst_10_ BC eee ele class struct union field base types do not match for field base class struct union _io volatile _A PORTC field names do not match DDRC_Dummy7 vs DDRC_DDC7 Total number of errors 0 Total number of warnings 64 Total number of errors 0 Errors 0 Warnings 64 Total number of warnings i114 Connect Programmer For photos of ICE c
12. onnections see QTouch Studio Help In Circuit reprogrammin Powerdown Target and ICE or unplug USB from each Connect ICE to Target ISP 6wire or dW 2wire if debugWire was already enabled Recheck Pin is correctly connected to Target Label PCB and ICE Cable Connect ICE to PC USB or RS 232 If power switch then turn on ICE Powerup Target Connect USB If power switch then turn on Target 115 Load into Programming Tool Project gt Download and Debug IAR Embedded Workbench IDE File Edit view Debug Tool O we 5 Selected Debug Tool l Workspace ll is shown here Debug 1 i16 You may need to enable Debug Wire dW is disabled in new ICs for Power Measurements and for Release Builds Project Download and Debug gt Yes Power Down Target Power Up Target OK To enable debugWire ensure ICE is connected to Target using ISP 6wire cable Vcc SPI ISP Reset dW Gnd JTAGICE mkl Power Down Target DWEN Fuse for dW Unplug USB ey AVRTS2080 JTAGICE mkll No contact with device when using debugWire The DWEN fuse must be enabled to use debugWire Programming the D WEN Fuse completed Option ICE cable change Do you want to program this fuse from JTAGICE mkII All SPI lines must be connected before you click YES S P 6wi re t o dW 2wi re Now switch power off on on the target device before continuing Click NO to just retry making contact You might need to power the device off and on before clicking NO Powe
13. production costs Also for run time reassign of sensors ex KeysSSlider use gt_reset_sensing Multi byte IO o Simple using Bit7 as First byte Flag First byte Bit7 1 other bytes Bit7 0 Data in BitsO 6 of each byte many Keys Sliders Wheels o Numerous other protocols exist that include byte synchronization and or checksum I2C DLE Stuffing STX ETX etc t4 Hawkeye may be used to monitor Touch Data and application specific data in near real time Copy Paste below to c and txt This can be helpful if the project needs to be debugged in real time or if the ICE pins are needed by the application Standard diagnostic data output modified for monitoring by Hawkeye Hawkeye Control File to append 3 bytes of application data and a cycle counter 4Bytes static void report_debug_data void E ch_signals1 ch_signals2 ch_signals3 ch_signals4 ch_signals5 ch_signals6 ch_signals7 ch_referencesO ch_references1 ch_references2 Debug Option uint8 ti int16_t sensor_delta static uint8_t b_ count Counter output_to_debugger uint8_t amp board_info uint8_ t sizeof board_info output_to_debugger uint8 t amp qt_measure_data channel_signals 0 uint8_t sizeof gt_measure_data channel_signals output_to_debugger uint8_t amp qt_measure_data channel_references 0 uint8_t sizeof qt_measure_data channel_references for i Ou i lt QT NUM CHANNELS i ch_references3 ch_references4 ch_referenc
14. r Up Target A Connect USB to AVRTS2080 i17 After enablinc i18 To disable debugWire for Low Power measurements or Release Builds o In Debug Tool Menu enable Y Ending Session Disables DebugWire o Exit Debug mode Debug gt Stop Debugging auto disables DWEN fuse o ICE will need ISP 6wire cable for further actions i19 Run the Program and do your tests Debug Go If your program outputs appropriate diagnostic data then you may view the data using QTouch Studio or Hawkeye Note Pins connected to ICE won t be able to Touch Detect Use debugWire cable to free these pins step i17 i20 To stop debugging Debug Stop Debugging For Release Build continue at step i21 if finished continue at step i32 i21 Select Release Build to create a file for final testing and production Option use other software to FLASH like AVR Studio o Select Programming Tool ISP ICE Project gt Options gt Debugger STK600 JTAG ICE MKII Dragon o Select output format Typical formats include motorola intel hex Production output typically doesn t contain debug info o Some tools only program ICs mounted on PCB while tools like STK600 support in circuit programming and programming sockets AR Embedded Workbench C 0 lt i a For programming with IAR use Motorola format File Edit View Project Tools Window Help Options for node 2080A ugins bl ety Driver Fiun bo i eb eee ebug Tool o usnoreavan I
15. ray QTouch library library files libavr4g2 8qt k Ors a AVRTS2080B Keys Slider Rotor TLib Path megaAVR tinyAVRand XMEGA libray QMatrix library library files libt88_8qm_4x_2y_krs_2rs_YL_LO_NIB a AVRTS2080B only Keys TLib Path megaAVR tinyAVRand XMEGA libray QMatrix library library files libt88_8qm_4x_2y_k_Ors_YL_LO_NIB a o Application Copy file to Project Folder Note 2080 examples have different sensor assignments from other library examples AVRTS2080A AVRTS2080B TLib Path megaAVR tinyAVRand XMEGA libray QTouch library Example projects 2080A_gnu_example main_atmega88 c TLib Path megaAVR tinyAVRand XMEGA libray QMatrix library Example projects TS2080B_qm_example_gnu main c g4 Add Application file to Project Right Click on project gt Add Existing File s gt add c from step AVR Studio AVR Studio File Project Build Edit Yiew Tools Debug Wind File Project Build Edit wiew Tools Debug Window 1G ia f i Se ED i Ee ET T a i gA Trace Disabled SSma x 7 GR Trace Disabled Rae Se a T a a vx AVR GCC vx ages mesata Build Project Rebuild Project _gcc_m68gqt8 default B main_atmegass c Header Files 3 External Dependencies Ss oer nl 3 Other Files g5 Select Library Path and add library a from step 1 Project gt 2 Configuration Options gt 3 Libraries gt 4 Folder gt 5 Path gt Select Project folder created in step g1 Folder appears as AVR Studio _gcc_mB8qt8 Project Op
16. s i Empty project C C Externally built executable Add existing project to current workspace Open existing workspace On Te ra A Example applications Recent workspaces Desktop My Documents My Computer Description Creates an empty project gt File name My Network Save as type Project Files ewp Places Do not show this window at startup Cancel Cancel Look in 20804 M e a Look in 20804 vl 4 ek EA Add Files I mn LJ El libv1g4 8qt k Ors r90 LJ dd aPOUP Recent E libv1g4 8qt k 2rs r90 Recent Import File List Edit Configurations LS Desktop Desktop Create New Project LS LS Add Existing Project Me tocunerts My Documents Options Alt 48 8 My Computer My Computer Source Code Control Make D D My Network File name My Network File name Places Places adel ane or more Fil Rebuild All Files of type Files of type C C Source Files c cpp cc Save Workspace As Save in settings cd ICO Debug Recent Desktop My Documents g My Computer gt i My Network File name Places x Cancel i6 For Debug Build continue at step i7 or for Release Build continue at step Save as type Workspace Files eww i7 For debugging in IAR Embedded Workbench select Debug Build with o Select Debug Tool ICE Project Options Debugger JTAG ICE MK
17. signalsj 0 sensor_delta gt_get_sensor_delta 0 output_to_debugger uint8_t amp sensor_delta sizeof sensor_delta output_to_debugger uint8_t amp qt_measure_data qt_touch_status uint8_t sizeof qt_measure_data qt_touch_status output_to_debugger uint8_t amp w_appdatad uint8_t sizeof w_appdatad 16 bit t5 Hawkeye Operation a Start Hawkeye exe use File gt Open to select a Hawkeye Control file with format matching report_debug_data void b Logging Start Finish Click Open to see data automatic filename c Hawkeye 3D Graph control using Mouse click Display Icon to select data to display fhe a utes hienn Select data Zoom Mouse Scroll Up Down ae to Displa Tilt Mouse Click amp Drag Viewpoint gt ies Q Manual scaling f
18. t QTouch Library gt QTouch Suite QTouch Suite http www atmel com products touchsoftware qtouchsuite asp family_id 702 Download AVR Studio o Install AVR Studio 4 17 or newer a required for ICE support htto Avww atmel com dyn products tools _card asp tool id 2725 includes Debugger for GCC or IAR o QTouch Library User Guide Optional o Install QTouch Studio with Visual Studio NET e alee Guide http www atmel com dyn productsitools card touch asp tool id 4627 Install QTouch Library 3 1 or newer o AVR254 pdf and zip Install Development Environment choices IAR IAR Embedded Workbench See http www iar com website1 1 0 1 0 107 1 index php All Licenses OK Full 30 Day Free Kick Start 4 This Guide was prepared using IAR Embedded Workbench for Atmel AVR v 5 30 4K Kickstart edition EWAVR KS WEB 5302 exe This Guide uses IAR Embedded Workbench to do both Compiling and Debugging Option Debug using AVR Studio GCC GCC with Debug using AVR Studio See Section 4 TLib with GCC Reference http support atmel no bin customer custSessionKey amp customerLang en amp noCookies true amp action viewKbEntry amp id 226 WinAVR GCC _ http sourceforge net projects winavr files This Guide was prepared using WinAVR 20090313 install exe and AVR Studio 4 17 build 666 112 MB updated 7 09 Prepare test PCB TLib Demo unit or your own PCB design with Atmel AVR MCU and Touch Sensor Patterns The Da
19. tasheet for the Atmel AVR IC you will use Please see Help in QTouch Studio for information about TLib Demos including Schematics and Programming Tools This Guide uses TLIB Demos AVRTS2080A and AVRTS2080B as examples equal to EVK2080A EVK2080B Prepare ICE or ISP compatible with your PCB or the TLib Demo For compatible Development Tools please refer to AVR IC s datasheet and AVR IC s webpage Please see Help in QTouch Studio for Development Tools compatible with TLib Demos Ensure ICE and drivers are up to date see Updates section below Please ensure ICE ISP frequency set according to ICE Instructions Typically lt 14 target s frequency If CPU changes frequency on the fly please see Section 5 item t2 Option Install Additional Software Tools e Hawkeye Viewer for two wire data Available from Atmel FAEs can also display application variables beside TLib step t4 e Flip Tool to In Circuit Program AT9OUSB used in TLib Demos hitp atmel com dyn products tools_card asp tool_id 3886 e 5030 USB Bridge In Circuit Bootload Package for AT90USB MCU as used in TLib Demos Available from Atmel FAEs Download QTouch Library ICE Upgrade Use AVR Studio to update the ICE s internal firmware Tools gt Upgrade Power Cycle ICE when Upgrade complete AVR Studio AVRDragonUperade Upgrade AVR Dragon AvrDragonUperade 2 AVRDragonUpgrade File Project Build View Tools Debug Help 1 la A AVR Prog A l e eae Stat U
20. th of your TLib installation o TLib API Header Copy to Project Folder or step i4 do Project Options C C Compiler Preprocessor Additional Include directories All TLib projects TLib Path include touch_api h o Library Copy file to Project Folder or at step i4 do Project Options C C Compiler gt AVRTS2080A Keys Slider Rotor TLib Path megaAVR tinyAVRand XMEGA libray QTouch library library files libv1g4 8qt k 2rs r90 AVRTS2080A only Keys TLib Path megaAVR tinyAVRand XMEGA libray QTouch library library files libv1g4 8qt k Ors r90 AVRTS2080B Keys Slider Rotor TLib Path megaAVR tinyAVRand XMEGA libray QMatrix library library files libt88_8qm_4x_2y_krs_2rs_YL_LO_NIB r90 AVRTS2080B only Keys TLib Path megaAVR tinyAVRand XMEGA libray QMatrix library library files libt88_8qm_4x_2y_k_Ors_YL_LO_NIB r90 o Application Copy file to Project Folder Note 2080 examples have different sensor assignments from other library examples AVRTS2080A TLib Path megaAVR tinyAVRand XMEGA libray QTouch library Example projects 2080A_iar_example main_atmega88 c AVRTS2080B TLib Path megaAVR tinyAVRand XMEGA libray QMatrix library Example projects TS2080B_qm_example_iar main c i3 Start IAR Embedded Workbench create a new empty project select Project Folder created in step i1 save project Embedded Workbench Startup Create New Project Save As Create new project in current workspace Tool chain 3 Recent Preis prom lobo
21. the Tools gt Options dialog box re ease bu i d so m ay see this message i30 Set for debugWire disable upon exit to minimize IC power Debugger Menu enable v Ending Session Disables debugWire i31 Finished Programming Debug Stop Debugging i32 Powerdown Target Unplug USB from EVK2080 i33 Power down Programmer i34 Disconnect Programmer from Target i35 Powerup Target and test it i36 Log results i37 Exit all software tools o GCC Style Note For data in ROM using GCC see PROGMEM AVR Libc Guide http Awww nongnu org avr libc user manual index htm htto Awww nongnu org avr libc user manual pgmspace html g1 Start AVR Studio create anew AVR GCC project in desired new project folder select ICE and AVR IC save project Welcome to AVR Studio 4 Welcome to AVR Studio 4 Welcome to AVR Studio 4 E 3 Recent projects Create new project Project type Modified Initial file NP hiai sacr bler AVR GCC N C Create initial fileli V Create folder A s Ver 417 666 Y Show dialog at startup Ver 417 666 g2 Check the Stack Starting address matches the Datasheet Project Configuration Options gt Memory Settings gt Stack settings For most AVR the stack is automatically set but for ATtiny88 used in demo AVRTS2080B use M Specify Initial Stack address 0x2FF g3 Prepare project files copy to Project Folder created in step 9 Configuration Options l 20804_gce Port Auto v
22. then Debug gt Stop Debugging Connect ICE to Target using 6wire ISP cable You may wish to power down target while switching cables Start fresh debug using Debug gt Start Debugging Select ICE Options ALT O or bottom option in Debug pulldown menu Debug Options ICE you are using Select Connection gt Disable debugWire Yes gt wait for message leaving debug mode gt OK gt OK In AVR Studio Help see On Chip Debugging with the JTAGICE mkll subsection Re enabling the ISP Interface g19 Exit all software tools OW a Ca Some options for Timing and Low Power Control Refer to AVR IC s Datasheet for Low Power modes Use __delay_cycles with appropriate count for required period Like a but set CPU to slow before then fast after such that AVR is using Low Power during __delay_cycles Use Timer to generate an interrupt and use __sleep with Low Power Mode while waiting Use Watchdog with low speed oscillator as wakeup source and use __sleep with Low Power Mode while waiting Use a pin as an External Interrupt Source and use __ sleep with Lowest Power Mode while waiting Set for wakeup upon communications event and use __sleep with Lowest Power Mode while waiting For e and f the Touch Response timing and Low Power Mode are controlled by the External source and can vary then ensure CPU switches back to starting frequency before using debugger functions o Assign a spare AVR input pin as Nor
23. tions Project Wizard General New Project laa Include Open Project Save Project Close Project Available Link Objects Link with These Objects eee faiai Add Object pile pistes Cancel Help Recent Projects libprintf_flt a libprintf_min a libscant_flt a libscanf_min a p y Memory Settings A Custom Optio gt 6 Select a from step General Include Directories Libraries p ad Memory Settings Fa Available Link Objects Custom Option gt Add Library gt 8 0K GIA Link with These Objects libayr4g2_8qt_krs a Add Library gt Add Object pele Rey OK Cancel Help a g6 Set TLib build options Project gt ZiConfiguration Options gt BiCustom Options gt Ailtem to Add D gt SAdd OK Repeat Steps 4 and 5 for each item More Add to Defined Symbols or put in C file before include touch_api h QTouch Keys Slider Rotor QTouch only Keys 2Z080A_ecc Project Options D_QTOUCH__ D_QTOUCH__ mei E io DQT_NUM_CHANNELS 8 DQT_NUM_CHANNELS 8 oa val DQT DELAY _CYCLES 1 DQT DELAY _CYCLES 1 main_atmega8s c gdwarf 2 D Include Linker Options Directories std gnu33 funsigned ch DSNS D DSNS D funsigned bitfields DSNSK B DSNSK B i trin D_DEBUG_INTERFACE_ D_DEBUG_INTERFACE_ Libraries D_ROTOR_SLIDER_ p vy QMatrix Keys Slider Rotor QMatrix only Keys D_QMATRIX_ D_QMATRIX_
24. wer switch then turn on ICE e If power switch then turn on Target g10 First Time you use ICE with an AVR you may need to enable debugWire DWEN Fuse for dW Debug gt Start Debugging gt Use SPI gt OK gt Power Down Target Power Up Target OK To enable debugWire ensure ICE is connected to Target using ISP 6wire cable Vcc SPI ISP Reset dW Gnd After enabling debugWire you can switch to dW 2wire cable dW Gnd freeing the ISP pins for Touch SPI AVR Dragon Power Down Target AVR Dragon Unable to connect to device This could be caused by reset line circuitry or disabled debug IRE interface Make sure that the reset line is free before continuing For connection issues please press the help button O ptio n C E ca b e ch an g e cycle target power to continue debugging You may now disconnect the additional SPI lines U n pl u g U S B O EV K2080 The debugWIRE interface is now enabled Please C Retry debugw IRE connection ISP 6wire to dW 2wire Y Power Up Target Cancel __ Hep Connect USB to EVK2080 A g11 Run the Program and do your tests Debug gt Run If your program outputs appropriate diagnostic data then you may view the data using QTouch Studio or Hawkeye Note Pins connected to ICE won t be able to Touch Detect Use debugWire cable to free these pins see step g10 g13 To disable debugWire for Low Power measurements or Release Builds e Stop any debugging session in progress Debug gt Break
Download Pdf Manuals
Related Search
Related Contents
HARDWAXOIL MAGIC GUÍA RÁPIDA - Amazon Web Services Copyright © All rights reserved.
Failed to retrieve file