HT6523 PS/2 Mouse Controller Features · Compatible with IBM PS/2 mouse · Three key-switches and four photo-coupler inputs · Integrated oscillator circuit with external resistor · Supports test mode operation · 6MHz clock frequency · 16-pin DIP package · Minimal external components General Description The HT6523 is a PS/2 compatible mouse controller IC. Capable of driving up to 3 key-switches and 4 photo-couplers directly into a 6-pin connector line. Pin Assignment N C 1 1 6 V D D T E S T 2 1 5 Y 2 R E S E T 3 1 4 Y 1 O S C 4 1 3 X 2 N C 5 1 2 X 1 C L K 6 1 1 L B D A T A 7 1 0 M B V S S 8 9 R B H T 6 5 2 3 1 6 D IP -A Pin Description Pin No. Pin Name I/O 1, 5 NC ¾ 2 TEST I If TEST is floating or connected to VSS, then the chip is under normal operation. If TEST is connected to VDD, it will operate under the TEST mode. 3 RESET I Input to reset internal LSI 4 OSC I OSC is connected to an external resistor then to VDD to generate a 6MHz system clock. 6 CLK I/O Synchronous clock signal. The mouse generates a clock signal when sending data to and receiving data from the system. 7 DATA I/O Bidirectional data transmission line 8 VSS ¾ Negative power supply, ground 9 10 11 RB MB LB I In the non-active state these 3 switch inputs are pulled low. To activate they must be connected to VDD. In the TEST mode, MB, LB will indicate the condition of the X1, X2 inputs, if RB is left floating or connected to VSS. Also in the TEST mode, if RB is connected to VDD then MB and LB will indicate the condition of the Y1 and Y2 inputs. 12 13 14 15 X1 X2 Y1 Y2 I Mouse interface input terminal. Four photo-coupler signals denote UP, DOWN, LEFT and RIGHT state. 16 VDD Rev. 1.20 ¾ Description No connection Positive power supply 1 March 6, 2003 HT6523 Absolute Maximum Ratings Supply Voltage ...........................VSS-0.3V to VSS+5.5V Storage Temperature ............................-50°C to 125°C Input Voltage............................. VSS-0.3 to VDD+0.3V Operating Temperature...........................-25°C to 70°C Note: These are stress ratings only. Stresses exceeding the range specified under ²Absolute Maximum Ratings² may cause substantial damage to the device. Functional operation of this device at other conditions beyond those listed in the specification is not implied and prolonged exposure to extreme conditions may affect device reliability. D.C. Characteristics Symbol Parameter Test Conditions VDD Conditions ¾ VDD Operating Voltage ¾ IDD Operating Current 5V VIL Input Low Voltage for I/O Ports fSYS=6MHz, No load 3V ¾ 5V 3V VIH ¾ Input High Voltage for I/O Ports 5V 3V VIL1 ¾ Input Low Voltage (RESET) 5V 3V VIH1 ¾ Input High Voltage (RESET) 5V 3V VIL2 ¾ Input Low Voltage (X1, X2, Y1, Y2) 5V 3V VIH2 ¾ Input High Voltage (X1, X2, Y1, Y2) 5V IOL IOH IOL1 IOH1 RPH RPL RPL1 Rev. 1.20 Max. Unit 4.75 ¾ 5.25 V ¾ ¾ 5 mA 0 ¾ 0.9 0 ¾ 1.5 2.1 ¾ 3 3.5 ¾ 5 0 ¾ 0.7 0 ¾ 1.3 2.3 ¾ 3 3.8 ¾ 5 0 ¾ 1 0 ¾ 2 2 ¾ 3 3 ¾ 5 V V V V V V VOL=0.3V 1.5 2.5 ¾ 5V VOL=0.5V 4 6 ¾ 3V VOH=2.7V -1 -1.5 ¾ 5V VOH=4.5V -2 -3 ¾ 3V VOL=0.3V 8 ¾ ¾ 5V VOL=0.5V 8 ¾ ¾ 3V VOH=2.7V -1.5 -2.5 ¾ 5V VOH=4.5V -1.5 -2.5 ¾ I/O Ports Source Current CLK, DATA Sink Current CLK, DATA Source Current 3V ¾ 5 7.5 10 5V ¾ 3 4.7 6.3 3V ¾ 10 30 50 5V ¾ 8 17 35 3V ¾ 60 100 160 5V ¾ 35 60 90 Pull-high Resistance of CLK, DATA Pull-low Resistance of X1, X2, Y1, Y2 Typ. 3V I/O Ports Sink Current Pull-low Resistance of TEST, RB, MB, LB Min. 2 mA mA mA mA kW kW kW March 6, 2003 HT6523 A.C. Characteristics Symbol Parameter fSYS System Clock (RC OSC) tRES External Reset Low Pulse Width Min. Typ. Max. Unit 3V ROSC=120K Test Conditions 5.4 6 6.6 MHz 5V ROSC=120K 5.4 6 6.6 MHz 1 ¾ ¾ ms ¾ 3V Functional Description in the mouse and no transmissions are made. If CLK is high and DATA is low (request-to-send), the data is also updated in the mouse, the mouse inputs the host data, and no transmissions are started by the mouse until CLK and DATA are both high. If CLK and DATA are both high, the mouse proceeds to output 0 start bit, 8 data bits, parity bit, and stop bit if a transmission is required. Data is valid prior to the falling edge of CLK and beyond the rising edge of CLK. During transmission, the mouse checks for a line contention by checking for an inactive level on CLK at intervals not to exceed 100 ms. Contention occurs when the host lowers CLK to inhibit the mouse output after the mouse starts a transmission. If this occurs before the rising edge of the tenth clock (parity bit), the mouse internally stores its data packet in the mouse buffer and returns both DATA and CLK high. If there is no contention by the tenth clock, the mouse completes the transmission. Following a transmission, the host can inhibit the mouse until it services the input or until it requests to send a response if necessary. Power-on Reset The Mouse logic generates a power-on reset at power up after 600 millisecond ± 20%. Modes of Operation · Reset After power up or when receiving a reset command, CLK and DATA lines can go to a positive level. The mouse waits between 300 to 500 milliseconds and sends AA to the host, followed by a device ID of 00. After reset the mouse is set to its default values: Incremental stream mode, 1:1 scaling, report rate of 100, 6 counts per mm at 320 DPI or 4 counts per mm at 200 DPI, and then disable itself. No further action occurs until a command is sent from the host. · Stream In this mode, a data report is transmitted to the system if a switch is pressed or released, or if at least one count of movement has been detected. The maximum rate of transfer is the programmed sample rate. · Remote · Data input In this mode, data is transmitted only in response to a read data command. When the host is ready to send data to the mouse, it first checks to see if the mouse is transmitting data. If the mouse is transmitting, the host can override the mouse output by forcing CLK low before the tenth clock. If the mouse transmits beyond this, the host receives the data. If the mouse is not transmitting or if the host overrides the mouse output, the host forces CLK to an inactive level for a period of not less than 100 ms while preparing for output. When the system is ready to output 0 start bit (data line is low), it allows CLK to go to an active level. The mouse checks this state every 10ms. If request-to-send is detected, the mouse clocks 11 bits. After the tenth clock, the mouse checks for a high on the DATA line and if found, the mouse forces DATA to a low level and clocks once more. This signals the host to return to the ready state when it can accept input or go to an inhibit mode until ready. If DATA is found at an inactive level following clock 10, a framing error has occurred and the mouse continues to clock until DATA is high, then clocks the line control bit and request a resend. For host commands and data transmission that requires a response, the host waits for the mouse to respond before sending its next output. · Wrap In this mode, any byte of data sent by the system, except hex EC or hex FF, is returned by the mouse. Data Transmission During data transmission, CLK is used to clock serial data. The mouse generates a clocking signal when sending data to and receiving data from the system. The system requests the mouse receiving system data output by forcing the data line to an inactive level and allowing CLK to go to an active level. Communication is bidirectional using the clock and data signal lines. The signal for each of these lines comes from open collector devices, allowing either the mouse or the system to force a line to an inactive level. During a non-transmission state, CLK and DATA are both held at an active level. · Data output When the mouse is ready to transmit, it checks for an inhibit signal or a host request-to-send status on CLK and DATA. If CLK is low, data is continuously updated Rev. 1.20 3 March 6, 2003 HT6523 The response must be within 20ms, unless the host inhibits the mouse output or inhibits the data transmissions from the system that require a response. If the host initiates a command or data transmission and the response is invalid or has a parity error, the host retransmits the command or data. If after two retries the response is still invalid or has a parity error, the host resets the mouse. Commands · The following table lists all the valid commands: Hex Code FF FE F6 F5 F4 F3 F2 F0 EE EC EB EA E9 E8 E7 E6 Data Format The following data report format is valid for the stream and remote modes and is 3 bytes long: Byte Bit 3 7 6-1 0 7 6-1 0 7 6 5 4 3 2 1 0 2 1 Description MSB of Y Data Y Data LSB of Y Data MSB of X Data X Data LSB of X Data Y Data Overflow 1=Overflow X Data Overflow 1=Overflow Y Data sign 1=Negative X Data sign 1=Negative Reserved always=1 Reserved for middle Button Right Button Status 1=Pressed Left Button Status 1=Pressed Command Reset Resend Set default Disable Enable Set sampling rate Read device type Set remote mode Set wrap mode Reset wrap mode Read data Set stream mode Status request Set resolution Set scaling 2:1 Reset scaling · The following describe valid commands: Hex Code FF Command Description Reset This command cause the mouse to enter a reset mode and do an internal self-test. FE Resend The system can send this command when it detects an error in any transmission from the mouse. The Resend command could be sent following a mouse transmission and before the system enables the interface allowing the next mouse output. On receipt of Resend, the mouse retransmits the previous three bytes if the previous output was a 3-byte packet. The previous two bytes if the previous output was a 2-byte packet, and the previous one byte if the previous output was a 1-byte packet, unless the previous output from the mouse was a Resent command. In this case, the mouse will resend the previous output prior to the Resend command. If a Resend command is received by the mouse from the host immediately following a 3-byte data packet transmission from the mouse to the host while the mouse is in stream mode. The mouse should resend the 3-byte data packet prior to clearing the count accumulators. F6 Set default This command reinitializes all conditions to the power-on default state. F5 Disable This command is used in the stream mode to stop transmissions initiated from the mouse. It responds to all other commands while disabled. If the mouse is in the stream mode, it must be disabled before sending it any command that requires a response. F4 Enable Begin transmission, if in stream mode F3, XX Set sampling rate In the stream mode, this command sets the sampling rate to the value indicated by bytes hex XX shown in the following figure: Second Byte hex XX (sample rate): hex 0A (10/sec), hex 14 (20/sec), hex 28 (40/sec), hex 3C (60/sec), hex 50 (80/sec), hex 64 (100/sec), hex C8 (200/sec) F2 Read device type This command always receives a response of hex 00 Rev. 1.20 4 March 6, 2003 HT6523 Hex Code Command Description F0 Set remote mode This command sets the remote mode. Data values are reported only in response to a Read Data command. EE Set wrap mode This command sets the wrap mode. This mode remains until hex FF or hex EC is received. EC Reset wrap mode This command resets the wrap mode EB Read data This command requests that all data defined in the data packet format be transmitted. This command is executed in either remote or stream mode. The data is transmitted even if there has been no movement since the last report or the switch status is unchanged. Following a Read Data command, the accumulators are cleared after a data transmission. EA Set stream mode This command sets the stream mode When this command is issued by the system, the mouse responds with a 3-byte status report as follows: Byte Description Current sampling rate Current resolution setting always = 0 0 = Stream mode, 1 = Remote mode 0 = Disabled, 1 = Enabled 0 = Scaling 1:1, 1 = Scaling 2:1 always = 0 1 = Left button pressed Reserved for middle button 1 = Right button pressed 0~7 0~7 7 6 5 4 3 2 1 0 3 2 1 E9 Bit Status request The mouse provides four resolutions selected by the second byte of this command as follows: Second Byte E8, XX Set resolution Resolution (Counts per mm) hex XX 200 DPI 320 DPI 400 DPI hex 00 hex 01 hex 02 hex 03 1 2 4 8 1 3 6 12 2 4 8 16 Scaling is used to provide a course/fine tracking response. At the end of a sample interval in the stream mode, the current X and Y data values are converted to new values. The sign bits are not involved in this conversion. 2:1 scaling is only performed in stream mode. In response to a Read Data command, the mouse will transmit the current value before conversion. E7 Set scaling 2:1 E6 Reset scaling Rev. 1.20 Input Output 0 1 2 3 4 5 N (³6) 0 1 1 3 6 9 2.0 ´ N This command restores 1:1 scaling 5 March 6, 2003 HT6523 Timing Diagrams Data Output (1 ) (3 ) (3 ) 1 s t C L K C L K T 3 (2 ) D A T A (3 ) 2 n d C L K (3 ) 1 0 th C L K 1 1 th C L K T 5 T 4 T 1 T 6 (4 ) (5 ) (7 ) T 2 S ta r t B it B it 0 P a r ity B it S to p B it (6 ) Timing Parameter Min/Max T1 Data transition to the falling edge of CLK 5/25ms T2 Rising edge of CLK to DATA transition 5/T4-5ms T3 Duration of CLK low 30/50ms T4 Duration of CLK high 30/50ms T5 Minimum time to MOUSE inhibit after clock 11 > 0ms T6 Maximum time to MOUSE inhibit after clock 11 to ensure MOUSE does not start another trans< 50ms mission Data Input (1 ) C L K M o u s e In h ib it (2 ) (4 ) 9 th C L K 2 n d C L K 1 s t C L K T 7 1 0 th C L K (8 ) T 8 (6 ) T 9 D A T A S ta r t B it (3 ) 1 1 th C L K B it 0 P a r ity B it (5 ) (5 ) S to p B it Timing Parameter (7 ) Min/Max T7 Duration of CLK low 30/50ms T8 Duration of CLK high 30/50ms T9 Time from low to high CLK transition to time when MOUSE samples DATA line 5/25ms Rev. 1.20 6 March 6, 2003 HT6523 Application Circuits + 5 V C L K D A T A G N D 0 .1 m F 1 V D D 1 2 0 k W 2 N C Y 2 R E S E T Y 1 4 O S C X 2 5 N C X 1 6 C L K L B 7 D A T A M B 8 V S S R B 3 T E S T 1 0 0 0 p F 1 6 1 5 1 4 1 3 1 2 1 1 1 2 1 0 1 2 9 1 2 S W 1 6 8 0 W S W 3 S W 2 H T 6 5 2 3 Rev. 1.20 7 March 6, 2003 HT6523 Package Information 16-pin DIP (300mil) Outline Dimensions A B 1 6 9 8 1 H C D a G E I F Symbol A Rev. 1.20 Dimensions in mil Min. Nom. Max. 745 ¾ 775 B 240 ¾ 260 C 125 ¾ 135 D 125 ¾ 145 E 16 ¾ 20 F 50 ¾ 70 G ¾ 100 ¾ H 295 ¾ 315 I 335 ¾ 375 a 0° ¾ 15° 8 March 6, 2003 HT6523 Holtek Semiconductor Inc. (Headquarters) No.3, Creation Rd. II, Science Park, Hsinchu, Taiwan Tel: 886-3-563-1999 Fax: 886-3-563-1189 http://www.holtek.com.tw Holtek Semiconductor Inc. (Taipei Sales Office) 4F-2, No. 3-2, YuanQu St., Nankang Software Park, Taipei 115, Taiwan Tel: 886-2-2655-7070 Fax: 886-2-2655-7373 Fax: 886-2-2655-7383 (International sales hotline) Holtek Semiconductor Inc. (Shanghai Sales Office) 7th Floor, Building 2, No.889, Yi Shan Rd., Shanghai, China 200233 Tel: 021-6485-5560 Fax: 021-6485-0313 http://www.holtek.com.cn Holtek Semiconductor Inc. (Shenzhen Sales Office) 43F, SEG Plaza, Shen Nan Zhong Road, Shenzhen, China 518031 Tel: 0755-8346-5589 Fax: 0755-8346-5590 ISDN: 0755-8346-5591 Holtek Semiconductor Inc. (Beijing Sales Office) Suite 1721, Jinyu Tower, A129 West Xuan Wu Men Street, Xicheng District, Beijing, China 100031 Tel: 010-6641-0030, 6641-7751, 6641-7752 Fax: 010-6641-0125 Holmate Semiconductor, Inc. (North America Sales Office) 46712 Fremont Blvd., Fremont, CA 94538 Tel: 510-252-9880 Fax: 510-252-9885 http://www.holmate.com Copyright Ó 2003 by HOLTEK SEMICONDUCTOR INC. The information appearing in this Data Sheet is believed to be accurate at the time of publication. However, Holtek assumes no responsibility arising from the use of the specifications described. The applications mentioned herein are used solely for the purpose of illustration and Holtek makes no warranty or representation that such applications will be suitable without further modification, nor recommends the use of its products for application that may present a risk to human life due to malfunction or otherwise. Holtek¢s products are not authorized for use as critical components in life support devices or systems. Holtek reserves the right to alter its products without prior notification. For the most up-to-date information, please visit our web site at http://www.holtek.com.tw. Rev. 1.20 9 March 6, 2003