Zaunkoenig M1K Firmware

, by
Patrick Schmalzried

You do not need to install any software for the M1K. Even though the M1K has only two buttons, you can conveniently configure your CPI (same as DPI, by the way) with them. The firmware, the software that is running in the microcontroller unit (MCU) of the M1K, is open-source and is optimized for extremely low latency.

On software and CPI buttons

Traditionally there have been two approaches for changing important mouse attributes like CPI, Angle Snapping und Lift Off Distance (LOD). External software and dedicated buttons.

The one most hated by gamers is probably the dreaded external software. First, these software suites like to have a terrible user interface bloated with buggy non-features.

Second, they are a terrible solution for pro-gamers, as they cannot install software on the PC they are about to play a tournament game on. I will not even bother commenting on the monstrosity that is cloud-based driver software. Moving on.

The second approach: having dedicated buttons that do nothing else but change CPI, for example. This is much better than having to install painful software. It is especially suitable for tournaments. However, often times these CPI buttons are limited to just two or three different CPI values.

Furthermore, these dedicated buttons increase the weight of the gaming mouse. When your gaming mouse weighs 100 grams, it does not really matter that the CPI button increases the weight by half a gram. With a mouse as light as the M1K however (23 grams), even half a gram is a significant increase in overall weight.

Luckily we have an elegant solution to this problem.

Changing CPI, Angle Snapping and LOD without external software or dedicated buttons

By using the MCU of the M1K you can change CPI, Angle Snapping and LOD. The MCU will remember your changes thanks to its on-chip flash memory. The MCU the M1K uses is called ATmega32U2 and is made by US company Microchip Technology.

The following is how you can change CPI, Angle Snapping und LOD in the M1K by using the MCU.

Changing CPI

The M1K uses a PixArt 3360 sensor. You can change the CPI in steps of 100. And this is how it works:

  1. Plug the M1K into your PC.
  2. Lift the M1K a few centimeters off your mousepad so it stops tracking.
  3. Hold down both mouse buttons for five seconds.
  4. The M1K now enters the so-called «CPI programming mode». Upon entering the mouse cursor will move to show you at how much CPI the M1K is currently at. The standard value of the M1K is 800 CPI. So when you enter the CPI programming mode with a brand new M1K the mouse cursor will go up and down exactly eight times. At 1400 CPI the mouse cursor would move to the right and back once (indicating 1000 CPI), and then up and down four times (indicating 400 CPI).
  5. Once the cursor is done showing you at how much CPI the M1K is running at you can place the M1K back on your mousepad. Each time you now press your left mouse button, the CPI will be decreased by 100 until you reach the minimum CPI value of 100. Pressing right increases CPI by 100. While you are doing this you can move the M1K around to get a feeling for different CPI values.
  6. You exit the CPI mode the same way you entered it: Lift the M1K a few centimeters off your mousepad so it stops tracking and hold down both mouse buttons for five seconds.
  7. The M1K exits CPI programming mode and tells you again at what CPI it is running now. Say you set the mouse to 700 CPI: the mouse cursor now will move up and down seven times. After the mouse cursor has stopped moving the M1K is ready to go.

Changing Angle Snapping and LOD

Per default Angle Snapping on the M1K is disabled, and the LOD is set to 2 millimeters. Should you want to change these values you can do so by following these steps:

  • To activate Angle Snapping, press and hold the left button while plugging in the M1K. Cursor moves clockwise in a square to indicate the change.
  • To set LOD to 3 millimeters, press right button while plugging in the M1K. Cursor moves clockwise in a square to indicate change.
  • To go back to default settings, press both buttons while plugging in the M1K: Angle Snapping now is disabled again and LOD is set to 2 millimeters. Cursor moves counter-clockwise in a square to indicate the change.

The firmware of the M1K is open-source

The firmware of the M1K is based on the firmware overclock.net user qsxcv developed upon reverse engineering the PixArt 3366 sensor. He later used this firmware to make a wireless mouse that had lower input lag than any wired mouse from Logitech. See his thread on overclock.net for more information on this: A wireless mouse faster than Logitech's wired ones? Oh yes!

As did qsxcv with his firmware, we made our firmware open-source. See our GitHub repository.

8,000 Hertz

When you plug the M1K into your computer it will run with 1,000 Hertz which results in your PC getting new mouse data every 1.0 milliseconds. Thanks to the code of qsxcv the firmware of the M1K fetches new data from the sensor every 0.125 milliseconds. Put another way: internally the M1K runs at 8,000 Hertz. Only when used in conjunction with an overclocked Windows driver though can you actually use the M1K at 8,000 Hertz in Windows.

Using the M1K at 8,000 Hertz as opposed to 1,000 Hertz reduces input lag by 0.4375 milliseconds on average.

Compared to 500 Hertz a mouse running with 8,000 Hertz will be quicker by 0.9375 milliseconds on average.

See this thread on overclock.net for more information: USB mouse hard overclocking (2000 Hz+)

By the way: we see no reason for using the M1K at 500 Hertz. Modern gaming PCs have plenty of processing power for a 1,000 Hertz mouse. Hence, the M1K runs with 1,000 Hertz per default and does not offer the option to be downgraded to 500 Hertz.

For the switches qsxcv came up with a neat little trick to get even less input lag than you would have when polling the switches every 125 microseconds. The state of each switch are sampled continuously so that there is no delay due to reading a switch while it is bouncing.

Zero lag switch debouncing

Many so-called gaming mice have problems with accidental double clicks. And in order to prevent accidental double clicks, many gaming mice use their MCU to artificially delay each click, or the release of a click, by up to 40 milliseconds.

Delaying clicks is especially bad in FPS games. Just imagine each of your shots having an extra delay of 40 milliseconds. Just to put this into perspective: In many cases these 40 milliseconds are higher than the lag of your internet connection. The delayed release of a click is not as bad in FPS games. It is a problem in RTS games though, where you have to do quick and precise selection boxes.

The M1K uses a debouncing technique called the set/release latch method with which we can prevent accidental double clicks without introducing any delay to clicks or releases.

Using the set/release latch method is not exactly rocket science and not exactly expensive. This begs the question: why has it not been used up to now? Daniel Sauvageau, the author of an in-depth article on debouncing mouse switches, offers this explanation:

This is one more example of perfectly good theory not getting used in practice to save pennies per unit and also to perpetuate planned obsolescence. That is, sales would drop if you no longer needed a new mouse every two to four years as a result of glitchy buttons.

Installing a custom firmware on the M1K

Since our firmware is open-source, you can take it and adjust it any way you want. When you are done you can install your own firmware on the M1K with a program called DFU Programmer. See this guide for how to do that exactly.

Why does it make sense to write your own firmware? You can do trivial changes like setting the default Hertz of your mouse to something else than 1,000 Hertz. You could do more advanced changes as well. For example you could choose different CPI values for the x and y axis. Or maybe you find a way to further reduce the input lag of the M1K.

Up to you.

Zaunkoenig Newsletter

The Zaunkoenig M1K is the lighest gaming mouse in the world: it weighs just 23 grams. It is also the first carbon fiber gaming mouse and the first dedicated Fingertip Grip gaming mouse.