Localized experimental box_ DSP Tutorial: 2-5LCD Touch Screen Touch Experiment

Replay suspend 00:06 / 13:38 direct seeding 00:00 Enter full screen 0 Click and hold to drag videos The purpose of this video is to learn the control principles of LCD controllers and implement LCD touch control in the StarterWare development environment.1

suspend
00:06 / 13:38
00:00
Enter full screen
0
    Click and hold to drag videos

    The purpose of this video is to learn the control principles of LCD controllers and implement LCD touch control in the StarterWare development environment.

    1. LCD controller

    To achieve LCD display and touch, the main requirements are LCD drivers and LCD controllers, which are generally divided into display controllers and touch controllers. Usually, the LCD driver is integrated into the LCD screen, while the LCD controller is implemented by external circuits.

    2. LCD display controller

    The TMS320C6748 CPU has a corresponding LCD display controller (raster controller) inside The LCD controller consists of two independent controllers, namely the grating controller and the LCD interface display driver (LIDD) controller. Each controller operates independently of another controller, and only one controller is active at any given time.

    3. LCD touch controller

    The touch controller, as an optional part, is generally integrated on the experimental backplane, and the XPT2046 controller is used here. By using the LCD controller, the control signal required by the LCD driver can be generated to control the STN/TFT screen.

    4. The principle of resistive touch screen

    When a finger touches the screen, the two conductive layers make contact at the touch point, causing a change in resistance and voltage in the X and Y directions, generating a signal. The controller then reads the signal and calculates the position of the finger touch.

    Touch screens require an AD converter, which reads the voltage changes for the host to determine the position of the touch. The touch chip is XPT2046.

    5. XPT2046 chip

    It is a 4-wire touch screen controller that uses SPI mode for communication

    6. Process Design

    In the process design of the program, the first step is to configure the peripheral enable, followed by serial port 2 initialization to output touch coordinate values; Then perform LCD pin reuse configuration and LCD interrupt configuration, followed by LCD display and touch initialization. Finally, touch detection is performed in the loop to determine whether screen touch has occurred. If the screen is touched, the coordinate value of the touch location is output on the serial port.

    7. Pin reuse source code

    When controlling peripherals based on StarterWare, the corresponding API interface can be called without the need to configure complex registers.

    The function source code for LCD pin reuse configuration can be found in LCD. c.

    8. LCD interrupt usage process

    1. Hardware connection

    (1) Connect the UART2 of the experimental board to the USB port of the computer using the RS232 cross serial bus and the USB to RS232 serial cable.

    (2) Connect the emulator to the USB interface of the computer.

    (3) Turn the dial switch to DEBUG mode 01111, connect the experimental box power supply, and turn the power switch to power on.

    2. Software operation

    (1) First, check the serial port number in the device manager,

    (2) Set the serial port debugging tool again, and set the baud rate to 115200.

    3. CCS related operations

    Import Project

    Compilation Engineering

    Connect CCS to the development board and load the program

    Click to run the program

    Check the phenomenon, click and touch any point on the LCD screen to draw, and at the same time, the serial debugging tool outputs the corresponding coordinate values of the touch.

    suspendCCS


    Disclaimer: The content of this article is sourced from the internet. The copyright of the text, images, and other materials belongs to the original author. The platform reprints the materials for the purpose of conveying more information. The content of the article is for reference and learning only, and should not be used for commercial purposes. If it infringes on your legitimate rights and interests, please contact us promptly and we will handle it as soon as possible! We respect copyright and are committed to protecting it. Thank you for sharing.(Email:[email protected])