Chameleon-PIC Nurve Networks, Chameleon-PIC Datasheet - Page 62

MCU, MPU & DSP Development Tools PIC24 & PROPELLER DEV SYSTEM (SBC)

Chameleon-PIC

Manufacturer Part Number
Chameleon-PIC
Description
MCU, MPU & DSP Development Tools PIC24 & PROPELLER DEV SYSTEM (SBC)
Manufacturer
Nurve Networks
Datasheet

Specifications of Chameleon-PIC

Processor To Be Evaluated
PIC24
Data Bus Width
16 bit
Interface Type
USB, VGA, PS/2, I2C, ISP, SPI
Operating Supply Voltage
3.3 V, 5 V
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
12.2.1 Basic Mouse Operation
The standard PS/2 mouse interface supports the following inputs:
The mouse has an internal microcontroller that translates the motion of either a mechanical ball or optical tracking
system. The inputs along with the buttons are scanned at a regular frequency and updated are made to the internal “state”
of the mouse via various counters and flags that reflect the movement and button states. Obviously there are mice these
days with a lot more than 3 buttons and 2-axes, but we are not going to concern ourselves with these (extensions) we just
need to read the X,Y position along with the state of the buttons.
The standard PS/2 mouse has two internal 9-bit 2’s complement counters (with an overflow bit each) that keep track of
movement in the X and Y axis. The X and Y counters along with the state of the three mouse buttons are sent to the host
in the form of a 3-byte data packet. The movement counters represent the amount of movement that has occurred since
the last movement data packet was sent to the host; therefore they are relative positions, not absolute.
Each time the mouse reads its inputs (controlled internally by the microcontroller in the mouse), it updates the state of the
buttons and the delta’s in the X, Y counters. If there is an overflow, that is if the motion from the last update is so large it
can’t fit in the 9-bits of either counter then the overflow flag for that axis is set to let the host know there is a problem.
The parameter that determines the amount by which the movement counters are incremented/decremented is the
resolution. The default resolution is 4 counts/mm and the host may change that value using the "Set Resolution" ($E8)
command. Additionally, the mouse hardware can do a scaling operation to the sent data itself to save the host the work.
The scaling parameter controls this. By default, the mouse uses 1:1 scaling, which means that the reported motion is the
same as the actual motion. However, the host may select 2:1 scaling by sending the "Set Scaling 2:1" ($E7)
command. If 2:1 scaling is enabled, the mouse applies the following mapping as shown in Table 12.5 the counters before
sending their contents to the host in the data packet.
So the scaling operation only takes affect when the actual movement delta is greater than 1, and for delta > 5, the
reported movement is always (delta*2). Now, let’s look at the actual data packet format for the mouse state.
12.2.2 Mouse Data Packets
The PS/2 mouse sends the movement information to the host which includes the position counters, button state, overflow
flags and sign bits in the format show in Table 12.6.
X (right/left) movement.
Y (up/down) movement.
Left, Middle, and Right buttons.
Table 12.5 – Mouse scaling reported data mapping when in 2:1 mode.
Actual Movement
delta > 5
(delta)
0
1
2
3
4
5
© 2009 NURVE NETWORKS LLC “Exploring the Chameleon PIC 16-Bit”
Movement
Reported
delta*2
0
1
1
3
6
9
62

Related parts for Chameleon-PIC