--_003_51F9037A5000205yahoocombr_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Em 31/07/2013 08:20, alan.b.pearce@stfc.ac.uk escreveu: >> I did it with a PIC16F648A and a Nintendo DS resistive touch-screen in C= .. >> The source code is not at hand right now. Later I will post the code and >> the schematic. >> > Thanks, would appreciate it. > > Sounds like it is similar to the first link that Radhakrishnan posted, bu= t I would still like to look at it. Here it is. I was mistaken about the MCU, I used the PIC16F690. The schematic is just for the touch circuit to save bandwidth, you are using a different MCU anyway. The function of the resistors is to give a voltage level clearly different when the panel is not touched. In my setup I got readings close to zero in both X and Y axis when the panel is not touched and above 300 when it is touched. I used the threshold of 50 for testing purposes. The code below was trimmed just to the minimum necessary. The delays are too long and can be reduced a lot, some of them can be completely eliminated. They were introduced to try to eliminate an interference when the equipment was used in a nightclub but were ineffective and I forgot to remove them. It seems that inside a nightclub there is a lot of RFI and the conductive surfaces of the touch-pad are an excellent antenna. Best regards, Isaac //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D // Copyright (c) 2011, Isaac Marino Bavaresco // All rights reserved // isaacbavaresco@yahoo.com.br //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D // Set TAB width to 4 characters //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D // // PIC16F690 // // +-----------------U-----------------+ // | | // VCC P> =3D=3D| 1 VDD VSS 20 |=3D=3D

=3D=3D| 2 RA5/CLKI RA0/ICSPDAT 19 |=3D=3D <-> PGD // | | // =3D=3D| 4 RA3/MCLR AN2/RA2 17 |=3D=3D TOU= CH_B // | | // N.C. <0 =3D=3D| 5 RC5 AN4/RC0 16 |=3D=3D TOU= CH_L // | | // PWR_ON <- =3D=3D| 6 RC4 AN5/RC1 15 |=3D=3D TOU= CH_T // | | // N.C. <0 =3D=3D| 7 RC3 AN6/RC2 14 |=3D=3D TOU= CH_R // | | // VSENS2 A> =3D=3D| 8 RC6 RB4 13 |=3D=3D N.C= .. // | | // +-----------------------------------+ // // Legend: // "<- |" or "| ->" =3D Output-only signal // " -> |" or "| <- " =3D Input-only signal // "<-> |" or "| <->" =3D Bi-directional signal // " P> |" or "|

|" or "| |" or "| " =3D Output or analog input signal // "<0 |" or "| 0>" =3D Always zero output signal // "<1 |" or "| 1>" =3D Always one output signal // "" =3D Crystal output signal // " x> |" or "|