آی پی امداد
abtahi
آریا الکترونیک mehrinfo تکشو

تاچ اسکرین و پروژه ای با میکرو کنترولر و ال سی دی 3310

jfrras

مدير انجمن تخصصی الکترونیک
مدیر تالار
2007-04-13
3,097
74,085
48
ایران
سلام دوستان عزیز
این پروژه نحوه کار صفحه های تاچ اسکرین یا لمسی رو آموزش میده ونمونه برنامه هم داره .وبا at32 ,ال سی دی موبایل نوکیا 3310 می باشد.




connecting a resistive touch panel to the microcontroller
Recently, interest has grown huge devaysa have touch control by touchscreen, touchpad and buttons. So I gave in and decided to try a fashion touch control as a replacement for the standard clock buttons. The simplest version, it turned out, ready to use touch screens, which are used in mobile devices. It's about touch screens, made ​​of resistive technology, as they are cheap and easy to work. For experiments got here the touch screen phone Samsung I710.



How does this work

Screens made ​​of resistive technology, mainly consist of two parts - a flexible upper and lower layers of hard. As a flexible layer are different plastic or polyester film, and the second is made ​​of glass. On the inner side of both layers deposited conductive coating with some resistance. The space between them is filled with microscopic insulator, which is uniformly distributed over the surface layer separates the two layers of each other, giving them close.





94.jpg







When touched, the conductive plenochki closed and form the contact, the point of contact forms a simple resistor divider:



7.gif




Thanks to the touch coordinates can be easily calculated using the ADC , having two dimensions (a first for the coordinates, and for the other). To do this on the back of the film serve DC, for example our +5 V (the output of X + 5V serve as the output of the X-connect to the earth.) Thus, at each horizontal section of the backsheet, the current creates a voltage drop proportional to the length of the site, which is what we need to consider. Probe will front the resistive layer, one of the electrodes is connected to the ADC. This will coordinate X. Similarly read and Y coordinate.




Code to determine the coordinates

The code snippet in Bascom-AVR with touchscreen below, one layer uses a connection to 0 and 2 channels of ADC, the other to the 1 and 3 channels.




Touchscreen:



Config Pina. 1 = Output 'Put to the output ports

Config Pina. 3 = Output 'Electrodes are connected to them from the first film

Reset Porta. 1 'sadim electrode to the ground

Set Porta. 3 'set on the electrode voltage

Ddra. 0 = 0 'make the port as input

Ddra. 2 = 0 'here we read the testimony from the ADC



Waitms 100 'wait for abatement of transients



X = Getadc (2) 'Read the X coordinate

X = 1023 - X 'present in convenient form



Xstr = Str (x) 'Ready variables to display



'Repeat for the Y



Config Pina. 0 = Output

Config Pina. 2 = Output

Reset Porta. 0

Set Porta. 2

Ddra. 1 = 0

Ddra. 3 = 0



Waitms 100



Y = Getadc (3)

Y = 1023 - Y



Ystr = Str (y)



Return 'return to the main program loop





95.jpg

touchscreen, which I used to connect a 4-wire cable is quite payabelnyh size (there are five wire resistive touch screens, but the principle of determining the coordinates are not different)
96.jpg


I'm just a matter of location led to the display, using the module for atmega32 with display nokia3310.
97.jpg



98.jpg


Now you can bind the coordinates on any actions, it all depends on the imagination =)


این هم نمونه برنامه بسکام
[hide]مشاهده فایل‌پیوست touchscreen_m32_n3310.rar[/hide]
 

CINAPA

VIP+ افتخاری
کاربر +vip پلاس
vip افتخاری
کاربر
2012-07-25
826
2,478
سلام jfrras
ممنون بابت ارسالی خوبت . اگه در این رابطه اطلاعات کاملی داری و یا پروژه ای هست لطف کنید بزارید
باز هم تشکر . در ضمن مگه این نوع السی دی توبازار هست . خیلی قدیمیه . اگه بتونید با السیدی چینی ان 96 اموزش کاملی بزارید خوبه
 
بالا