Review of the Velleman K8000 Parallel port interface board.
( 9th march 2002 )
The K8000 is sold in kit form and can be bought from Maplin's in the
UK.
The K8000 is perfect for the hobbyist,student or scientist.
Each K8000 board has:
16 Configurable digital inputs or outputs (opto-isolated).
8 Digital to Analogue converters (DAC) with 6Bit resolution
1 High Precision DAC with 8Bit resolution.
4 Analogue-to-Digital converters 8Bit resolution
and up to 4 boards can be daisy chained.
The K8000 is supplied with software examples.
Programming languages include
C, Pascal/Delphi 1, QBasic and VB4.
Note for VB4 and above and Delphi 2 and above you have to use the provided
inpout32.dll
There are now some NT/W2K/XP examples.
The source code for the dll is not provided, but the source can
be found in Jan Axelson's book "Parallel Port Complete" pub.
Lakeview Research. Or the Delphi/ASM source can be found on
JA's web site.
There are several sites out there, where people are starting to utilize the
K8000 in Linux:
http://struyve.mine.nu:8080/pageloader.pl?block=k8000
http://home.wanadoo.nl/hihihi/k8000-libs.html
http://k8housealarm.sourceforge.net/
http://www.velleman-kit.com/other.asp
I thought it would be a good idea to get the K8000 working
in Linux using Borland's Kylix. Hoping that the dll and ASM code
would port straight over into a so library. No such luck, unfortunately!
I've had some success, and hopefully this will be of some use to
you, using the libprtio.so.1 which you can downloaded from
http://users.netonecom.net/~bbcat/Kylix.shtml
This is also a great source of info about parallel port programming for Linux.
The library comes inside a rpm and installed without a hitch on my machine.
Note this site also provides a very nice Kylix component designed for AVR stuff
but it can be used with the K8000.
I've not used the component here because I wanted to make the Kylix unit as
portable as possible. There are just 5 calls to the libprtio.so.1, via openport,
closeport, readstatus, readcontrol and writecontrol functions.
I then proceeded to port the VB code supplied with the k8000 into Pascal.
Create and save a new project with Kylix (or Delphi)
copy the i2cport.pas into the same directory as your project
and include the i2cport into the uses statement then
drag on a button onto a form and add the following code:
procedure TForm1.Button1Click(Sender: TObject);
begin
testrunninglights;
end;
I also ported the running light example to test the unit.
i2cport.pas source code here
I use SUSE 7.1 professional with Linux kernel 2.4 and before I can open the
Parallel port I need to load the parport_pc module.
Check your config with
>lsmod
to load
>modprobe parport_pc
(You might want to autoload yours)
Then you are ready to use Kylix and the K8000. I haven't fully finished the port over
only the 16 opto-isolated inputs/outputs are catered for.
The DAC and ADDA functions have not yet been added because I blew up my ADDA chip with a
bad experiment, but they shouldn't be any trouble if you fancy porting them yourself.
If you fancy making your own so library to call from Kylix then there are several good C examples
out there which you might be able to utilize. (How to compile a library with gcc
http://www-106.ibm.com/developerworks/library/l-shobj/ )
You have to get permission to read or write to the parallel
port in Linux using ioperm and there are special compiler switches needed to compile
the ASM with gcc. This is the best source of information I have found:
http://www.ibiblio.org/pub/Linux/docs/HOWTO/mini/other-formats/html_single/IO-Port-Programming.html
Fantastic source of Parallel port info.
http://www.lvr.com/parport.htm
[Home]
[Mechanics]
[Welding]
[Software]
[CAD]
[Math]