CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Touchpanel with PIC

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Sterngleiter



Joined: 07 Jan 2013
Posts: 90

View user's profile Send private message

Touchpanel with PIC
PostPosted: Thu Mar 07, 2013 2:41 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Mar 07, 2013 3:06 pm     Reply with quote

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

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Mar 07, 2013 8:24 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Mar 08, 2013 12:16 am     Reply with quote

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

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Mar 08, 2013 12:48 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Mar 08, 2013 5:38 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Mar 08, 2013 8:52 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Mar 08, 2013 12:43 pm     Reply with quote

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!!!!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group