Microsoft Serial ballPoint autoinstall

I have been using avr microcontrollers for last 1 year but never faced this problem. Yesterday I was trying to connect a Arduino mini pro with a USB-Serial interface(supplied by Decagon, DevName DecagonUCA, Chip:Silabs CP2024).  I have used this same device in same configuration several times in last 3/4 months.

But only change in code yesterday was that i was throwing some data continuously as the chip powers up. The Operating System (Win7) detects a new device Microsoft serial ballpoint. Now this makes two problems.

  1. The new device uses the serial port you are using. Makes it busy so you can’t use it.
  2. The device assumes the sensor readings you are sending as mouse pointer positions, so it moves the pointer randomly(assuming your data is random) and creates mouse clicks. Now you can’t uninstall the device as your mouse pointer is not in your control.

I removed the USBSerial cable and searched the name of the driver installed, google displayed a number of forum users complaining about this problem. Most of the users are using USB GPS device. I guess any device which continously sends alpha numeric data confused as serial ballpoint. Anyway i want to know what is the actual serial ballpoint protocol

———————————–Serial BallPoint Protocol Start——————————————————–

The old MicroSoft serial mouse, while no longer in general use, can be employed to provide a low cost input device, for example, coupling the internal mechanism to other moving objects. The serial protocol for the mouse is 1200 baud, 7 bit, 1 stop bit, no parity. Every time the mouse changes state (moved or button pressed) a three byte “packet” is sent to the serial interface. For reasons known only to the engineers, the data is arranged as follows, most notably the two high order bits for the x and y coordinates share the first byte with the button status.
D6 D5 D4 D3 D2 D1 D0
1st   byte  1  LB  RB  Y7  Y6 X7 X6
2nd byte  0  X5  X4  X3 X2 X1 X0
3rd  byte  0  Y5  Y4  Y3  Y2 Y1 Y0
LB is the state of the left button, 1 = pressed, 0 = released.
RB is the state of the right button, 1 = pressed, 0 = released
X0-7 is movement of the mouse in the X direction since the last packet. Positive movement is toward the right.
Y0-7 is movement of the mouse in the Y direction since the last packet. Positive movement is back, toward the user.
Sample C code to decode three bytes from the mouse passed in “s”, the button and position (x,y) are returned.

s should consist of 3 bytes from the mouse
void DecodeMouse(unsigned char *s,int *button,int *x,int *y)
*button = ‘n’; /* No button – should only happen on an error */
if ((s[0] & 0x20) != 0)
*button = ‘l’;
else if ((s[0] & 0x10) != 0)
*button = ‘r’;
*x = (s[0] & 0x03) * 64 + (s[1] & 0x3F);
if (*x > 127)
*x = *x – 256;
*y = (s[0] & 0x0C) * 16 + (s[2] & 0x3F);
if (*y > 127)
*y = *y – 256;


  • Alternative:

———————————–Serial BallPoint Protocol End——————————————–

Solution 1, (NoSerialMice):

  1. To disable the detection of devices on COM ports in Windows NT/2000/XP: Go to: My Computer – Right Click – Properties | Advanced tab | Startup and Recovery – Settings | Edit. Make a backup copy of the Boot.ini file, (copy and paste in another location)
  2. Remove the hidden, system, and read-only attributes from the Boot.ini file. (Use Windows Explorer and right click on file, then properties.)
  3. Using a text editor (such as Notepad) open the Boot.ini file.(Double click on file, or right click and choose Notepad from the “Open With” option.)
  4. Add “/NoSerialMice” to the end of each entry in the [operating systems] section of Boot.ini. See the example below for more information
  5. Save Boot.ini and quit Notepad
  6. Shutdown and restart Windows

NOTE: The /NoSerialMice option is not case sensitive.

Solution  2: Disable serial mouse

You can disable serial mouse when its connected, but mostly in this type problem the mouse pointer keeps oscillating randomly so you can’t choose the device manager or disable the device.

I²C Protocol in microcontrollers

I²C (Inter-Integrated Circuit) (generically referred to as “two-wire interface”) is a multi-master serial single-ended computer bus invented by Philips that is used to attach low-speed peripherals to a motherboard, embedded system, or cellphone.

No licensing fees are required to implement the I²C protocol. However, fees are still required to obtain I²C slave addresses allocated by NXP.

I²C uses only two bidirectional open-drain lines, Serial Data Line (SDA) and Serial Clock (SCL), pulled up with resistors. Typical voltages used are +5 V or +3.3 V although systems with other voltages are permitted.

Maximum no of I2C UC ca be interfaced: 27=128, 16 reserved addresses, so a maximum of 112 nodes can communicate on the same bus.

Max. Communication Speed: 100 kbit/s standard mode and the 10 kbit/s low-speed mode, but arbitrarily low clock frequencies are also allowed. Recent revisions of I²C can host more nodes and run at faster speeds (400 kbit/s Fast mode, 1 Mbit/s Fast mode plus or Fm+, and 3.4Mbit/s High Speed mode). These speeds are more widely used on embedded systems than on PCs.

3 wire (SPI) Vs 2 wire (I²C):

I²C (for ‘Inter-Integrated Circuit’, protocol) and SPI (for ‘Serial Peripheral Interface’) both protocols are well-suited for communications between integrated circuits, for slow communication with on-board peripherals. At the roots of these two popular protocols we find two major companies – Philips for I²C and Motorola for SPI – and two different histories about why, when and how the protocols were created.

The I²C bus was developed in 1982; its original purpose was to provide an easy way to connect a CPU to peripherals chips in a TV set. Peripheral devices in embedded systems are often connected to the microcontroller as memory-mapped I/O devices. One common way to do this is connecting the peripherals to the microcontroller parallel address and data busses. This results in lots of wiring on the PCB (printed circuit board) and additional ‘glue logic’ to decode the address bus on which all the peripherals are connected. In order to spare microcontroller pins, additional logic and make the PCBs simpler – in order words, to lower the costs – Philips labs in Eindhoven (The Netherlands) invented the ‘Inter-Integrated Circuit’, IIC or I²C protocol that only requires 2 wires for connecting all the peripheral to a microcontroller.

It seems the Serial Peripheral Protocol (SPI) was first introduced with the first microcontroller deriving from the same architecture as the popular Motorola 68000 microprocessor, announced in 1979. SPI defined the external microcontroller bus, used to connect the microcontroller peripherals with 4 wires. Unlike I²C, it is hard to find a formal separate ‘specification’ of the SPI bus – for a detailed ‘official’ description, one has to read the microcontrollers data sheets and associated application notes.


Table: Advantages and Disadvantages of 3-/2-Wire Interfaces





1. Speed
2. No pullup resistors required
3. Full-duplex operation
4. Noise immunity

1. Larger number of bus line connections
2. Individual chip-select lines required to communicate with more than one slave at a time
3. No acknowledgment of received data

2-Wire: I²C and SMBus 

1. Fewer bus line connections
2. Multiple devices share the same bus
3. Received data is acknowledged

1. Speed: SMBus limited to 100kHz; I²C limited to 3.4MHz
2. Half-duplex operation
Open-drain bus lines require pullup resistors
4. Reduced noise immunity

A master and a slave communicate through multiple bus lines over a 
serial interface. During a write cycle, the master uses its own clock and data signals to transmit data to the slave. During a read cycle, the slave transmits data to the master.

External Links:

Measuring and analyzing I²C signals

SPI/I²C Bus Lines Control Multiple Peripherals AN4024