Home  | Contact

Velleman K8055D board
The K8055D under Cygwin

www.boks.com

Cygwin

Cygwin is a collection of programmer tools that create a Linux look-and-feel environment on Microsoft Windows. It is great for developing or porting Unix software to Windows without having to resort to a complete rebuild of the code.

When teaching software programming (like I do), Cygwin gives me a neat and clean set-up to learn the basics of C programming. Previously we would use Borland C++ Builder, but the students were often lost in the complexity of the VCL graphical library and didn't grasp the basics of what C programming is about.

Cygwin is maintained by the same people that give you Red Hat and Fedora Linux.

Cygwin can be obtained from the cygwin web-site.

Velleman K8055D

The K8055D (this is the link to Velleman) is a spiffy USB connected board that provides easy access to various analog and digital I/O. It is ideal for teaching students the basics of low-level, hardware oriented programming without all the pitfalls that normally abound.

K8055D

Using the K8055D with the Gnu compiler under Cygwin

Unfortunately Velleman does not cater for those who use Cygwin and the Gnu C compiler. The import library that Velleman provides is unfortunately in OMF format, which gcc does not understand. The supplied dynamic library K8055D.dll , is stripped and cannot easily be employed to generate your own import library.

The alternative is to load the Velleman functions from the library during run-time. This involves obtaining pointers to the functions, after the library has been loaded dynamically.

In order to facilitate using this approach, I wrote a C++ Class wrapper library that handles all administrative work. The Velleman functions can accessed as public members of this Velleman Gnu Class.

The Class can be downloaded here.  The class is available in the package, but if you want, you can compile the class yourself  using the Makefile  - make sure that you set the TARGET  (UITVOERBAARBESTAND) .

After having downloaded and untarred the library, log in as Administrator and make sure that :
You can now compile your K8055D code using g++ by including the dynamic library in your compile command: 

g++ -I <location of headers> -L/usr/lib/w32api -o <exe name> <program source> -lc -lK8055D -lk8055d _cygwin

Please be aware that even if you only write C code, you still need to invoke the g++ compiler in order to use the dll.