QTOUCH's silent assumptions

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi gang,

I tried to use the QTOUCH lib 4.4 from Atmel and could not get it running. My touch configuration:

    Port B0/1 Key Port B2/3 Key
    Port A0/1/2 Rotor
What I saw in simulation (and with the scope) was the use of B0-B4, nothing on A! After a long search I found this mystery. Whenever I make an AVR develoment I use makefiles instead of Studio behaviour. So I converted an example
from Studio's project definition to makefile and to make it more readable I add the specialities to an
mfile generated makefile template. Normally this works fine and give me the feeling of knowing what I do.

This time I did it the same way. Makefile, and Windows (MS-DOS absolute pathnames) is a bad combination - the colon confuses make, anyway. All defines necessary for the QTOUCH-lib I put into the CDEFS.

This is the major fault!

Some of them might be necessary for a C-program but the majority is checked by "touch_qt_config.h" which is part of the common files directory. In here you find

/**
  * Define the ports to be used for SNS1 and SNSK1 pins. SNS1 and SNSK1 port pins
  * can be available on the same port or on different ports
  *
  * Possible values: refer to the device data sheet and QTouch libraries user guide.
  */
#ifndef SNS1
#define SNS1            D
#endif
#ifndef SNSK1
#define SNSK1           B
#endif

for SNS1 and same block for SNS[K]2

This file is included by qt_asm_*.S (not in the example directory)! Therefore the whole define-story of the makefile has to be set for ADEFS to provide it to the assembler. After setting this properly my problem was gone.

@Atmel: Please remove assumption blocks from you examples. Invalid parameter should prevent compilation. This is an easy to find/solve situation. While your assembler sources do not extend compile time with additional comments it is not very useful to have assumptions in the header-files. Additionally if you want to support programmers why don't you check by your self if SNSi and SNSKi are on the same port and set the define _SNSi_SNSKi_SAME_PORT_ by yourself? That whould be a support. And last what is the benefit to put a Library into a selfextracting Windows-program? You are providing the toolchain for Liunx and to use QTOUCH-lib one needs to have a Windows installed!

Cheers,
Knut