17.11.2014 Views

Designing a Low-Cost USB Mouse with the Cypress Semiconductor ...

Designing a Low-Cost USB Mouse with the Cypress Semiconductor ...

Designing a Low-Cost USB Mouse with the Cypress Semiconductor ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Designing</strong> a <strong>Low</strong>-<strong>Cost</strong> <strong>USB</strong> <strong>Mouse</strong><br />

Endpoint_1<br />

• Prepare data in Endpoint_1 DMA<br />

buffer<br />

• Re-enable interrupts<br />

Return<br />

Figure 13. Endpoint 1 Interrupt Service Routine<br />

lh = left horizontal photo transistor<br />

rh = right horizontal photo transistor<br />

r/l = right / left bit state<br />

r/l=0 0<br />

lh=0<br />

STATE 0<br />

rh=0<br />

r/l=01<br />

STATE 1<br />

rh=01<br />

lh=1 rh=1<br />

rh=10 lh=10<br />

STATE 3<br />

lh=01<br />

STATE 2<br />

r/l=10<br />

r/l=11<br />

Figure 14. <strong>Mouse</strong> State Diagram<br />

State 3 State 2 State 0 State 1 State 3<br />

Left horizontal<br />

photo transistor output<br />

Right horizontal<br />

photo transistor output<br />

Left movement Right movement<br />

Figure 15. State Definitions<br />

7

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!