ohohnick

Insert a PS2 mouse into ZPUino

5 posts in this topic

Hi there!

 

I'm doing a project about insert a PS2 mouse created by Verilog into the ZPUino. I have run into some problems.

 

1. the PS2 mouse has two inputs: clock, reset, two inouts: ps2d, ps2c which are connected to the actual mouse, and four outputs: xm, ym, btnm, tick which connects to the wb_dat_o. I'm not sure what other wishbone signals I need to use in this module.

 

2. After connecting the mouse with wishbone, I need to insert it with ZPUino. And I don't know where to start.

 

post-37218-0-89835100-1407243676.jpg

post-37218-0-37093600-1407243685_thumb.j

Share this post


Link to post
Share on other sites

You will need to at least use the cyc/stb and ack signals.

 

What's the tick for ? Does it signal valid data ?

 

Alvie

Share this post


Link to post
Share on other sites

Thanks for your reply Alvie. btnm, xm, ym and tick are signals to control LEDs, when users move the PS2 mouse, the LEDs will light and react with different orders

Share this post


Link to post
Share on other sites

That information is not helpful, unless you actually tell me the meaning of each of the signals.

 

In order to connect the mouse to the CPU, you need to provide a means to put the information into temporal context. I assume that Xm and Ym are "difference" values, not absolute, so you will have to position the mouse in the controller, or you will have to interrupt the CPU every time the mouse moves, so it can compute that.

 

For difference values, you need to know exactly when the mouse sent you new data. I assume "tick" is for just that, tell me if I am wrong.

 

So you have to choose between a full interrupt-driven approach, a simple polling approach, or a mix of both. Only then you can implement the wishbone interface.

Share this post


Link to post
Share on other sites

Hi Alvie

 

Thx for your reply. Sorry I was busy with other parts of my project these days.

 

I know more about the mouse module now.

 

The PS2 mouse has the signals as x-axis(right/left) and y-axis(up/down) movement and the click statue of left, right and middle button.

So the signals xm and ym are two 9-bit x-axis and y-axis movement signals and btm is a 3 bit button status signal. m_done_tick is a one-clock-cycle statue and is asserted when the assembled data is available.

 

ps2d and ps2c are signals connecting with the mouse's transmitting and receiving system.

 

I have checked all the VHDL files in the papilio_pro_lx9_vanilla_ise ZPUino. I think I can use one "empty device" such as "slot8" to implement the mouse. But I'm not sure what other files do I need to modify also.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now