AN0519 implementing a simple serial mouse controller

13 88 0
AN0519   implementing a simple serial mouse controller

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

AN519 Implementing a Simple Serial Mouse Controller INTRODUCTION THEORY OF OPERATION The mouse is becoming increasingly popular as a standard pointing data entry device There is no doubt that the demand for the mouse is increasing Various kinds of mice can be found in the market, including optical mice, opto-mechanical mice, and their close relative, trackballs The mouse interfaces to the host via a dedicated interface card or an RS-232 port Their mechanisms are very similar The major electrical components of a mouse are: A mouse can be divided into several functional blocks: • • • • • • • • • A typical functional block diagram is shown in Figure In Figure 2, three pushbuttons are connected to the input ports of the PIC16C54 When a switch opening or closure is detected, a message is formatted and sent to the host The X and Y movements are measured by counting the pulses generated by the photo-couplers In the case of an opto-mechanical mouse, the infrared light emitted by the infrared diode is blocked by the rotating wheel, so that the pulses are generated on the photo-transistor side In case of an optical mouse, the infrared light emitted by the infrared diode is reflected off the reflective pad patterned with vertical and horizontal grid lines It is then received by the photo-transistor in the mouse When any X or Y movement is detected, a message is formatted and sent to the host Microcontroller Photo-transistors Infrared emitting diode Voltage conversion circuit The intelligence of the mouse is provided by the microcontroller, therefore the features and performance of a mouse is greatly related to the microcontroller used This application note describes the implementation of a serial mouse using the PIC16C54 The PIC16C54 is a high speed 8-bit CMOS microcontroller offered by Microchip Technology Inc It is an ideal candidate for a mouse controller FIGURE 1: Microcontroller Button detection Motion detection RS-232 signal generation 5V DC power supply unit FUNCTIONAL BLOCKS OF A SERIAL MOUSE Quadrature Encoders RS-232 Port of Host Microcontroller 20 -10V DC Power Conversion Circuitry +5V DC Pushbuttons  1997 Microchip Technology Inc DS00519C-page AN519 The Microsoft Mouse System and the Mouse Systems device both use serial input techniques The Mouse System protocol format contains five bytes of data One byte describes the status of three push buttons, two bytes for the relative X movements and two bytes for the relative Y movements The Microsoft protocol format contains three bytes of data describing the status of two push buttons and the relative X and Y movements The details of these protocols are given in Table Three lines are connected to the host via the RS-232 port: • Signal Ground • Received Data • Request to Send FIGURE 2: “Received Data” carries the message sent by the mouse While “Request to Send” provides a –10 VDC for voltage conversion circuitry A voltage of +5 VDC is required for electronic components inside the mouse, however, +5 VDC is not part of an RS-232 port, so voltage conversion circuitry is required This circuit is typically composed of a 555 timer, Zener diodes, and capacitors An example circuit is shown in Figure Since the current supplied through the RS-232 port is limited to 10 mA, the mouse cannot be designed to consume more than 10 mA current unless an external power supply is provided The PIC16C54, running at MHz (1 µs instruction cycle) can provide a very high tracking speed An MHz version of PIC16C54 is also available if higher performance is desired PIC16C54 PIN ASSIGNMENTS +5 VDC OSC2 OSC1 RB0 RA0 YCLOCK RA1 YDATA RA2 XCLOCK RA3 XDATA RB7 Received Data Pin of Host RS-232 Port Signals From Y-Coord Photo-Transistor RB1 RB2 VDD MCLR FIGURE 3: Signals From X-Coord Photo-Transistor GND VOLTAGE CONVERSION CIRCUITRY Signal RESET 6k Vcc Output GND Discharge 10k -10V to 0V 0V to +10V 555 RS-232 Port Threshold Trigger RTS +5 VDC Output 10 µF 5k 20 33 µF DS00519C-page 0.015 µF  1997 Microchip Technology Inc AN519 ABOUT THE SOFTWARE ing edge of XCLOCK is detected For right movement, XDATA is either LOW at the rising edge of XCLOCK or HIGH at the falling edge of XCLOCK The up and down movement detections follow the same logic In Table 1, X7:X0 are data for relative movement If X is positive, it implies that the mouse is moving to the right If X is negative, it implies a movement to the left Similarly, if Y is positive, it indicates that the mouse is moving down and if Y is negative, it indicates that the mouse is moving up The pulses generated by the photo-couplers are checked before every bit is sent A bit takes 1/1200 second to send, if the distance between the grid lines is mm, the tracking speed will be up to 1200 mm/second The major tasks performed by the software are button scanning, X and Y motion scanning, formatting and sending serial data to the host These tasks need to be performed in parallel in order to gain better tracking speed The pulses generated by the photo-couplers are counted while transmitting the serial signals to the RS-232 port The number of pulses reflects the speed of the movement The more pulses, the faster the movement The directions of movement are determined by the last states and the present states of the outputs of the photo-transistors In Figure 4, XCLOCK and XDATA are outputs from the photo-transistors corresponding to the X-axis movement XDATA is read when a rising or a fall- FIGURE 4: VOLTAGE CONVERSION CIRCUITRY XCLOCK (XC) XDATA (XD) MOVE RIGHT MOVE LEFT MOVE UP MOVE DOWN YCLOCK (YC) YDATA (YD) TABLE 1: MOUSE SYSTEM AND MICROSOFT PROTOCOLS Mouse System Format* Microsoft Format* Bit Position 7 Byte 1 0 0 L M R 1 L R Y7 Y6 X7 X6 Byte X7 X6 X5 X4 X3 X2 X1 X0 0 X5 X4 X3 X2 X1 X0 Byte Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 0 Y5 Y4 Y3 Y2 Y1 Y0 Byte X7 X6 X5 X4 X3 X2 X1 X0 Byte Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 * L = Left Key Status M = Middle Key Status R = Right Key Status  1997 Microchip Technology Inc = Pressed = Released X7-X0 = X-Axis Movement Data Y7-Y0 = Y-Axis Movement Data DS00519C-page AN519 The buttons are scanned after a message is sent and the time used to send the message is used as the debouncing time The message is in an RS-232 format with 1200 baud, eight data bits, no parity, and two stop bits The flowcharts of the main program, subroutine BYTE and subroutine BIT are shown in Figure 5, Figure 6, and Figure Figure shows that the trigger flag is set when any change in button status or X/Y movement is detected Subroutine BYTE is called in the main program five times to send five bytes of information Subroutine BYTE controls the status of the “Received Data” (RD) pin If Trigger Flag is clear, RD will always be HIGH Hence, no message will be sent even when subroutine BYTE is called Figure shows that subroutine BIT counts the number of pulses from the outputs of the photo-transistors, determines the directions, and generates a 1/1200 second delay to get 1200 baud timing The mouse has been tested in Mouse System Mode and functions properly The setup and software have been tested and function within the given guidlines A listing of the source program is given in Appendix A FIGURE 5: FLOWCHART OF THE MAIN PROGRAM Reset Entry Initialize I/O port - Get initial button status Button status change? No Yes Set trigger flag X movement count = 0? Yes No Set trigger flag SUMMARY The PIC16C54 from Microchip Technology Inc provides a very cost-effective, high performance mouse implementation Its low power consumption (typically< mA at µs instruction cycle), small package (18-pin) and high reliability (on-chip watchdog timer to prevent software hang-ups) are some of the many reasons why the PIC16C54 is uniquely suitable for mouse applications Note: This application note provides the user with a simple, fully functional serial mouse implementation The user may use this as a starting point for a more comprehensive design Right flag set? Yes Negate X count No Y movement count = 0? Yes No Set trigger flag Up flag set? Yes Negate Y count No Data ← Button Byte Call Routine BYTE Data ← X-Coord Byte Call Routine BYTE Data ← Y-Coord Byte Call Routine BYTE Data ← X-Coord Byte Call Routine BYTE Data ← Y-Coor Byte Call Routine BYTE Set trigger flag DS00519C-page  1997 Microchip Technology Inc AN519 FIGURE 6: FLOWCHART OF ROUTINE BYTE BYTE Count → '0' TRIGGER flag set? Yes '0' → RD pin (Start Bit) No Call routine BIT TRIGGER flag set? No Yes Shift LSb of data to Carry Carry = 0/1? '0' → RD Pin '1' → RD pin Call Routine BIT Count ← Count + No Count = 8? Yes Return to Caller  1997 Microchip Technology Inc DS00519C-page AN519 FIGURE 7: FLOWCHART OF ROUTINE BIT BIT XC XC = 0/1? No No ? XC ? Yes Yes X Count ← X Count + Reset RIGHT Flag XD = 0/1? X Count ← X Count + Reset RIGHT Flag XD = 0/1? Set RIGHT Flag Set RIGHT Flag YC YC = 0/1? No No ? YC ? Yes Yes Y Count ← Y Count + Reset UP Flag YD = 0/1? Y Count ← Y Count + Reset UP Flag YD = 0/1? Set UP flag Set TRIGGER flag Delay 0.833 ms Return to Caller DS00519C-page  1997 Microchip Technology Inc AN519 Please check the Microchip BBS for the latest version of the source code Microchip’s Worldwide Web Address: www.microchip.com; Bulletin Board Support: MCHIPBBS using CompuServe® (CompuServe membership not required) APPENDIX A: MOUSE.ASM MPASM 01.40 Released LOC OBJECT CODE VALUE 00000003 00000005 00000006 00000008 0000000C 0000000D 0000000E 0000000F 00000010 00000011 00000012 00000013 00000014 00000015 00000016 00000018 00000019 00000000 00000001 00000001 00000002 00000003 00000003 00000000 00000002 00000000 00000007 00000002 00000002 MOUSE.ASM 1-16-1997 12:44:22 PAGE LINE SOURCE TEXT 00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054  1997 Microchip Technology Inc TITLE “ MOUSE “ LIST P=16C54,R=O ; ; ;******************************************************************** ; ; MOUSE CONTROLLER ; PIC MODE = PIC16C54XT CLK=4.0MHZ ; ; Program: MOUSE.ASM ; Revision Date: 25 APRIL, 1990 ; 1-13-97 Compatibility with MPASMWIN 1.40 ; ;******************************************************************** ; ; ; FILES ASSIGNMENT ; ; STATUS EQU ;STATUS REGISTER RA EQU ;I/O PORT A RB EQU ;I/O PORT B TIMER1 EQU 10 ;COUNTER FOR DELAY CSTAT EQU 14 ;CO-ORDINATE STATUS BSTAT EQU 15 ;BUTTON STATUS DATA0 EQU 16 ; DATA1 EQU 17 ; DATA2 EQU 20 ;5 BYTE RS232 DATA DATA3 EQU 21 ; DATA4 EQU 22 ; FLAGA EQU 23 ;GENERAL PURPOSE FLAG XCOUNT EQU 24 ;X-MOVEMENT COUNTER YCOUNT EQU 25 ;Y-MOVEMENT COUNTER FLAGB EQU 26 ;GENERAL PURPOSE FLAG COUNT EQU 30 ;GENERAL PURPOSE COUNTER DATA_AREA EQU 31 ;FOR TEMP STORAGE ; ; -; BIT ASSIGNMENT ; -; YC EQU ;Y-CLOCK PIN YD EQU ;Y-DATA PIN UP EQU ;MOVING UP FLAG XC EQU ;X-CLOCK PIN XD EQU ;X-DATA PIN RI EQU ;MOVING RIGHT FLAG BU1 EQU ;BUTTON #1 PIN BU2 EQU ;BUTTON #2 PIN CA EQU ;CARRY FLAG RD EQU ;RECEIVED DATA PIN TO RS232 ZERO_AREA EQU ;ZERO FLAG TR EQU ;TIGGER FLAG ; DS00519C-page AN519 00000001 0000 0000 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000A 000B 000C 000D 000E 000F 0010 0011 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001B 001C 001D 001E 001F 0020 0021 0022 0022 0023 0024 0025 0026 0026 0027 0028 0029 0745 0A0A 064C 0A11 02B4 0476 0765 0A11 0576 0A11 074C 0A11 02B4 0476 0665 0A11 0576 0705 0A1B 060C 0A22 02B5 0436 0725 0A22 0536 0A22 070C 0A22 02B5 0436 0625 0A22 0536 0205 002C 0CC1 0028 0000 02E8 0A26 0800 DS00519C-page 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116 00117 00118 00119 00120 F EQU ; ;=========================================== ; SUBROUTINES ;=========================================== ; ;******************************************* ORG ;******************************************* ; ;=========================================== ; DELAY A BIT TIME AND CHECK XC & YC STATUS ;=========================================== BIT BTFSS RA,XC ;XC = ? GOTO BIT0 BTFSC CSTAT,XC ;(XC=1) GOTO BITY ;(XC ALWAYS = 1) INCF XCOUNT, F ;(XC | ) BCF FLAGB,RI ;DEFAULT LEFT BTFSS RA,XD ;LEFT / RIGHT ? GOTO BITY BSF FLAGB,RI GOTO BITY BIT0 BTFSS CSTAT,XC ;(XC=0) GOTO BITY ;(XC ALWAYS = 0) INCF XCOUNT, F ;(XC | ) BCF FLAGB,RI ;DEFAULT LEFT BTFSC RA,XD ;LEFT / RIGHT ? GOTO BITY BSF FLAGB,RI BITY BTFSS RA,YC ;YC = ? GOTO BITY0 BTFSC CSTAT,YC ;(YC=1) GOTO BITDY ;(YC ALWAYS = 1) INCF YCOUNT, F ;(YC | ) BCF FLAGB,UP ;DEFAULT DOWN BTFSS RA,YD ;DOWN / UP ? GOTO BITDY BSF FLAGB,UP GOTO BITDY BITY0 BTFSS CSTAT,YC ;(YC=0) GOTO BITDY ;(YC ALWAYS = 0) INCF YCOUNT, F ;(YC | ) BCF FLAGB,UP ;DEFAULT DOWN BTFSC RA,YD ;DOWN / UP ? GOTO BITDY BSF FLAGB,UP BITDY MOVF RA,W ;SAVE COOR STATUS MOVWF CSTAT MOVLW 193D ;0.833 MS DELAY MOVWF TIMER1 BITD0 NOP DECFSZ TIMER1, F GOTO BITD0 RETLW ; ;================================================= ; ;************************************************ ;* SUBROUTINE TO SEND A BYTE *  1997 Microchip Technology Inc AN519 002A 002A 002B 002C 002D 002E 002E 002F 002F 0030 0031 0032 0033 0034 0035 0036 0036 0037 0037 0038 0039 003A 003B 003C 003D 003E 003F 0040 0041 0042 0042 0043 0044 0044 0045 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F 0050 0051 0052 0053 0054 0055 0056 0056 0057 0058 0059 005A 0078 0753 0A2E 04E6 0900 0753 0A37 0339 0703 0A36 05E6 0A37 04E6 0900 02B8 0778 0A2F 0753 0A42 04E6 0900 05E6 0900 0A44 0900 0900 0800 0CC1 0002 0C0F 0006 0CFF 0005 05E6 0246 0E05 0D80 002D 002E 0205 002C 0073 0074 0075 006F 0070 0071 0072 0214 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131 00132 00133 00134 00135 00136 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 00170 00171 00172 00173 00174 00175 00176 00177 00178 00179 00180 00181 00182 00183 00184 00185 00186  1997 Microchip Technology Inc ;* AS RS232C FORMAT 8,N,1 * ;************************************************ ; BYTE CLRF COUNT ;RESET BIT COUNT BTFSS FLAGA,TR ;ANY TRIGGER GOTO BYTE0 BCF RB,RD ;LOW RD FOR START BIT BYTE0 CALL BIT BYTE1 BTFSS FLAGA,TR ;ANY TRIGGER ? GOTO BYTE3 RRF DATA_AREA, F ;SHIFT DATA TO CARRY BTFSS STATUS,CA ;0 / ? GOTO BYTE2 BSF RB,RD ;SEND A GOTO BYTE3 BYTE2 BCF RB,RD ;SEND A BYTE3 CALL BIT INCF COUNT, F BTFSS COUNT,3 ;COUNT = ? GOTO BYTE1 BTFSS FLAGA,TR ;ANY TRIGGER ? GOTO BYTE4 BCF RB,RD ;SEND SENT BIT CALL BIT BSF RB,RD CALL BIT GOTO BYTE5 BYTE4 CALL BIT CALL BIT BYTE5 RETLW ; ;============================================ ; RESET ENTRY ;============================================ ; INIT MOVLW B’11000001’ ;DISABLE WATCHDOG OPTION MOVLW B’00001111’ ;INIT RB0~3 BE INPUTS TRIS RB ;RB4~7 BE OUTPUTS MOVLW B’11111111’ ;INIT RA0~3 BE INPUTS TRIS RA BSF RB,RD ;HIGH RD PIN COMF RB,W ;GET INIT BUTTON INPUTS ANDLW B’00000101’ IORLW B’10000000’ MOVWF BSTAT MOVWF DATA0 MOVF RA,W MOVWF CSTAT CLRF FLAGA ;CLEAR TR FLAG CLRF XCOUNT ;RESET XCOUNT & YCOUNT CLRF YCOUNT SCAN CLRF DATA1 ;UPDATE X,Y MOVEMENT DATA CLRF DATA2 CLRF DATA3 CLRF DATA4 MOVF XCOUNT,W ;XCOUNT = ? DS00519C-page AN519 005B 005C 005D 005D 005E 005F 0060 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006B 006C 006D 006E 006F 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F 0080 0080 0081 0082 0083 0084 0085 0085 0086 0087 0088 0089 0089 008A 008B 008C 0743 0A80 0215 0743 0A92 0246 0E05 0D80 00AD 0643 0A6B 0553 0246 0E05 0D80 002E 0246 0E05 0D80 002D 020E 0039 092A 020F 0039 092A 0210 0039 092A 0211 0039 092A 0212 0039 092A 0453 0A56 0553 0C40 0094 0603 0A8D 0776 0A90 0274 0294 002F 0031 0074 0A5D 008D 008D 0C40 008E 0034 008F 0A85 0090 0090 0214 0091 0A89 DS00519C-page 10 00187 00188 00189 00190 00191 00192 00193 00194 00195 00196 00197 00198 00199 00200 00201 00202 00203 00204 00205 00206 00207 00208 00209 00210 00211 00212 00213 00214 00215 00216 00217 00218 00219 00220 00221 00222 00223 00224 00225 00226 00227 00228 00229 00230 00231 00232 00233 00234 00235 00236 00237 00238 00239 00240 00241 00242 00243 00244 00245 00246 00247 00248 00249 00250 00251 00252 BTFSS GOTO SCANA MOVF BTFSS GOTO SCANB COMF ANDLW IORLW SUBWF BTFSC GOTO BSF COMF ANDLW IORLW MOVWF SCANC COMF ANDLW IORLW MOVWF MOVF MOVWF CALL MOVF MOVWF CALL MOVF MOVWF CALL MOVF MOVWF CALL MOVF MOVWF CALL BCF GOTO ; WRITX BSF MOVLW SUBWF BTFSC GOTO WRITS BTFSS GOTO COMF INCF WRITA MOVWF MOVWF CLRF GOTO ; WRITR MOVLW MOVWF GOTO ; WRITL MOVF GOTO STATUS,ZERO_AREA WRITX YCOUNT,W STATUS,ZERO_AREA WRITY ;YCOUNT = ? RB,W B’00000101’ B’10000000’ BSTAT, F STATUS,ZERO_AREA SCANC FLAGA,TR RB,W B’00000101’ B’10000000’ DATA0 ;BUTTON STATUS CHANGE ? RB,W B’00000101’ B’10000000’ BSTAT DATA0,W DATA_AREA BYTE DATA1,W DATA_AREA BYTE DATA2,W DATA_AREA BYTE DATA3,W DATA_AREA BYTE DATA4,W DATA_AREA BYTE FLAGA,TR SCAN FLAGA,TR 40H XCOUNT,W STATUS,CA WRITR FLAGB,RI WRITL XCOUNT, F XCOUNT,W DATA1 DATA3 XCOUNT SCANA ;IF CHANGE THEN TRIGGER ;(NO CHANGE) ;(CHANGE) SET TRIGGER FLAG ;FORMAT BUTTON STATUS DATA ;SEND DATA0,1,2,3,4 TO HOST ;CLEAR TRIGGER FLAG ;SET TRIGGER FLAG ;IF XCOUNT > 64 THEN XCOUNT [...]... WORLDWIDE SALES AND SERVICE AMERICAS ASIA/PACIFIC Japan Corporate Office Australia 2355 West Chandler Blvd Chandler, AZ 85224-6199 Tel: 480-792-7200 Fax: 480-792-7277 Technical Support: 480-792-7627 Web Address: http://www.microchip.com Microchip Technology Australia Pty Ltd Suite 22, 41 Rawson Street Epping 2121, NSW Australia Tel: 61-2-9868-6733 Fax: 61-2-9868-6755 Microchip Technology Japan K.K Benex... manufacturer can guarantee the security of their code Code protection does not mean that we are guaranteeing the product as “unbreakable” Code protection is constantly evolving We at Microchip are committed to continuously improving the code protection features of our product If you have any further questions about this matter, please contact the local sales office nearest to you Information contained... Shinyokohama Kohoku-Ku, Yokohama-shi Kanagawa, 222-0033, Japan Tel: 81-45-471- 6166 Fax: 81-45-471-6122 Rocky Mountain China - Beijing 2355 West Chandler Blvd Chandler, AZ 85224-6199 Tel: 480-792-7966 Fax: 480-792-7456 Microchip Technology Consulting (Shanghai) Co., Ltd., Beijing Liaison Office Unit 915 Bei Hai Wan Tai Bldg No 6 Chaoyangmen Beidajie Beijing, 100027, No China Tel: 86-10-85282100 Fax: 86-10-85282104... 610016, China Tel: 86-28-6766200 Fax: 86-28-6766599 China - Fuzhou Microchip Technology Consulting (Shanghai) Co., Ltd., Fuzhou Liaison Office Unit 28F, World Trade Plaza No 71 Wusi Road Fuzhou 350001, China Tel: 86-591-7503506 Fax: 86-591-7503521 China - Shanghai Microchip Technology Consulting (Shanghai) Co., Ltd Room 701, Bldg B Far East International Plaza No 317 Xian Xia Road Shanghai, 200051 Tel:... quality system certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona in July 1999 The Company’s quality system processes and procedures are QS-9000 compliant for its PICmicro® 8-bit MCUs, KEELOQ® code hopping devices, Serial EEPROMs and microperipheral products In addition, Microchip’s quality system for the design and manufacture of development... Technology Taiwan 11F-3, No 207 Tung Hua North Road Taipei, 105, Taiwan Tel: 886-2-2717-7175 Fax: 886-2-2545-0139 EUROPE Denmark Microchip Technology Nordic ApS Regus Business Centre Lautrup hoj 1-3 Ballerup DK-2750 Denmark Tel: 45 4420 9895 Fax: 45 4420 9910 France Microchip Technology SARL Parc d’Activite du Moulin de Massy 43 Rue du Saule Trapu Batiment A - ler Etage 91300 Massy, France Tel: 33-1-69-53-63-20... PICMASTER, PICSTART, PRO MATE, SEEVAL and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S .A and other countries dsPIC, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB, In-Circuit Serial Programming, ICSP, ICEPIC, microPort, Migratable Memory, MPASM, MPLIB, MPLINK, MPSIM, MXDEV, PICC, PICDEM, PICDEM.net, rfPIC, Select Mode and Total Endurance are... 86-10-85282104 Atlanta 500 Sugar Mill Road, Suite 200B Atlanta, GA 30350 Tel: 770-640-0034 Fax: 770-640-0307 Boston 2 Lan Drive, Suite 120 Westford, MA 01886 Tel: 978-692-3848 Fax: 978-692-3821 Chicago 333 Pierce Road, Suite 180 Itasca, IL 60143 Tel: 630-285-0071 Fax: 630-285-0075 Dallas 4570 Westgrove Drive, Suite 160 Addison, TX 75001 Tel: 972-818-7423 Fax: 972-818-2924 Detroit Tri-Atria Office Building... publication regarding device applications and the like is intended through suggestion only and may be superseded by updates It is your responsibility to ensure that your application meets with your specifications No representation or warranty is given and no liability is assumed by Microchip Technology Incorporated with respect to the accuracy or use of such information, or infringement of patents... 33-1-69-53-63-20 Fax: 33-1-69-30-90-79 Germany Microchip Technology GmbH Gustav-Heinemann Ring 125 D-81739 Munich, Germany Tel: 49-89-627-144 0 Fax: 49-89-627-144-44 Italy Microchip Technology SRL Centro Direzionale Colleoni Palazzo Taurus 1 V Le Colleoni 1 20041 Agrate Brianza Milan, Italy Tel: 39-039-65791-1 Fax: 39-039-6899883 United Kingdom Arizona Microchip Technology Ltd 505 Eskdale Road Winnersh Triangle ... BSTAT DATA0,W DATA_AREA BYTE DATA1,W DATA_AREA BYTE DATA2,W DATA_AREA BYTE DATA3,W DATA_AREA BYTE DATA4,W DATA_AREA BYTE FLAGA,TR SCAN FLAGA,TR 40H XCOUNT,W STATUS,CA WRITR FLAGB,RI WRITL XCOUNT,... XCOUNT,W DATA1 DATA3 XCOUNT SCANA ;IF CHANGE THEN TRIGGER ;(NO CHANGE) ;(CHANGE) SET TRIGGER FLAG ;FORMAT BUTTON STATUS DATA ;SEND DATA0,1,2,3,4 TO HOST ;CLEAR TRIGGER FLAG ;SET TRIGGER FLAG ;IF... uniquely suitable for mouse applications Note: This application note provides the user with a simple, fully functional serial mouse implementation The user may use this as a starting point for a more

Ngày đăng: 11/01/2016, 11:48

Mục lục

  • Introduction

  • Theory of Operation

  • About the Software

  • Summary

  • APPENDIX A: MOUSE.ASM

  • WORLDWIDE SALES & SERVICE

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan