Detailed introduction to the working principle of the 4-wire resistive touch screen [zz]

Source: Internet
Author: User

Address: http://www.dzsc.com/data/html/2010-11-8/86953.html

Abstract: This paper briefly introduces the structure and working principle of the touch screen. Taking the touch screen control chip ADS7843 of Burr-Brown as an example, it introduces the typical circuits and operations of the touch screen application. Due to the 12-bit A/D embedded in the ADS7843, the input coordinate recognition accuracy of the touch screen is theoretically 1/4096 of the effective length and width.

  1. Basic principles of Touch Screen

The working part of a typical touch screen is generally composed of three parts, as shown in Figure 1:

A two-layer transparent resistance conductor layer, an isolation layer and an electrode between two-layer conductors. The resistance conductor layer is composed of resistance materials, such as indium tin oxide (ITO) coated on the substrate. The upper substrate is plastic and the lower substrate is glass. The isolation layer is a viscous insulating Liquid material, such as a Polyurethane film. The electrode is made of materials with excellent conductivity (such as silver ink), and its conductivity is about 1000 times that of ITO.

When the touch screen is working, the upper and lower conductor layers are equivalent to the resistance network, as shown in figure 2.

When a layer of electrode is added with voltage, a voltage gradient is formed on the network. If an external force is used to make the upper and lower layers in a certain point of contact, the voltage at the point of contact can be measured on another layer without voltage on the electrode, so as to know the coordinates at the point of contact. For example, if a voltage is added to the top-layer electrode (X +, X-), a voltage gradient is formed on the top-layer conductor layer. When an external force is applied, the upper and lower layers are exposed at a certain point, at the bottom layer, you can measure the voltage at the contact point, and then know the X coordinate based on the distance between the voltage and the electrode (X +. Then, switch the voltage to the underlying electrode (Y +, Y-), and measure the voltage at the contact point on the top layer to know the Y coordinate.

 2 touch screen control implementation

Currently, in many PDA applications, the touch screen is used as an input device and a dedicated chip is used to control the touch screen. Obviously, the control chip of the touch screen has two things to do: one is to switch the electrode voltage, and the other is to collect the voltage value at the contact point (A/D ). This paper introduces the implementation of touch screen control by taking the chip ADS7843 produced by BB (Burr-Brown) as an example.

 2.1 Basic Features and typical applications of ADS7843

The ADS7843 is a serial interface chip with 12-bit analog switch and low on-resistance. Power supply voltage: 2.7 ~ 5 V. The reference voltage VREF is 1 V ~ + VCC: the input range of the conversion voltage is 0 ~ VREF, with the highest conversion rate of 125 kHz. The pin configuration of the ADS7843 is shown in 3.

Table 1 describes the pin functions. Figure 4 shows typical applications.

 Internal Structure and Reference Voltage Mode Selection of 2.2 ADS7843

The reason why ADS7843 can control the touch screen is that its internal structure can easily switch the electrode voltage and perform A/D Conversion quickly.

Figure 5 shows its internal structure, A2 ~ A0 and SER/are the control bits in the control register for switch switching and Reference Voltage selection.

The ADS7843 supports two reference voltage input modes: one is that the reference voltage is fixed to VREF, and the other is a differential mode. The reference voltage comes from the driving electrode. The two modes are shown in 6 (a) and (B) respectively.

Using the differential mode shown in Figure 6 (B) can eliminate the impact of the switch on-off pressure drop. Table 2 and table 3 are the internal switches corresponding to the two reference voltage input modes.

 2.3 control word and data transmission format of ADS7843

The control words of ADS7843 are listed in Table 4. S indicates the start flag of data transmission, which must be "1 ". A2 ~ A0 select a channel (see table 2 and 3 ). MODE is used to select
The accuracy of A/D conversion. Select 8 bits for "1" and 12 bits for "0. SER/select the input mode of the reference voltage (see table 2 and 3 ). PD1 and PD0 select power-saving mode: "00" power-saving mode
Xu, the power is down between two A/D conversions, and the interruption is allowed; "01" is the same as "00", but the interruption is not allowed; "10" is retained; "11" power-saving mode is disabled.

To complete one electrode voltage switching and A/D conversion, you must first send control words to the ADS7843 through the serial port, and then read the voltage conversion value through the serial port. The standard one-time conversion requires 24 clock cycles, as shown in figure 7.

Because the serial port supports two-way transmission at the same time and can overlap between one reading and the next sending control word, the conversion rate can be increased to 16 clock cycles each time, as shown in 8.

If conditions permit, the CPU can generate 15 clks (such as FPGAs and ASICs), the conversion rate can also be increased to 15 clock cycles each time, as shown in 9.

 2.4 programming of A/D conversion Sequence

Typical application 4 of ADS7843 is shown in. Assume that the μp interface and the P1.3 ~ of 51 Single-Chip Microcomputer ~ P1.7 is connected. Taking 24 clock cycles for one conversion as an example, the Program Design of A/D conversion sequence is introduced.

; A/D interface control line

DCLKBITP1.3

CSBITP1.4

DINBITP1.5

BUSYBITP1.6

DOUTBITP1.7

A/D channel selection command word and work register

CHXEQU094H; select control word for Channel X +

CHYEQU0D4H; select control word for Channel Y +

20170a4h

CH4EQU0E4H

AD_CHEQU35H; Channel Selection Register

AD_DATAHEQU36H; stores 12-bit A/D values

AD_DATALEQU37H

; Stores the/D value of the CHX + Channel

CHX_AdHEQU38H

CHX_AdLEQU39H

; Stores the/D value of the channel CHY +

CHY_AdHEQU3AH

CHY_AdLEQU3BH

======================================

CHXAD)

CHXAD:

MOVAD_CH, # CHX

LCALLAD_RUN

MOVCHX_AdH, AD_DATAH

MOVCHX_AdL, AD_DATAL

RET

CHYAD)

CHYAD:

MOVAD_CH, # CHY

LCALLAD_RUN

MOVCHY_AdH, AD_DATAH

MOVCHY_AdL, AD_DATAL

RET

================================================

; A/D conversion subroutine (AD_RUN)

Input: AD_CH-mode and channel selection command word

; Output: AD_RESULTH, L; A/D of 12 bit

; Use: R2; auxiliary working register

AD_RUN:

CLRCS; chip allowed

CLRDCLK

MOVR2, #8; first write 8 bit command words

MOVA, AD_CH

AD_LOOP:

MOVC, ACC.7

MOVDIN, C; clock rising edge lock DIN

SETBDCLK; start to send command words

CLRDCLK; clock pulse, 24 in total

RL

DJNZR2, AD_LOOP

NOP

NOP

NOP

NOP

ADW0:

JNBBUSY, AD_WAIT; wait until the conversion is completed

SJMPADW1

AD_WAIT:

LCALLWATCHDOG

NOP

SJMPADW0

CLRDIN

ADW1:

MOVR2, #12; start reading 12bit results

SETBDCLK

CLRDCLK

AD_READ:

SETBDCLK

CLRDCLK; read with the falling edge of the clock

MOVA, AD_DATAL

MOVC, DOUT

RLCA

MOVAD_DATAL,

MOVA, AD_DATAH

RLCA

MOVAD_DATAH,

DJNZR2, AD_READ

MOVR2, #4; 4 useless clock at last

IGNORE:

SETBDCLK

CLRDCLK

DJNZR2, IGNORE

SETBCS; chip prohibited

ANLAD_DATAH, # 0FH; shielded 4-bit high

RET

2.5 data format of A/D Conversion Result

The Conversion Result of ADS7843 is in binary format. It should be noted that the reference voltage is different in the two input modes during formula calculation. In addition, if the 8-bit conversion precision is selected, 1LSB = VREF/256, the conversion completion time can be four clock cycles in advance, and the serial clock rate can also be doubled.

Conclusion

In many embedded systems, the CPU provides dedicated modules to support LCD display and touch screen input, making the interface very simple. For example, MOTOROLA's MC68VZ328 (called DragON Ball) provides special pins to support 8-bit and 4-bit LCD display, and touch screen support through SPI2 with the help of ADS7843 is also easy to complete.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.