View previous topic :: View next topic |
Author |
Message |
Sterngleiter
Joined: 07 Jan 2013 Posts: 90
|
Touchpanel with PIC |
Posted: Thu Mar 07, 2013 2:41 pm |
|
|
Hi, has anyone any experience with touch panel.
4 connections. Can applies it to pin 1 (+5 V) and pin 3 (0V) will be read on pin 2 or 4 analog (potentiometer principle). But I have the following problem and that if I said I read mooring tensions with voltmeter also appropriate from the pic but also when no contact is going analogue channel at 255 why? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Thu Mar 07, 2013 3:06 pm |
|
|
You'll have to tell us what 'touch panel' and which PIC !
Mfr/make/model ???? or a LINK to the datasheet of the touch panel.
Also post your program.
The more information you supply the faster we can reply to you.
hth
jay |
|
|
jgschmidt
Joined: 03 Dec 2008 Posts: 184 Location: Gresham, OR USA
|
|
Posted: Thu Mar 07, 2013 8:24 pm |
|
|
If you are using a 4-wire resistive touch panel you may want to use an interface chip such as the ADS7843 or TSC2000, both from TI/Burr Brown. You still have to do a lot of your own housekeeping with the ADS7843 but it is cheaper, smaller and goes to 5V. TSC2000 uses around 3V and costs a few dollars more but does all the work for you, handing you an interrupt and x/y values for every touch. Google the chips to find sample code. _________________ Jürgen
www.jgscraft.com |
|
|
Sterngleiter
Joined: 07 Jan 2013 Posts: 90
|
|
Posted: Fri Mar 08, 2013 12:16 am |
|
|
http://www.lcd-module.de/eng/pdf/grafik/dogs102-6e.pdf
this touch panel. Is it as if nothing connects to an analog input which it operates as a proximity sensor. With a potentiometer works the entrance as soon as I put out then the diode is at PIN_C3 like a sensor.
why is it so
Code: |
void main()
{
unsigned int16 x=0;
setup_adc_ports(sAN1|VSS_VDD);
setup_adc(ADC_CLOCK_INTERNAL);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_comparator(NC_NC);
output_high(pin_a2);
output_low(pin_c1);
port_a_pullups(true);
output_low(pin_c3);
while(1)
{
set_adc_channel(1);
delay_us(20);
x=read_adc();
delay_ms(2);
if (x>127)
{output_high(pin_c3);
}else
{output_low(pin_c3);}
}
}
|
|
|
|
jgschmidt
Joined: 03 Dec 2008 Posts: 184 Location: Gresham, OR USA
|
|
Posted: Fri Mar 08, 2013 12:48 am |
|
|
The ADS7843 and TCS2000 are designed to work with this touch panel. I do not recommend trying to connect the touch panel directly to the PIC. Spend a few dollars on a controller chip and save many hours of hair pulling. Here is a technical document that describes how the touch panel works and what the controller does for you:
http://www.ti.com/lit/an/sbaa036/sbaa036.pdf _________________ Jürgen
www.jgscraft.com |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19499
|
|
Posted: Fri Mar 08, 2013 5:38 am |
|
|
You need a buffer amplifier.
They are quite useable by the PIC, but the output impedance is hundreds of kilo ohms. The PIC needs quite a low impedance source (how low depends on the PIC), but at least an order of magnitude lower than resistive touch screens typically give.
Best Wishes |
|
|
John P
Joined: 17 Sep 2003 Posts: 331
|
|
Posted: Fri Mar 08, 2013 8:52 am |
|
|
I designed an interface for a 4-wire touch screen that worked very well--no additional hardware needed. But I won't claim that it's always going to be possible: you'd have to compare your panel's resistance with the specs for a PIC A/D input. |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1933 Location: Norman, OK
|
|
Posted: Fri Mar 08, 2013 12:43 pm |
|
|
CircuitEd sells a 4 wire resistive touchscreen overlay that can be directly connected and also a GLCD with the same touchscreen incorporated.
I have used both and they work very well. _________________ Google and Forum Search are some of your best tools!!!! |
|
|
|