CLCD Display and Adaptor Board

C.3.2 Touchscreen controller programmer’s interface

The LCD Touch Screen Controller Interface (TSCI) is based on a TSC2200 PDA analogue interface circuit. Use the ARM926EJ-S PXP Development Chip SSP interface to configure and read the touch screen. For information on the touch screen registers, see the TSC2200 data sheet.

The TSC2200 also incorporates a sixteen key keypad interface and two 12bit analogue inputs that are available through the LCD expansion header J13. With the 3.8 inch Sanyo and 2.2 inch Epson build options, six keypad push buttons are mounted on the LCD board.

SSP and TSCI Configuration

The SSP interface is controlled by the SSP PrimeCell and the SSP TSCI chip select is enabled through SYS_CLCD TSnSS signal. Configuration of the SSP to TSCI interface requires the data format, phase, size, and clock to be set correctly. Example configuration code is given in the selftest (TSCI) software on the CD, a code fragment from this is shown in Example C-1.

Example C-1 SSP to TSCI interface setup

//Set serial clock rate (/3), Phase (SPH), Format (MOT), data size (16bit) *SSPCR0 = SSPCR0_SCR_DFLT SSPCR0_SPH SSPCR0_FRF_MOT SSPCR0_DSS_16;

//Clock prescale register (/8), with SCR gives 0.78MHz SCLK: 24MHz / 8*(1+3)

*SSPCPSR = SSPCPSR_DFLT;

//Enable serial port operation

*SSPCR1 = SSPCR1_SSE;

The TSC2200 TSCI controller registers must be configured through the SSP interface to enable correct touch screen operation.

After the TSCI is configured, conversion of touch screen X/Y values is fully automated by the TSCI controller and the application code simply reads the converted values. Use either the pen down flag in the touch screen controller interface or SIC interrupt 8 to detect the current pen state. The pseudo code in Example C-2 on page C-14 shows the sequence for configuring and reading the TSCI interface.

Read and write functions are used in the selftest code to transfer data to and from the TSCI registers TSCI_RTSC and TSCI_WTSC. The selftest example configures the TSCI for 12bit operation and 16 data averages with minimum precharge and sense times. This gives high accuracy and fast reading of the current pen position.

ARM DUI 0224I

Copyright © 2003-2010 ARM Limited. All rights reserved.

C-13

Page 331
Image 331
ARM ARM DUI 0224I manual Touchscreen controller programmer’s interface, SSP and Tsci Configuration