Lessons Learned Blog

As I also wrote in my last post about improving management skills, learning from mistakes of other people is something you can and should do.
In some companies you will find so called “lessons learned” databases where you can learn what mistakes other teams have made and how you can avoid them.
Lessons Learned is the blog Eric Ries where he writes about his experiences and mistakes he made while being CEO of several startups.

So … start reading and learning!

Improving your Management / Entrepreneur Skills

During the last years I learned a lot about what it means to run a business, there are on the one hand dww-desing.net and the PartyMe.de and on the other hand my internship at TRW.I found it really interesting not to focus only on the technology side but to see also the management side of a business and since I always want to learn, I applied the following strategies to improve my management and entrepreneur skills:

Learn from Mistakes!
There is an old saying “The Best Teachers Are Your Own Mistakes”. So if you run your own business from time to time take a break and evaluate the decision you have made and think about what could have happened if you would have done something different. But at least some times it is also possible to learn from mistakes of others. There are different ways to learn from mistakes that other people make, but the first thing you have to do is to realize the mistakes.If you for example are an intern in a company, you always can observe the actions of your superiors and ask yourself the question “What would I have done at her / his place?” Or if you realize that some decisions turned out to be bad, you should ask yourself “Why where the decision bad?” and “Which decision would have been better?”

Read, Read and Read!
It’s like all other things if you want to learn something read not only one but many books or blogs or magazines and do not only consume what you read but try to challenge it!

Take Classes!
For me being a student, it is very easy to attend a strategic management or technology management seminar at the university but if you are not a student you still may have the chance to visit some classes, at least a lot of the German universities you can enroll as a extra-mural student.

Merry Christmas!


Driver of Fingerprint-Reader broken after Windows Update

imageSomehow the Driver for the fingerprint-reader of my HP Compaq 6910p got broken by a recently Windows Update. 
One way to restore a broken driver is to restore Windows to a restore point. If you just want to restore the last driver version follow this instructions:

Start >
Control Panel >
Type in the search box "Device" >
Click Device Manager >
Click Personal identification devices > (Or any other device group)
Click Authentec ‘xxx’ > (Or any other device)
Go to tab Driver >
Click Roll back driver

My first workshop paper

I recently finished my bachelor thesis and will present a part of it as a short paper at the 13th International Workshop on Formal Methods for Industrial Critical Systems (FMICS) in L’Aquila, Italy.

Simulink Design Verifier vs. SPIN – A Comparative Case Study Florian Leitner and Stefan Leue

State Space Exploration, Matlab Simulink, SPIN, Automotive Software

An increasing number of industrial strength software design tools come along with verification tools that offer some property checking capabilities. On the other hand, there is a large number of general purpose model checking tools available. The question whether users of the industrial strength design tool preferably use the built-in state space exploration tool or a general purpose model checking tool arises quite naturally. Using the case study of an AUTOSAR compliant memory management module we compare the Simulink Design Verifier and the SPIN model checking tool in terms of their suitability to verify important correctness properties of this module. The comparison is both functional in that it analyzes the suitability to verify a set of basic system properties, and quantitative in comparing the computational efficiency of both tools.

HID USB Driver / Library for .Net / C#

Table of Contents

– Motivation

– The Human Interface Device Class

– USB Specific Stuff

– The HID USB Device Interface

– How to Integrate the Library into a Visual Studio Project

– How the HID USB Library works internal

– Where can I get the HID USB Library


We wanted to find a new solution to connect our Hardware to the PC via USB because the experience we made with FTDI Chips was not satisfying at all.

The USB controller of our choice was the Maxim MAX3420E that is connected to the microcontroller through a Serial Peripheral Interface (SPI).

The MAX3420E comes without any drivers or libraries you can use to “speak” with it.

This is the reason why I had to develop my own “driver”.

After a day of reading and googling I decided that the best an easiest way is to use the Human Interface Device Class (HID). The HID-Class is a generic device class which means that all devices in this class are supported by Microsoft Windows and there are already existing DLLs with functions that we can use.

The start point for the “driver” was an article I found in the Microsoft developer network: „Is That You? Writing Better Software for Cool USB Hardware” written by Scott Hanselman. (http://msdn.microsoft.com/coding4fun/someassemblyrequired/isthatyou/default.aspx). Scott’s software is based on the USBSharp Class.

Luckily the MAX3420E comes with a code sample that configures the controller as a Human Interface Device so we didn’t have much trouble to find out how to configure it as HID.

The Human Interface Device Class

As mentioned above the HID Class is a generic device class so the driver is integrated in the operating system which makes things easy. If a new HID device is plugged in there is no need of any driver installation. The functions to access and control a HID device are included in the Windows hid.dll which is located in the System32 folder.

If you do not know for sure if your device is a HID device you should have a look at this little application. It is a part of windows and you can run it with the start -> run “msinfo32.exe” command. Or under Windows Vista just press the Windows-Key Type msinfo32.exe and hit enter.

USB Specific Stuff

Identify your USB device

USB device are identified by their vendor and product id. Those IDs are consisting of a prefix (“vid_” for vendor id or “pid_” for product id) and a 4 digit HEX number. The MAX3420E for example has the vendor id vid_06ba and the product id pid_5346. Usually both values can be changed in the source code of the USB device (assumes that you have access to that code).

Package Size / Communication Speed

HID devices are communicating with the pc through so called hid reports. Those reports consist of 64 bytes of data. Each microsecond one report is send from pc to the USB device and vice versa. This means that theoretical a transfer rate of 64 Kbytes per second can be achieved.

The HID USB Driver Interface

The driver is written in C# and designed as a DLL, this has the benefit so it is very easy to integrate the drive into a new project. Just import the DLL or the project and you are finished.

I tried to keep the interface as simple as possible on the one hand and on the other hand to integrate as much functionality as possible.

At the moment it has the following functions:

USBInterface(String,String) constructor

This method initializes a new instance of the USBInterface class.



The vendor id of the USB device (e.g. vid_06ba)


The product id of the USB device (e.g. pid_5346)

USBInterface(String) constructor

This method initializes a new instance of the USBInterface class.



The vendor id of the USB device (e.g. vid_06ba).

Connect() method

This method establishes a connection to the USB device. You can only establish a connection to a device if you have used the construct with vendor AND product id. Otherwise it will connect to a device which has the same vendor id is specified, this means if more than one device with these vendor id is plugged in, you can’t be determine to which one you will connect.


False if any error occurs

Disconnect() method

Disconnects the device

getDeviceList() method

Returns a list of devices with the vendor id (or vendor and product id) specified in the constructor. This function is needed if you want to know how many (and which) devices with the specified vendor id are plugged in.


String list with device paths

write(Byte[]) method

This method writes the specified bytes to the USB device. If the array length exceeds 64, the array while be divided into several arrays with each containing 64 bytes. The 0-63 byte of the array is sent first, then the 64-127 byte and so on.



The bytes to send.


Returns true if all bytes have been written successfully

startRead() method

This method is used to activate the “reading-State”. If you execute this command a thread is started which listens to the USB device and waits for data.

stopRead() method

This method switches from “reading-State” into “idle-State”. By executing this command the read data thread is stopped and now data will be received.

enableUsbBufferEvent(EventHandler) method

By calling this method with an event handler (System.EventHandler) the add-event listener of the USB Buffer is enabled. Thus whenever a dataset is added to the buffer (and so received from the USB device) the event handler method will be called.



The event handler (System.EventHandler) method.

How to integrate the HID USB Library into a Visual Basic Project

There a two ways to integrate the HID USB Library into a Visual Studio project. One is to add the library project to your Visual Studio solution. The other way is to add a reference to the USBHIDDRIVER.dll in the visual basic project you want to use.

Add the library project to a Visual Studio 2005 solution

1. Open your Visual Studio solution. Go to “File > Add > Existing Project”

2. The following Dialog will open. Navigate to the USBHIDDRIVER.csproj and click open.

3. Right click on your Visual Studio project and click « Add Reference »

4. Select the „Projects“-tab. Then select the USBHIDDRIVER and click ok.

Add the USBHIDDRIVER.dll to a Visual Studio project

1. Right click on your Visual Studio project and click « Add Reference »

2. Select the „Browse”-tab. Then navigate to the USBHIDDRIVER.dll.dll and click ok.

Use the USBHIDDRIVER.dll with Visual Basic 6

The .Net runtime allows unmanaged COM aware clients (like Visual Basic 6 applications) to access .Net components through the COM interop and through the tools provided by the framework.

The USBHIDDRIVER.dll is a .NET assembly which can not be accessed by Visual Basic 6. Therefore we have to create a type library which can be used with Visual Basic 6. This can be done with the Tool RegAsm.exe that you will find in the directory of your .Net framework installation.

Create a .bat file in the directory of the USBHIDDRIVER.dll and write the following command into it. Then run the bat file.

“C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe” USBHIDDRIVER.dll.dll /tlb: USBHIDDRIVER.dll.tlb

Now you have to copy both the dll and the tlb file in the same directory as the application which is consuming it.


How to use the HID USB Library

Let’s say you want to communicate with an USB device that has the vendor id vid_06ba and multiple products id.

So the first thing you may want to have is a list of all devices connected to the pc which have the specified vendor id. To do this just make a new instance of the USBInterface class with only the vendor id as parameter. Then call the getDeviceList-Mehtod and you will receive a list of the devices that are connected.

USBHIDDRIVER.USBInterface usb = new USBInterface(“vid_06ba”);

String[] list = usbI.getDeviceList();

For communicating with the device make a new instance of the USBInterface class with the vector id and the product id as parameter. After that, you can call the connect-method and a connection will be established.

USBHIDDRIVER.USBInterface usb = new USBInterface(“vid_0b6a”, “pid_5346”);


Once your device is connected you can read or write data. To write data just call the write method with an array of bytes you want to send as parameter.

For reading you have to options: first without the USB buffer event and second with USB buffer event.

If the event is enabled, the event handler method will be called when a new dataset is received.

Otherwise you can process the data with a timer or something like this.


usb.enableUsbBufferEvent(new System.EventHandler(myEventCacher));





How the HID USB Library works internal

The library is based on the USBSharp class that imports all needed methods from the kernel32.dll and hid.dll. The HIDUSBDevice class wraps those methods and handles the read thread. The USBInterface is the main interface, which is accessible from outside the dll. In the USBInterface class exists a object of the ListWithEvent, which is basically a ArrayList with the bonus that an event is fired when a new dataset is added. Last but not least in the HidApiDeclaration class you will find some declarations needed for the whole hid-thing.

Where can I get the HID USB Library?

You can download the library here.