background image

11

PS/2 Firmware Description

A function call map for PS/2 operation is shown in Figure 
7. The following are descriptions of the functions in 

Adns-

3080.asm

PS/2 Functions

PS2Main

 

– Initializes the PS/2 related parameter to their 

default state, enables the serial interface and sends a 
BAT code (AAh followed by 00h) to the host. After the 
initialization, the program goes into the infi nite 

PS2Task-

Loop 

loop.

PS2TaskLoop

 

– This function spins in an infi nite loop waiting 

for an event that needs servicing. The 

ProcessButtons 

and 

ReadProcessOptics 

functions are called within this loop to 

retrieve any new motion or button information. The data 
received from these functions will be loaded into the 
endpoint 1 buff er to be sent to the host.

PS2BAT

 

– delays for 500 milliseconds, then sends the AAh 

followed by 00h initialization string to the host for the 
PS/2 Basic Assurance Test.

PS2SendResponseByte

 

– Sends a response byte (ACK, ERROR, 

RESEND) to the host.

PS2Send

 

– This routine sends a byte to the host according 

to the standard PS/2 protocol. This routine calls 

send_0 

and 

send_1 

routines that shift the bits out serially over 

the PS/2 interface.

PS2Receive

 

– This routine receives a byte from the host ac-

cording to the standard PS/2 protocol. This routine calls 
the 

GetBit 

function to clocks each bit in.

PS2Resend

 

– A copy of the last transmission is always left 

intact in the message buff er. To re-send it, this routine 
simply resets the message length.

PS2SetDefault

 

– This routine is called in response to a SET 

DEFAULT command from the host. It then sets the mouse 
parameters to the default settings.

PS2DisableMouse

 

– Disables the mouse.

PS2EnableMouse

 

– Enables the mouse.

PS2SetSampleRate

 

– This routine is called in response to a 

SET SAMPLE RATE command from the host. It then veri-
fi es that the requested sample rate is valid and sets the 
sample rate for the mouse. Valid sample rates are defi ned 
in the PS/2 Mouse specifi cation.

PS2ReadDeviceType

 

– This routine is called in response to a 

READ DEVICE TYPE request from the host. This mouse 
always sends a 0x00 in response to this request.

PS2SetRemoteMode

 

– This routine is called in response to a 

SET REMOTE MODE command from the host. The PS/2 
mode is then set to remote mode.

PS2SetWrapMode

 

– This routine is called in response to a SET 

WRAP MODE command from the host. It then sets the 
mouse mode to wrap mode. See the PS/2 specifi cation 
for more details on wrap mode.

PS2ResetWrapMode

 

- This routine is called in response to a 

RESET WRAP MODE command from the host. The mode 
is then reset to the previous mode. According to the IBM 
PS/2 specifi cation, if stream mode is enabled, the mouse 
is disabled when the wrap mode is reset.

PS2ReadData

 

– This routine is called in response to a READ 

DATA command from the host. This routine then sends a 
mouse packet in response to the  command.

PS2SetStreamMode

 

– This routine is called in response to 

a SET STREAM MODE command from the host. Stream 
mode is then enabled. See the PS/2 specifi cation for more 
information about stream mode.

PS2StatusRequest

 

– This routine is called in response to a 

STATUS REQUEST command from the host. A three byte 
report is sent to the host in response to this request. See 
the PS/2 mouse specifi cation for more details.

PS2SetResolution

 

– This routine is called in response to a SET 

RESOLUTION command from the host. Set Resolution is 
a two byte command; the 2nd byte being the resolution 
itself. This routine is called after reception of the fi rst byte, 
and so does nothing by itself.

PS2SetScaling

 

– This routine is called in response to a SET 

SCALING command from the host. Scaling then changes 
to 2:1.

PS2ResetScaling

 

– This routine is called in response to a 

RESET SCALING command from the host. The scaling is 
then reset back to 1:1.

PS2GetHostByte(void)

 

– This routine checks to see if the host 

is requesting to send data, and if so, it clocks in a data 
byte from the host. The function returns the received 
byte in the accumulator and implicitly clears the carry to 
0 if the reception occurred without errors.

PS2DoCommand

 

– This routine dispatches the received PS/2 

command byte to the proper handler.

LoadMousePacket

 

– This routine formats a mouse packet 

according to the PS/2 Mouse specifi cation and loads it 
to the buff er.

PS2SendNextByte

 

– This routine sends the next byte in buff er 

to the host.

ResetMouseReportInterval

 

– This routine resets the mouse 

report interval to the value last sent by the host. The 
report interval is counted down in the main loop to 
provide a time base for sending mouse data packets.

Содержание ADNK-3083

Страница 1: ...load a full array of pixel values from a single frame To learn more about sensor s technical information please visit the Avago web site at http www semiconductor Avago com Introduction This design gu...

Страница 2: ...D and Optical Encoder combination Mouse Buttons Mouse buttons are connected as standard switches These switches are pulled up by the pull up resistors inside the microcontroller When the user presses...

Страница 3: ...0 asm listing The following statements are the pin definitions as they exist today The firmware will use these definitions to read and configure the GPIO pins without any other modifications Communica...

Страница 4: ...in Figure 3 below ADNK 3083 Designer s Kit Optical Mouse The ADNK 3083 optical mouse unit allows users to evaluate the performance of the Avago s Optical Tracking Engine sensor lens LED assembly clip...

Страница 5: ...r IGES drawing Sensor Lens Object Surface 2 40 0 094 To Disassemble the ADNK 3083 Unit The ADNK 3083 comprises of the plastic mouse casing printed circuit board PCB lens buttons and USB cable See Figu...

Страница 6: ...lopment Kit and the CY3654 P05 Personality Board Programming support and programmer adaptors for the Cypress CY7C63743 PXC can be found through Cypress CY3649 xxxV CY3083 SC28 CY3083 08 or through mos...

Страница 7: ...c product Note 3 MaxPower value should be changed as per specific circuit s current draw 4 Post Enumeration Operation Once communication between the host and mouse is established the mouse now has the...

Страница 8: ...D sampled high disable the USB connect resistor and Delay 100 S If D and D are both 0 detect a USB interface else detect a PS2 interface SPIInit This routine is called in the try_download to enable t...

Страница 9: ...ep0InReceived This routine is entered whenever an IN packet is received on endpoint 0 ep0OutReceived This routine is entered whenever an OUT packet is received on endpoint 0 setDeviceConfiguration Thi...

Страница 10: ...l Map DualMain GetMouseType USB Main PS2 Interface System Initialization USB Initialization USBTaskLoop ProcessButtons ProcessOptics ReadMotionReg ReadDeltaX ReadDeltaY Read ZWheel Load new mouse pack...

Страница 11: ...mand from the host The PS 2 mode is then set to remote mode PS2SetWrapMode This routine is called in response to a SET WRAP MODE command from the host It then sets the mouse mode to wrap mode See the...

Страница 12: ...es and jumps to usbMain for the USB initialization Dual1msTimer This ISR reads the current status of the buttons Therefore every one millisecond the button state is updated the button status informati...

Страница 13: ...sePacket HostRequestToSend PS2Receive GetBit send0 ReadMotionReg PS2SendResponseByte PS2Send Send_1 Send_0 ResetInterval PS2SetScaling SetWrapMode SetDefault PS2StatusRequest SetRemoteMode CheckWheel...

Страница 14: ...ons L M QA QB Vcc GND V DD 19 16 GND 1K REFB 14 P0 3 7 NPD 4 P0 7 3 SCLK 21 P0 6 2 MISO 22 9 GUARD NC NC 11 18 20 P1 1 R 20 K 20 K 1 NCS LP2950ACZ 3 3 3 1 2 Vo Vin GND 4 7 F 0 1 F 0 1 F MMBT2222A 13 R...

Страница 15: ...S 1 R16 Chip resistor 20K 1 0805_CUS 2 R8 R10 Chip resistor 240R 1 0805_CUS 1 R4 Resonator 24MHz XTAL4 1 X1 Transistor 2N2222 TO92C 1 Q3 Ceramic cap 2 2uF 16V 1206 1 C5 Tant cap 4 7uF 16V 1206 2 C2 C4...

Страница 16: ...16 Figure C1 PCB Schematic Bottom Layer Figure C2 PCB Schematic Top Overlay Appendix C PCB Layout HLMP EG3E Figure C3 PCB Schematic Bottom Overlay...

Страница 17: ...tional view of PCB assembly highlighting all optical mouse components optical mouse sensor clip lens LED PCB and base plate Clip LED PCB Sensor Lens Light Pipe Surface Base Plate Appendix D Base Plate...

Страница 18: ...e Command Action 0xFF Reset Resets mouse to default states 0xFE Resend Resends last data to host 0xF6 Set Default Sets mouse to use default parameters 0xF5 Disable Disables the mouse 0xF4 Enable Enabl...

Страница 19: ...dicate that this is a Microsoft compatible three button wheel mouse the wheel report format is enabled After this initialization sequence the PS 2 wheel reporting format is enabled The fourth byte rep...

Страница 20: ...ADNS 2220 001 Assembly Clip Data Sheet d HLMP EG3E xxxxx Red LED Data Sheet Hardware Support Files a ADNK 3083 BOM List b ADNK 3083 Schematic c 3D Model IGES Files d Gerber File Software Support Files...

Отзывы: