Be warned, this is going to take a while. Also, before you start,
make sure you have all the tools needed in later steps. Most
importantly you will need a PIC programmer like a PICKIT3.
Converting a K8055 or K8055N card to Open8055 is best done in
several smaller steps. In the first 3 step you install software
on the PC that can communicate with all three card types
and test it with your original, functioning card. The following
steps then convert the card to Open8055 and use the functioning
PC software to test if that worked.
One of the problems with a project like Open8055 is the number of
moving parts. There is (eventually) a hardware modification,
loading new firmware into a brand new PIC, changing libraries
and finally changing application code to use those new libraries.
Only if each single part works, the overall change will succeed.
One single piece not working correctly, and the usual symptom
(users report) is "doesn't work". Well, "doesn't work", while
accurate, doesn't help much in pinpointing the problem. Therefore let
us do the transition step by step so that if something goes wrong,
we know immediately which part "didn't work".
If any of the steps "doesn't work", please stop and contact me
on the
Velleman Forum in
the "Soldering kits" section. Do not assume that it will magically
start working after more step(s).
First install libusb on your system. The exact command to do that
depends on the OS and package/ports management system, you are using.
Some systems (like FreeBSD) have the libusb library already included
in the base system. If your system does not, please use your
usual package management tool to install libusb.
Next download the pylibusb module from
http://github.com/strawlab/pylibusb.
If you are familiar with GIT, then by all means clone the
repository and work from there. If not, there is a
button on the far right. Unpack that archive instead.
Change into the resulting ./pylibusb/ directory and execute the
example.py script there with the command
That "RuntimeError: Cannot find device.""
at the end is perfectly fine because you most
probably don't have that exact mouse device, the example.py script is
based on. What you want to see is some idVendor, idProduct pairs
of installed USB devices. They will look different on your system,
but any output like that will tell you that pylibusb is going to work
on your system.
To install this as a site-module on your system, run the command
After cloning/unpacking the Open8055 repository, cd to
./open8055/pyopen8055 and test if the example.py script in there
can access your existing K8055/K8055N card with address 0.
Use the command
sudo python ./example.py
The output of the program should look something like this:
DEBUG: ('pyopen8055.__init__("card0")',)
DEBUG: ('_libusb_io.__init__("card0")',)
DEBUG: (' card_number = 0',)
DEBUG: (' idVendor: 0x10cf idProduct 0x5500',)
DEBUG: (" found device ''",)
DEBUG: (' attempting to switch to K8055N protocol',)
DEBUG: (' sending SET_PROTO',)
DEBUG: (' reading reply',)
DEBUG: (' reply card_id=11',)
DEBUG: (' reply card_id=21',)
DEBUG: (' successfully switched to K8055N protocol',)
DEBUG: (' card0: card_type = K8055N',)
card0 of type 'K8055N' opened
DIGITAL_OUT: 0
ANALOG_OUT: (0, 0)
IN_1: False
A_1: 0
====================
press digital input 5 to end example
====================
DIGITAL: 0
COUNTER_1: 0
COUNTER_2: 0
ANALOG_1: 0
ANALOG_2: 0
The digital outputs will show a pattern where outputs 1, 3, 5 and 7
are on, the others are off.
At this point, the program is in a loop. In this loop it will:
Print changes to the states of any digital input, counter 1/2
or analog input.
Reflect the setting of analog input A1 on output PWM1 and
A2 -> PWM2 respectively.
Terminate when digital input I5 is pressed, setting all outputs
back to off/0.
If that works it is time to install the module with the command
sudo python ./setup.py install
You now have access to the K8055/K8055N card using Python.
The older K8055 card needs two small and rather simple modifications.
The resistor R35 needs to be removed. This resistor is the
"USB Low Speed" pull-up resistor. The Open8055 communicates with
"USB Full Speed", that the PIC18 devices are capable of. R35 is
located under "IC3" next to the bridge marked "J".
The 6 MHz crystal to be replaced with a 4 MHz one.
The bootloader provided activates when card address 3 is selected
(SK5 and SK6 open). So if you connect the card with both jumpers
removed, it will connect as a "Microchip HID boot loader", instead
of an Open8055 card. This is indicated by the card by constantly
flashing LD1 and LD2.
The PC side bootloader program is found in the directory
The program is very simple. There are 3 buttons at the top. One
for opening the .HEX file with the firmware, one for uploading
it into the PIC and one for resetting the PIC. You will use them
in exactly that order and have the jumpers SK5 and SK6 put back
(for card address 0) before doing the reset.
At this point the card should be connected as "Velleman Open8055".