Sign in

username or email:

password:



Not a member?
Forgot your Password?

Search Comp.Arch.Embedded



Search tips


Sponsor

Discussion Groups

See Also

DSPFPGA

Discussion Groups | Comp.Arch.Embedded | How not to be a mouse?

There are 16 messages in this thread.

You are currently looking at messages 1 to 10.


So far in June, you have voted 0 times ou of a total of 15 votes by the community.
Please help us clean the archives from unuseful discussion threads by using the voting system! Details here.

How not to be a mouse? - Vladimir Vassilevsky - 2012-08-28 23:57:00

A device is streaming binary data to PC by COM port. Sometimes Windows 
mistakenly recognize such device as a mouse. So mouse pointer starts crazy 
jumping over the screen, pressing buttons and like. This can happen with 
real COM port as well as with USB to serial converter. I encounter this 
problem once in a while.
The standard solution is disable serial mouse in the registry; however I 
would prefer to modify binary protocol to avoid detection.
How does Windows recognize a serial mouse? In the other words, what 
sequences should be avoided in the binary protocol ?

Vladimir Vassilevsky
 DSP and Mixed Signal Consultant
 www.abvolt.com



 



Re: How not to be a mouse? - David Brown - 2012-08-29 02:39:00

On 29/08/2012 05:57, Vladimir Vassilevsky wrote:
> A device is streaming binary data to PC by COM port. Sometimes Windows
> mistakenly recognize such device as a mouse. So mouse pointer starts crazy
> jumping over the screen, pressing buttons and like. This can happen with
> real COM port as well as with USB to serial converter. I encounter this
> problem once in a while.
> The standard solution is disable serial mouse in the registry; however I
> would prefer to modify binary protocol to avoid detection.
> How does Windows recognize a serial mouse? In the other words, what
> sequences should be avoided in the binary protocol ?
>

I was much "amused" when I first saw this effect.

As far as I know, Windows treats /any/ incoming serial port data as a 
mouse during startup.  So the solution is not to send any data before 
Windows has started.

It may be that you can avoid the problem with different baud rates - 
serial mice use quite low baud rates, and higher rates are unlikely to 
be accepted as good characters by the UART at 9600 (but as I'm sure you 
know, "unlikely" here does not mean it will never happen).



Re: How not to be a mouse? - Rich Webb - 2012-08-29 08:46:00

On Wed, 29 Aug 2012 08:39:02 +0200, David Brown
<d...@westcontrol.removethisbit.com> wrote:

>On 29/08/2012 05:57, Vladimir Vassilevsky wrote:
>> A device is streaming binary data to PC by COM port. Sometimes Windows
>> mistakenly recognize such device as a mouse. So mouse pointer starts crazy
>> jumping over the screen, pressing buttons and like. This can happen with
>> real COM port as well as with USB to serial converter. I encounter this
>> problem once in a while.
>> The standard solution is disable serial mouse in the registry; however I
>> would prefer to modify binary protocol to avoid detection.
>> How does Windows recognize a serial mouse? In the other words, what
>> sequences should be avoided in the binary protocol ?
>>
>
>I was much "amused" when I first saw this effect.
>
>As far as I know, Windows treats /any/ incoming serial port data as a 
>mouse during startup.  So the solution is not to send any data before 
>Windows has started.

I've also experience this when a USB-serial adapter is plugged into
Windows while there is active serial data. It appears a serial stream
that is present while the USB device is being enumerated is the cause.
First the USB-serial device/cable by itself until it enumerates as a
plain old serial port and then attach the serial source.

An occasional (but never permanent) fix is to disable, not uninstall,
the Microsoft Serial BallPoint entry in Device Manager. Might need to do
the hack (thanks again, MS) to show un-installed devices.
<http://msdn.microsoft.com/en-us/library/windows/hardware/ff553955(v=vs.85).aspx>

I've never found an absolutely reliable way of avoiding this other than
to block serial data from Windows during boot time. For some embedded
XPe devices, this has meant gates (and even relays!) that block the
serial data streams until Windows says "Okay, I'm awake." Real PITA.

-- 
Rich Webb     Norfolk, VA

Re: How not to be a mouse? - Stefan Reuther - 2012-08-29 13:55:00

David Brown wrote:
> It may be that you can avoid the problem with different baud rates -
> serial mice use quite low baud rates, and higher rates are unlikely to
> be accepted as good characters by the UART at 9600 (but as I'm sure you
> know, "unlikely" here does not mean it will never happen).

We're rarely using anything other than 115200 bps, and still see the
effect, so that will probably not help.

However, installing and disabling the serial mouse driver has worked
well so far.


  Stefan


Re: How not to be a mouse? - Meindert Sprang - 2012-08-30 06:49:00

"Vladimir Vassilevsky" <n...@nowhere.com> wrote in message
news:f...@giganews.com...
> A device is streaming binary data to PC by COM port. Sometimes Windows
> mistakenly recognize such device as a mouse. So mouse pointer starts crazy
> jumping over the screen, pressing buttons and like. This can happen with
> real COM port as well as with USB to serial converter. I encounter this
> problem once in a while.
> The standard solution is disable serial mouse in the registry; however I
> would prefer to modify binary protocol to avoid detection.
> How does Windows recognize a serial mouse? In the other words, what
> sequences should be avoided in the binary protocol ?

There is a document from Microsoft called "Plug and Play External COM device
specification" which exactly describes how Windows detects a mouse.



During Plug & Play enumeration, Windows toggles the DTR and RTS lines in a
certain pattern to which a device whould respond by sending a packet of PnP
information. If this information is not received or it appears to be
"garbage", windows assumes it is a mouse.



The only reliable way of preventing false detection is to not send any data
out of your serial port as long as you see this pattern on the DTR and RTS
lines. This of course assumes you have at least one of those signals
available on your serial port.



A good and proven way is how we do it with our USB products using an FT232
chip: we simply remove the PnP enumerator lines from the .INF files and
change one flag (I can look that up for you). This prevents windows from
executing the PnP enumerator for this particular virtual COM port.



Meindert



Re: How not to be a mouse? - fabatera - 2012-08-30 10:26:00

I had used serial devices communicating with COM port for years and never
had seen this...

>"Vladimir Vassilevsky" <n...@nowhere.com> wrote in message
>news:f...@giganews.com...
>> A device is streaming binary data to PC by COM port. Sometimes Windows
>> mistakenly recognize such device as a mouse. So mouse pointer starts
crazy
>> jumping over the screen, pressing buttons and like. This can happen
with
>> real COM port as well as with USB to serial converter. I encounter this
>> problem once in a while.
>> The standard solution is disable serial mouse in the registry; however
I
>> would prefer to modify binary protocol to avoid detection.
>> How does Windows recognize a serial mouse? In the other words, what
>> sequences should be avoided in the binary protocol ?
>
>There is a document from Microsoft called "Plug and Play External COM
device
>specification" which exactly describes how Windows detects a mouse.
>
>
>
>During Plug & Play enumeration, Windows toggles the DTR and RTS lines in
a
>certain pattern to which a device whould respond by sending a packet of
PnP
>information. If this information is not received or it appears to be
>"garbage", windows assumes it is a mouse.
>
>
>
>The only reliable way of preventing false detection is to not send any
data
>out of your serial port as long as you see this pattern on the DTR and
RTS
>lines. This of course assumes you have at least one of those signals
>available on your serial port.
>
>
>
>A good and proven way is how we do it with our USB products using an
FT232
>chip: we simply remove the PnP enumerator lines from the .INF files and
>change one flag (I can look that up for you). This prevents windows from
>executing the PnP enumerator for this particular virtual COM port.
>
>
>
>Meindert
>
>
>

	   
					
---------------------------------------		
Posted through http://www.EmbeddedRelated.com

Re: How not to be a mouse? - Grant Edwards - 2012-08-30 12:34:00

On 2012-08-30, fabatera <18720@embeddedrelated> wrote:

> I had used serial devices communicating with COM port for years and never
> had seen this...

You're lucky.

My employer makes serial "boards" (attached via ISA, PCI, USB,
Ethernet), and this has been a constant problem for our Windows
customers for _decades_.

-- 
Grant Edwards               grant.b.edwards        Yow! Maybe I should have
                                  at               asked for my Neutron Bomb
                              gmail.com            in PAISLEY --

Re: How not to be a mouse? - 2012-08-30 13:31:00

On Thu, 30 Aug 2012 09:26:00 -0500, "fabatera" <18720@embeddedrelated>
wrote:

>I had used serial devices communicating with COM port for years and never
>had seen this...

As long as your PC COM port is a master (e.g. Modbus RTU master),
there is of course no problems, because the serial port does not
initiate any communication, until the computer is up and running.

The problem starts, when your Windows COM port is a supposed to be a
slave port (e.g. Modbus RTU slave), thus the other end is master and
is continuously polling for responses from your end. If such poll
happens during your Windows PC startup, you are in trouble.


Re: How not to be a mouse? - Hans-Bernhard Bröker - 2012-08-30 14:17:00

On 30.08.2012 19:31, u...@downunder.com wrote:

> As long as your PC COM port is a master (e.g. Modbus RTU master),
> there is of course no problems,
[...]
> The problem starts, when your Windows COM port is a supposed to be a
> slave port

And sometimes, it's neither.  Usage of RS232 doesn't imply a 
master/slave setup in any way.



Re: How not to be a mouse? - 2012-08-30 14:58:00

On Thu, 30 Aug 2012 20:17:25 +0200, Hans-Bernhard Bröker
<H...@t-online.de> wrote:

>On 30.08.2012 19:31, u...@downunder.com wrote:
>
>> As long as your PC COM port is a master (e.g. Modbus RTU master),
>> there is of course no problems,
>[...]
>> The problem starts, when your Windows COM port is a supposed to be a
>> slave port
>
>And sometimes, it's neither.  Usage of RS232 doesn't imply a 
>master/slave setup in any way.
>

I certainly agree that RS-232/RS-422 connections are capable of full
duplex communication. For industrial protocols, I can think of only
two protocols (one IEC and one Siemens), with more or less symmetrical
"connection setup", while the actual data flow is full duplex and
symmetrical.

In general, there are some asymmetry in the data transfer directions,
while the under laying hardware would be capable of full duplex point
to point communication.
 

| 1 | |