Cypress CY4672 manual Interrupt usage and timing, Packet Format, Byte

Models: CY4672

1 126
Download 126 pages 13.98 Kb
Page 48
Image 48

Mouse

3.3.9.1Packet Format 1

When there is only X, Y delta data, the transmitted packet is two bytes.

Table 3-3.

Packet Format 1

 

 

 

Byte 1

 

Byte 2

X Delta

 

Y Delta

(8 bits)

 

(8 bits)

3.3.9.2

Packet Format 2

 

 

 

When there is either z-wheel data or button data, then the transmitted packet is three bytes. In the

 

case where there is no X, Y delta data, but there is z-wheel or button data, the X, Y delta bytes are

 

set to zero. The z-wheel data is a signed value with bit 4 as the sign bit.

 

Table 3-4.

Packet Format 2

 

 

 

 

 

 

 

 

 

Byte 1

 

Byte 2

Byte 3

 

 

X Delta

 

Y Delta

Buttons (Bits[7:5]),

 

 

(8 bits)

 

(8 bits)

Z Delta (Bits[4:0])

 

3.3.9.3 Packet Format 3

When battery voltage level is communicated, the transmitted packet is 1 byte.

Table 3-5. Packet Format 3

Byte 1

Battery Level (1 – 10)

3.3.10 Interrupt usage and timing

In the RDK mouse, the following interrupts has been enabled:

Motion interrupt from the optical sensor

Button (Left, Middle and Right buttons) interrupt

Bind button interrupt

The interrupt latency includes two portions. The first portion is the time between the assertion of an enabled interrupt and the start of its ISR, which can be calculated using the following equation:

Latency1 = Time for current instruction to finish +

Time for M8C to change program counter to interrupt address + Time for LJMP instruction in interrupt table to execute.

For example, if the 5-cycle JMP instruction is executing when an interrupt becomes active, the total number of CPU clock cycles before the ISR begins are as follows:

(1 to 5 cycles for JMP to finish) + (13 cycles for interrupt routine) +

(7 cycles for LJMP) = 21 to 25 cycles.

In the example above, at 12 MHz, 25 clock cycles take 2.083 µs.

48

CY4672 Reference Design Guide, Document # 001-16968 Revision **

[+] Feedback

Page 48
Image 48
Cypress CY4672 manual Interrupt usage and timing, Packet Format, Byte