ILITek TP IC I2C Programming Guide.pdf - Google Drive

37 downloads 600 Views 658KB Size Report
1.02 2011/07/11 Jay Added Protocol Command. Added Calibration Status Command. 1.03 2011/11/04 Jay Supported ILITek I2C P
ILI TP

ILITek TP IC I2C Programming Guide (For 4 ~ 10 points product and above)

Application Note

Version: V1.04

ILI TECHNOLOGY CORP. 8F, No. 38, Taiyuan St, Jhubei City, Taiwan 302, R.O.C. Tel.886-3-5600099; Fax.886-3-5600585 http://www.ilitek.com

2

ILI TP I C Programming Guide 4 points and above

ILI TP

Document Revision History Version

Data

Author

Description

0.01

2011/3/18

Jay

First Release Version

1.00

2011/4/15

Jay

Modified Power Up Sequence and Reset timing Requirement

1.01

2011/5/23

Jay

Added Sleep Mode support Added Idle Mode support

1.02

2011/07/11

Jay

Added Protocol Command Added Calibration Status Command 2

1.03

2011/11/04

Jay

Supported ILITek I C Protocol V2.1

1.04

2012/06/21

Jay

Supported 10 points

The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed, reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp. Page 2 of 20

Copyright © 2011 ILI Technology Corp. All Rights Reserved. ILI Confidential Disclosed Under NDA.

Version: 1.04

2

ILI TP I C Programming Guide 4 points and above

ILI TP

Table of Contents Section 1.

Page

Introduction ..................................................................................................................................................5 1.1.

OVERVIEW ................................................................................................................................................................5

1.2.

AUDIENCE ................................................................................................................................................................5

2.

Timing Specifications ...................................................................................................................................6 2.1.

POWER UP SEQUENCE AND RESET TIMING REQUIREMENT ........................................................................................6

2.2.

I2C TIMING ...............................................................................................................................................................7

3.

I2C Interface Data Structure ........................................................................................................................8 3.1.

DEVICE ADDRESS .....................................................................................................................................................8

3.2.

DATA TRANSFER .......................................................................................................................................................8

4.

Communication Protocol ............................................................................................................................ 11 4.1.

INTERRUPT PIN (/INT) CONTROL ............................................................................................................................ 11

4.2.

GENERAL COMMAND DESCRIPTION ........................................................................................................................12

4.2.1.

Command List ................................................................................................................................................12

4.2.2.

Data Format ..................................................................................................................................................13

4.2.3.

Sleep Mode: Mode Control ............................................................................................................................17

4.2.4.

Idle Mode: Mode Control ..............................................................................................................................18

4.2.5.

Touch Key / Points Reporting ........................................................................................................................19

The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed, reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp. Page 3 of 20

Copyright © 2011 ILI Technology Corp. All Rights Reserved. ILI Confidential Disclosed Under NDA.

Version: 1.04

2

ILI TP I C Programming Guide 4 points and above

ILI TP

List of Figures Section

Page

Fig 1:

Power Up Sequence and Reset Diagram .................................................................................................6

Fig 2:

The timing of I C Interface .........................................................................................................................7

Fig 3:

I C Device Address ....................................................................................................................................8

Fig 4:

Generic Transaction Diagram ....................................................................................................................8

Fig 5:

Byte Write ..................................................................................................................................................9

Fig 6:

Byte Read ..................................................................................................................................................9

Fig 7:

Multi-Byte Write .......................................................................................................................................10

Fig 8:

Multi-Byte Read .......................................................................................................................................10

Fig 9:

/INT Pin Control Diagram (Finger Touch) ................................................................................................ 11

2

2

Fig 10: Entry Sleep mode Flowchart ...................................................................................................................17 Fig 11: Exit Sleep mode Flowchart ......................................................................................................................17 Fig 12: Entry Idle mode Flowchart .......................................................................................................................18 Fig 13: Exit Idle mode Flowchart .........................................................................................................................18 Fig 14: Read Touch Key / Points Data Flow Chart ..............................................................................................19 Fig 15: Touch Key / Points Reporting Timing Diagram ........................................................................................19

The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed, reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp. Page 4 of 20

Copyright © 2011 ILI Technology Corp. All Rights Reserved. ILI Confidential Disclosed Under NDA.

Version: 1.04

2

ILI TP I C Programming Guide 4 points and above

ILI TP

1. Introduction 1.1. Overview 2

This document defines ILITek TP IC I C protocol version 2.1 and above.

This protocol is used for designing

with 4 points or more than 4 points capacitance touch panel products. This protocol has the flexibility to support up to 31 points touch.

1.2. Audience 2

It is intended to be used by software engineers to port the I C driver when using touch modules with ILITek TP IC products such as ILI2101, ILI2102, ILI2102s, ILI2102t, ILI2105, ILI2106, ILI2107u, ILI2107F, ILI2108, ILI2108a, ILI2111, ILI2150, ILI2151, ILI2152, ILI2153, ILI2197, ILI2645, ILI2656, ILI2665, ILI2672, and ILI2672F above chip.

The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed, reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp. Page 5 of 20

Copyright © 2011 ILI Technology Corp. All Rights Reserved. ILI Confidential Disclosed Under NDA.

Version: 1.04

ILI TP

2

ILI TP I C Programming Guide 4 points and above

2. Timing Specifications 2.1. Power up Sequence and Reset timing Requirement

VDD TReset

/Reset TInitial

SDA

TReset

Reset TInitial

SDA

Fig 1: Power Up Sequence and Reset Diagram Symbol TInitial

Parameter After powering-on or resetting the device, the device

MIN.

MAX.

Unit

100

-

ms

50

-

µs

needs Initial time to configure the system. TReset

/Reset pin low hold time

The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed, reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp. Page 6 of 20

Copyright © 2011 ILI Technology Corp. All Rights Reserved. ILI Confidential Disclosed Under NDA.

Version: 1.04

ILI TP

2

ILI TP I C Programming Guide 4 points and above

2.2. I2C Timing

2

Fig 2: The timing of I C Interface Characteristics of the SDA and SCL bus lines

Symbol fSCL tHD;STA

Standard mode

Parameter

Fast Mode

Min

Max

Unit

Min

Max

Unit

0

100

kHz

0

400

kHz

4.0



µs

0.6



µs

SCL clock frequency Hold time (repeated) START condition. After this period, the first clock pulse is generated

tLOW

LOW period of the SCL clock

4.7



µs

1.3



µs

tHIGH

HIGH period of the SCL clock

4.0



µs

0.6



µs

Set-up time for a repeated START

4.7



µs

0.6



µs

tSU;STA

condition tHD;DAT

Data hold time

5.0



µs

0

0.9

µs

tSU;DAT

Data set-up time

250



ns

100



ns



1000

ns



300

ns



300

ns



300

ns

Set-up time for STOP condition

4.0



µs

0.6



µs

Bus free time between a STOP and

4.7



µs

1.3



µs

tr

Rise time of both SDA and SCL signals

tf

Fall time of both SDA and SCL signals

tSU;STO tBUF

START condition

The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed, reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp. Page 7 of 20

Copyright © 2011 ILI Technology Corp. All Rights Reserved. ILI Confidential Disclosed Under NDA.

Version: 1.04

2

ILI TP I C Programming Guide 4 points and above

ILI TP

3. I2C Interface Data Structure 3.1. Device Address The device addresses are 7-binary bits long and are conventionally expressed as 4 bits followed by 3 bits followed by the letter ‘b’, 1000 001b. These addresses occupy the high seven bits of an eight-bit field on the bus. MSB 1

0

LSB 0

0

0

0

Device Address

1

0/1 R/W

7-bit Device Address: 0x41 8-bit Device Read Address:0x83 8-bit Device Write Address:0x82 2

Fig 3: I C Device Address

3.2. Data Transfer 2

Data is transferred over the I C bus with 8-bit address and 8-bit data. The related protocol and timing diagrams are shown as below.

1

7

1

S Slave Address Wr

1

8

A

Data Byte

1

1

A P

S

Start Condition

Sr

Repeated Start Condition

Rd

Read (bit value of 1)

Wr

Write (bit value of 0)

A

Acknowledge (this bit position may be ‘0’ for an ACK or ‘1’ for a NACK)

P

Stop Condition Master-to-Slave Slave-to-Master

---

Continue Fig 4: Generic Transaction Diagram

The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed, reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp. Page 8 of 20

Copyright © 2011 ILI Technology Corp. All Rights Reserved. ILI Confidential Disclosed Under NDA.

Version: 1.04

ILI TP

2

ILI TP I C Programming Guide 4 points and above

I2C Write timing SCL

1

7

8

9

SDA

A6 A5 A4 A3 A2 A1 A0

0

ACK

2

3

4

5

6

1

2

3

5

4

6

7

8

9 ACK/ NAC K

D7 D6 D5 D4 D3 D2 D1 D0

= > slave to master

I2C Read timing

SCL

1

7

8

9

SDA

A6 A5 A4 A3 A2 A1 A0

1

ACK

2

3

4

5

6

1

2

3

5

4

6

7

8

D7 D6 D5 D4 D3 D2 D1 D0

9 ACK/ NAC K

= > slave to master

Byte Write STOP

START

SCL

1

2

3

4

5

6

7

8

9

1

2

3

4

5

6

7

8

9

SDA

1

0

0

0

0

0

1

0

ACK

A7

A6

A5

A4

A3

A2

A1

A0

ACK

1

2

3

4

5

6

7

8

D7 D6 D5 D4 D3 D2 D1 D0

9

ACK

Command code

S Slave Address Wr A

Command Code

A

Data Byte

A P

Fig 5: Byte Write

Byte Read c S Slave Address Wr A

Command Code

A Sr Slave Address Rd A

Data Byte

A P

Fig 6: Byte Read

The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed, reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp. Page 9 of 20

Copyright © 2011 ILI Technology Corp. All Rights Reserved. ILI Confidential Disclosed Under NDA.

Version: 1.04

ILI TP

2

ILI TP I C Programming Guide 4 points and above

Multi-Byte Write

A 1 0 0 0 0 0 1 0 C K

I2C BUS S T A R T

Slave address WRITE

S Slave Address Wr A

Command code

A A A D D D D D D D D C D D D D D D D DC C 7 6 5 4 3 2 1 0 K 7 6 5 4 3 2 1 0 K K

Register address

Data byte 0

A D D D D D D D D C 7 6 5 4 3 2 1 0 K

Data byte 1

Data byte n

S T O P

Command Code

A

Data Byte 0

A

Data Byte 1

A

Data Byte 2

A

-----

A

Data Byte N

A P

Fig 7: Multi-Byte Write

Multi-Byte Read

A 1 0 0 0 0 0 1 0 C K

I2C BUS S T A R T

Slave address WRITE

S Slave Address Wr A

Command code

Register address

A A A D D D D D D D D C D D D D D D D DC 1 0 0 0 0 0 1 1C 7 6 5 4 3 2 1 0 K 7 6 5 4 3 2 1 0 K K

A C K

S T A R T

Command Code

Data Byte 1

Slave address

Data byte 0

Data byte 1

A D D D D D D D D C 7 6 5 4 3 2 1 0 K

Data byte n

READ

A Sr Slave Address Rd A

Data Byte 0

A

A

Data Byte N

A P

-----

A

S T O P

Fig 8: Multi-Byte Read

The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed, reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp. Page 10 of 20

Copyright © 2011 ILI Technology Corp. All Rights Reserved. ILI Confidential Disclosed Under NDA.

Version: 1.04

2

ILI TP I C Programming Guide 4 points and above

ILI TP

4. Communication Protocol 4.1. Interrupt Pin (/INT) Control ILI Touch device uses interrupt pin to signal the host when detecting touch events on the sensor. When a finger touches on the sensor surface, the /INT pin will be pull low. The /INT pin will continue to be low until the finger leaves the sensor surface. /INT (Control by Slave)

UnTouch

~ Touching

UnTouch

Fig 9: /INT Pin Control Diagram (Finger Touch)

The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed, reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp. Page 11 of 20

Copyright © 2011 ILI Technology Corp. All Rights Reserved. ILI Confidential Disclosed Under NDA.

Version: 1.04

2

ILI TP I C Programming Guide 4 points and above

ILI TP

4.2. General Command Description 4.2.1. Command List CMD

Name

Code

Set / Get

Size

(Write/Read)

(Bytes)

Description

0x10

Touch Reported Number

Get

1

Touch Data report

0x11

Touch Information Report /

Get

5

Touch Information Report

0x20

Touch Key Report /

Touch Key Report

Scrolling Bar Report

Scrolling Bar Report

Panel information

Get

10

The maximum report value and channel number.

0x30

Enter Sleep Mode

Set

1

The Chip enter the Sleep Mode

0x40

Firmware Version

Get

3

Firmware version V X.X.X

0x42

Protocol Version

Get

2

Protocol Version V 2.X (Now is V2.1)

0xCC

Mass Production Calibration

Set

0

This command is used for calibration and modifying configuration data.

0xCD

Calibration Status

0xCE

Calibration Status Erased

Get

1

This command is used for read calibration status

Set

0

This command is used for erasing calibration status.

The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed, reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp. Page 12 of 20

Copyright © 2011 ILI Technology Corp. All Rights Reserved. ILI Confidential Disclosed Under NDA.

Version: 1.04

ILI TP

2

ILI TP I C Programming Guide 4 points and above

4.2.2. Data Format Read Touch Reported Number (0x10) 2

The Host sends I C “Multi-Byte Read” format with command code “0x10” to read touch reported number. The touch device responds data with the following data format. Touch Reported Number Data Format Byte Name of Bytes 0

Report_Num

Description Touch reported

Bit 7

Bit 6

Bit 5 Bit 4 Bit 3 Bit 2

Bit 1

Bit 0

number The numbers of the touch information report

Read Touch Information Report (0x11) 2

The Host sends I C “Multi-Byte Read” format with command code “0x11” to read Touch Information Report. This command format includes touch points information. The touch device responds data with the following data format. Touch Information Report Data Format Byte Name of Bytes

Description

Bit 7 Touch_

Bit 6

Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

0

Status

Touch Information Status

1

X_High

X direction coordinate of

X Position (bit 15:8) of the finger

2

X_Low

the finger

X Position (bit 7:0) of the finger)

3

Y_High

Y direction coordinate of

Y Position (bit 15:8) of the finger

4

Y_Low

the

Y Position (bit 7:0) of the finger

finger

status

0

Reported_ID

Touch_status: 1 = touch 0 = un-touch

The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed, reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp. Page 13 of 20

Copyright © 2011 ILI Technology Corp. All Rights Reserved. ILI Confidential Disclosed Under NDA.

Version: 1.04

2

ILI TP I C Programming Guide 4 points and above

ILI TP

Read Touch Key Report (0x11) 2

The Host sends I C “Multi-Byte Read” format with command code “0x11” to read Touch Key Report. This command format includes touch key information. The touch device responds data with the following data format. Touch Key Report Data Format Byte

Name of Bytes

Description

Bit 7

Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

Touch Information

Touch_

Status

status

Touch Key ID

Touch Key ID

0

Status

1

TouchKey_ID

2

TouchKey_ScrollingBar

3

Reserved

--

0xFF

4

Reserved

--

0xFF

TouchKey or Scrolling Bar Report

1

Reported_ID

0x00

Touch_status: 1 = touch 0 = un-touch

Read Scrolling Bar Report (0x11) 2

The Host sends I C “Multi-Byte Read” format with command code “0x11” to read Scrolling Bar Report. This command format includes Scrolling Bar information. The touch device responds data with the following data format. Scrolling Bar Report Data Format Byte

Name of Bytes

0

Status

1

ScrollingBar_ID

2

TouchKey_ScrollingBar

3

ScrollingBar_Low

Description

Bit 7

Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

Touch Information

Touch_

Status

status

Scrolling Bar ID

Scrolling Bar ID

TouchKey or Scrolling Bar Report

1

Reported_ID

0x01 Scrolling Bar Position (bit 7:0) of the finger touched

Scrolling Bar Coordinate 4

ScrollingBar_High

Scrolling Bar Position (bit 15:8) of the finger touched

Touch_status: 1 = touch 0 = un-touch

The information contained herein is the exclusive property of ILI Technology Corp. and shall not be distributed, reproduced, or disclosed in whole or in part without prior written permission of ILI Technology Corp. Page 14 of 20

Copyright © 2011 ILI Technology Corp. All Rights Reserved. ILI Confidential Disclosed Under NDA.

Version: 1.04

ILI TP

2

ILI TP I C Programming Guide 4 points and above

Read Panel information (0x20) 2

The Host sends I C “Multi-Byte Read” format with command code “0x20” to read touch panel information. The touch device responds data with the following data format. Panel Information Data Format Byte Name of Bytes

Description

Bit 7

Bit 6

Bit 5

Bit 4

Bit 3

0

Xmax_Low

The maximum

The maximum X coordinate (bit 7:0)

1

Xmax_High

report value

The maximum X coordinate (bit 15:8)

2

Ymax_Low

The maximum

The maximum Y coordinate (bit 7:0)

3

Ymax_High

4

Xchannel_Num

Bit 2

Bit 1

Bit 0

report value of Y coordinate

The maximum Y coordinate (bit 15:8) The channel numbers of X direction

Channel numbers 5

Ychannel_Num

6

Max_Point

The channel numbers of Y direction The maximum report points

The maximum report points

TouchKey_Scrolli Touch Key or 7

ngBar_Channel_ Scrolling Bar Num

8

9

Channel Numbers

TouckKey_Num

For Touch Key Application

ScrollingBar_Low

ScrollingBar_ High

The channel numbers of TouchKey / Scrolling Bar

(Maximum supports 31 Touch Key) Touch Key or

Byte 8 : The Touch Key number (