Topics Topics Edit Profile Profile Help/Instructions Help Member List Member List  
Search Last 1|3|7 Days Search Search Tree View Tree View  

My micro is conversant with the PS/2 ...

:: EPE Chat Zone ­:: ­Radio Bygones Message Board :: » EPE Forum Archives 2010 - » Archive through 28 May, 2013 » My micro is conversant with the PS/2 protocol « Previous Next »

  Thread Last Poster Posts Pages Last Post
  ClosedClosed: New threads not accepted on this page        

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

atferrari
Frequent Contributor
Username: atferrari

Post Number: 1379
Registered: 05-2005


Rating: N/A
Votes: 0 (Vote!)

Posted on Saturday, 25 May, 2013 - 05:16 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

As of today my 18F4520 is able to receive from / transmit to an optical mouse as per the PS/2 protocol.

For the moment, the code, writen in Assembler, just transmits, receives (and displays).

My (unorganized) comments:

AFAIK only reference available to check my micro against to, were the CLK + DATA signals from the mouse. To start with something, my sole chance was to catch the actual initialization where the mouse issues a predictable / known code: AA 00.

First I did was to show through an additional pin, how my software detected the mouse's CLK. Once I knew that, I spent a whole afternoon trying to understand what was going wrong until I realized the START pulse from the mouse, was being largely missed by some millions of microseconds.

To overcome that, I decided to power up the mouse well after the snoopying software was up and running and then ensure I had a stable IDLE condition to now yes, try to catch the initialization.

The additional-pin trick, allowed, by creating a narrow pulse inside every DATA-pulse to faithfuly confirm the START was missing from the screen.

Tried two mice up to now. In the WRAP mode, one sends back every single code I transmit. The other, every three or four bytes OK, sends FE and later FC. Standards? What standards?

It took me a while to understand who does what and when. Once I got clear that the clock was providing the pulses for all the reads and writes, drawing the flow diagram was easy.

One stupid mistake had me several hours trying to understand why my display was showing 170 and not AA.

I know I wrote a too long post but I am happy with the start. So, off now for lunch and a glass of good Malbec.
Agustín Tomás - Buenos Aires - Argentina
Top of pagePrevious messageNext messageBottom of page Link to this message

joe
:::: Super User ::::
Username: joe

Post Number: 1395
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Saturday, 25 May, 2013 - 05:29 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

Well done Agustin,
Always nice when you eventually start making good progress with a project.

Just in case, did you know that John Becker wrote an article in Aug 2004 about connecting a PS2 mouse/keyboard to a PIC. It may be able to help if you get stuck.

Regards,
Joe
My projects, technical info and ramblings at www.hobbyelectronics.net/
Top of pagePrevious messageNext messageBottom of page Link to this message

atferrari
Frequent Contributor
Username: atferrari

Post Number: 1380
Registered: 05-2005


Rating: N/A
Votes: 0 (Vote!)

Posted on Sunday, 26 May, 2013 - 01:20 am:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

Wish I had that number from 2004 to see how he did it!

My next step, now that I have a working code, is to implement the same using interrupts to make it useful inside complex software.

Have to add that without my Owon scope able to freeze frames at will I could not have succeed. Valuable help!
Agustín Tomás - Buenos Aires - Argentina
Top of pagePrevious messageNext messageBottom of page Link to this message

mikeb
Frequent Contributor
Username: mikeb

Post Number: 891
Registered: 02-2008

Rating: N/A
Votes: 0 (Vote!)

Posted on Sunday, 26 May, 2013 - 12:24 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

For some reason, I always learn more from people who share their MISTAKES, not a boring story of how it all went according to plan .... congrats.
Top of pagePrevious messageNext messageBottom of page Link to this message

atferrari
Frequent Contributor
Username: atferrari

Post Number: 1381
Registered: 05-2005


Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, 27 May, 2013 - 01:04 am:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

Hola Mike,

I tend to agree with you to a certain point. Problem is that when you are not familiar with a particular subject the relevance of the mistakes is not always evident.

I commited many this time, maybe the worst was conceptual: identifying the valid pulses as positive. Once I realized that my own graphic was wrong things started to be easier.

Your comment reminds me an article in a American magazine, maybe QST from 30++ years ago.

The title was something like "The antenna that wasn't".

Everything went wrong and the huge antenna was never erected. Terrible.

Sure they learnt something too.


(Message edited by atferrari on 27 May, 2013)
Agustín Tomás - Buenos Aires - Argentina

Administration Administration Log Out Log Out   Previous Page Previous Page Next Page Next Page