[Country EMBED strategy] [062] [Touch screen working principle analysis]

Source: Internet
Author: User
Tags bit set

Touch-screen Initialization

1. Set the ad conversion clock

Adccon (1<<14) |   (49<<6) Prscen Enable PRSCVL adc=pclk/(val+1)

2. Set Interrupt Masking

2.1.TC interrupts, which can occur when a finger touches or moves away

2.2.ADC interrupt, interrupt generated when ADC conversion is complete

Enable TC Interrupt, shielded ADC interrupt, poll to see ADC interrupt

Intmsk ~ (1<<31)

Intsubmask ~ (1<<9)

3. Enter the wait interrupt mode (press)

ADCTSC 0xd3

TC Interrupt Handling

1. Start XY coordinate auto-conversion

ADCTSC (1<<2)

Adccon (1<<0)

2. Wait for the conversion to complete, get the coordinates

Judge Adccon's 15-bit

Get the x-coordinate in ADCDAT0

Get the y-coordinate in ADCDAT1

3. Clear interrupts

SUBSRCPND's 9-bit

SRCPND's 31-bit

INTPND's 31-bit

4. Enter standby interrupt mode (bounce)

ADCTSC 0xd3

ADCTSC 8th bit set to 1

5. Clear interrupts

6. Enter the wait interrupt mode (press)

[Country EMBED strategy] [062] [Touch screen working principle analysis]

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.