Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ads7843 Touchscreen controller Example

Purpose

This example shows how to use SPI to control touchscreen controller (ADS7843). It can also help you to get familiar with the touchscreen configurations and usage, which can be used for fast implementation of your own touchscreen driver and other applications related.

Requirements

This package can be used with SAM evaluation kits.

Description

This example first initialize LCD and touchscreen controller, then let user do calibration for the touchscreen. After calibration is done, user may touch the LCD and the pen position will be output on terminal.

Usage

  1. Build the program and download it inside the evaluation board.
  2. On the computer, open and configure a terminal application (e.g. HyperTerminal on Microsoft Windows) with these settings:
    • 115200 bauds
    • 8 bits of data
    • No parity
    • 1 stop bit
    • No flow control
  3. Start the application
  4. In HyperTerminal, it will show something like
    -- SPI_Touchscreen Example xxx --
    -- xxxxxx-xx
    -- Compiled: xxx xx xxxx xx:xx:xx --
  5. Touch the dots on the LCD to calibrate the touchscreen, the calibration results will output on the terminal and LCD.
  6. Touch the LCD, the pen position will output on the terminal if touchscreen is calibrated ok.