Hi! > Date: Wed, 9 Apr 1997 17:49:11 -0700 > Subject: Simulating a mouse > > Hi, > I want to simulate a serial mouse with the PIC. > I know that Windows detects a mouse, so I also > need to know how this is accomplished. Is there > some information available on this subject? > > Many thanks! > You should look at Microchip web/ech for source code of a mouse (communication etc.). Regarding the mouse detection, the things are going like this: the mouse driver (on PC, or other computer) first power off the mouse (this is done by deactivating signals like CTS, DTR ... I do not remember now because I experimented with this about a year ago) then prepare itself to receive a char on RX line, then power the mouse (again by setting the CTS, DTR... lines on COM port). At the moment of power-up, the mouse sends a character via RS232 to the host (PC). The mouse driver detects the mouse presence and type from this character (and another line DSR, RTS? I'm not shure about this). If the character received is a "M", then the mouse is Microsoft compatibile and sends data as described in Microchip ECH, I think "L" stands for Genius but I'm not shure. Ah, not to forget, in most cases the communication parameters are 1200 (bps) ,n (no parity) ,8 (or 7 data bits),1 (or 2 stop bits), but some models of Logitech mice, do comunicate at 9600 bps (wireless mouse, mouseman...). By knowing the characters the mouse can send you, you can auto detect the boud rate. I got this by debuging one of the mouse drivers for PC computers. Hope this helps,