Programming a Tipro board on-the-fly like a Cherry G80-2100

intealls

20 Aug 2011, 14:05

The RS232 connection won't power the device, if only RS232 is to be used, PS/2 needs to be connected as well just to power it. I don't know if the LCD modules need some additional power source besides PS/2, but it is likely.

I'm tempted to buy one of these damn cables just to get to know just what the hell it does. Only problem is that it's more expensive than what I paid for all of the devices together (thx 7bit :)), so it's not really all that tempting.

User avatar
7bit

20 Aug 2011, 19:54

Here is my current layout.

As your can see, I need some more keys from Round 4.

Also, I still have to find suitable scan codes.

Some get blocked by the system, once the scancodes had been assigned a key code using setkeycodes(8).
Attachments
tipro_001.png
tipro_001.png (45.53 KiB) Viewed 10742 times

User avatar
Minskleip

20 Aug 2011, 20:41

So cool! A lisp keyboard! The parens are misplaced though ;)

I want to make this:
lisp-tipro.png
lisp-tipro.png (64.43 KiB) Viewed 10737 times

User avatar
7bit

20 Aug 2011, 21:20

Minskleip wrote:So cool! A lisp keyboard! The parens are misplaced though ;)
It is a mess-up of the Symbolics-, Sun-, and IBM-cultures.

I'm currently writing a script to generate the mtx files from something like this:

Code: Select all

8x4
?   |   |?     | 
?   |   |?     | 
F1  |F2 |Stop  |Eject
F3  |F4 |Cut   |Paste
F5  |F6 |Mark  |Undo
F7  |F8 |Select|Redo
F9  |F10|Begin |End
F11 |F12|Prior |Next

122
F13 |     |F14 |     |F15 |    |F16 |    |F17 |    |F18 |    |F19 |    |F20  |   
ESC |     |?   |     |?   |    |?   |    |F21 |    |F22 |    |F23 |    |F24  |   
?   |!    |@   |pound|euro|yen |``  |`   |_   |'   |''  |<   |>   |vert|{    |}
:   |1    |2   |3    |4   |5   |6   |7   |8   |9   |0   |-   |=   |\   |(    |)
TAB |Q    |W   |E    |R   |T   |Y   |U   |I   |O   |P   |[   |]   |BS  |BEGIN
Comp|Symb |A   |S    |D   |F   |G   |H   |J   |K   |L   |;   |'   |CR  |LF   |END
SHL |ShWrd|Z   |X    |C   |V   |B   |N   |M   |,   |.   |/   |SHR |UP  |Page
ALTL|HYPL |SUPL|CTRL |SPACE              |CTRR|SUPR|HYPR|META|LEFT|DOWN|RIGHT

8x4
?   |    |?   | 
NUM |    |CAPS| 
^   |%   |#   |$
~   |n/  |n*  |n-
n7  |n8  |n9  |n+
n4  |n5  |n6  |&
n1  |n2  |n3  |n=
n0  |DEL |n.  |?
Last edited by 7bit on 20 Aug 2011, 21:48, edited 1 time in total.

User avatar
Minskleip

20 Aug 2011, 21:30

Is that the source for your keyboard picture?

User avatar
7bit

20 Aug 2011, 21:48

Minskleip wrote:Is that the source for your keyboard picture?
No, it is the source to generate the mtx files for ChangeMe.exe :

Code: Select all

#!/usr/bin/perl -w
# (C) 2011 by 7bit (deskthority.net)
# Licence: GPL 2 or 3 at your choice (http://www.gnu.org/licenses/gpl.html)

my @codetable;

sub readcodetable
{
    my $mycodefile=shift;
    @codetable=();
    open($read, "<", $mycodefile) or die "error reading from $mycodefile . $!";
    while(<$read>)
    {
        my $line  = $_;
        $line =~ s/\n$//;
	if($line =~ /^([^[:space:]]+)([[:space:]]+)([^[:space:]]+)([[:space:]]*)([[:ascii:]]*)$/)
    	{
	    $line =~ s/^([^[:space:]]+)([[:space:]]+)([^[:space:]]+)([[:space:]]*)([[:ascii:]]*)$/$1\|$3/;
	    push(@codetable,$line);
	}
    }
}

sub lookupscancode
{
    my $key = shift;

    foreach $line (@codetable)
    {
	@codes = split(/\|/,$line);
	
	if($codes[0] eq $key)
	{
	    if($codes[1] =~ /^E0/)
	    {
		$codes[1] =~ s/^([[:alnum:]]{2})([[:alnum:]]{2})$/\$$1,\$$2,\$$1,\$F0,\$$2/;
	    }
	    else
	    {
		$codes[1] =~ s/^([[:alnum:]]{2})$/\$$1,\$F0,\$$1/;
	    }
	    return "$codes[1]";
	}
    }
}

sub outline
{
    my $countv = shift;
    my $counth = shift;
    my $key    = shift;

    my $output="error";
    if($countv==1) { $output = "A"; }
    if($countv==2) { $output = "B"; }
    if($countv==3) { $output = "C"; }
    if($countv==4) { $output = "D"; }
    if($countv==5) { $output = "E"; }
    if($countv==6) { $output = "F"; }
    if($countv==7) { $output = "G"; }
    if($countv==8) { $output = "H"; }

    my $scancode="";

    if(!($key eq ""))
    {
	$scancode = lookupscancode($key);
    }
    return "$output$counth/S/CT/A++++/C----/Dcccc/~$scancode~~~~~~~~";
}

sub main
{
    my $myinput="";
    my $myoutput="";
    my $mycodetable="";
    my $flag=0;
    foreach $arg (@ARGV)
    {
	if($flag)
	{
	    $mycodetable = $arg;
	}
	else
	{
	    $myinput=$arg;
	    $myoutput=$arg;
	    $myoutput =~ s/[.]([^.]+)$//;
	}
	$flag++;
    }
    if($flag!=2)
    {
	print "./tipro.pl layout codetable\n\n";
	print "tipro.pl takes 2 arguments. The first argument is the layout file and\n";
	print "the 2nd argument is the code table\n";
	print "Output is written to layout_n_type.mtx, where n is the number of thr module in\n";
	print "layout starting from 1, and type is either 8x4, 8x8, 8x16, 122, or 122up.\n\n";
    }
    readcodetable($mycodetable);
    
    open($read, "<", $myinput) or die "error reading from $myinput . $!";

    my $countv=0;

    my $maxv=0;	
    my $maxh=0;
    my $qwerty=0;

    my $modulecount=0;

    my $write;

    while(<$read>)
    {
	my $line  = $_;
	$line =~ s/\n$//;
	$line =~ s/[[:space:]]//g;

	if($line eq "") { next; }

	if(!($line =~ /[|]/))
	{
	    my @keys = split(/x/,$line);

	    if(@keys==2)
	    {
		$maxv=$keys[0];
		$maxh=$keys[1];
		$qwerty=0;
	    }
	    elsif($keys[0] eq "122")
	    {
		$maxv=8;	
		$maxh=16;
		$qwerty=1;
	    }
	    elsif($keys[0] eq "122up")
	    {
		$maxv=8;	
		$maxh=16;
		$qwerty=2;
	    }
	    if($modulecount>0)
	    {
		close($write);
	    }
	    $modulecount++;
	    my $myoutfile = $myoutput;
	    if(!$qwerty)
	    {
		$myoutfile = $myoutput . "_" . $modulecount . "_" . $maxv . "x" . $maxh . ".mtx";
	    }
	    else
	    {
		$myoutfile = $myoutput . "_" . $modulecount . "_" . $keys[0] . ".mtx";
	    }
	    open($write, ">", $myoutfile) or die "error writing to $myoutfile . $!";
	    print "writing output to $myoutfile\n";
	    $countv=0;
	    next;
	}

	my $counth=0;
	$countv++;
	if($countv>$maxv) { last;}

	my @keys = split(/\|/,$line);
	foreach $key (@keys)
	{
	    $counth++;
	    if($counth>$maxh) { last; }

	    my $resline = outline($countv,$counth,$key);
	    print $write "$resline\n";
	}
	while($counth<$maxh)
	{
	    $counth++;
	    my $resline = outline($countv,$counth,"");
	    print $write "$resline\n";
	}
    }
}

main();

# eof
The layout file has got the following format:
line 1: size of the module (height x width).
other lines (up to 8): keys separated by '|'

The codetable file has got the following format:
keyname keycode

'keyname' is a name without spaces or '|' .
The keynames are the entries in the layoutfile.

'keycode' is the makecode of a set 2 scancode.

Example:

Code: Select all

ESC    76
:      17 
1      16
2      1E
3      26
4      25
5      2E
6      36
7      3D
8      3E
9      46
0      45
-      4E
=      55
BS     66
TAB    0D
Q      15
W      1D
E      24
R      2D
T      2C
Y      35
U      3C
I      43
O      44
P      4D
...
SUPR   E027
HYPL   61
HYPR   13  
META   E02F
Stop   E03B
Eject  E01A
Cut    19  
Paste  5F
Mark   39
Undo   E03D 
Select 53  
Redo   50  
Begin  E06C
End    E069
Prior  E07D
Next   E07A
...


intealls

22 Aug 2011, 17:04

I now know why I was unable to get the cable/device working with RS232. If I would have read the manual more closely from the get-go, I would have saved myself a lot of time. The KM032MAA does not support RS232 as the main communications interface. :mrgreen:

User avatar
Minskleip

22 Aug 2011, 19:23

Perl :) Can you make layers, or do you have to tweak the output afterwards?

User avatar
7bit

22 Aug 2011, 22:45

Minskleip wrote:Perl :) Can you make layers, or do you have to tweak the output afterwards?
Currently, it is only suitable for 1 layer.

I think it would be best to have separate layouts for additional layers.

If there where a 5x4 Tipro, it would look like this:

Code: Select all

5x4:1
N|/|*|-
7|8|9|+
4|5|6|&
1|2|3|=
0| |.|e

5x4:2
N|/|*|-
B|U|P|+
L|F|R|&
E|D|N|=
i| |d|e

...
The :1 and :2 would make sure that the specified layer is written.

Required changes are:

- make sure that the layer number is read.

- write into an array instead of the output file.

- write output file opnce we reached the next module, indicated by reaching max+modules before or by a module number <= what we had before, or by a different type of module.

The switch-layer button must still be done manually.

User avatar
7bit

24 Aug 2011, 14:41

OK, just uploaded my layout to my Tipro and everything works fine!

When you want to enter codes manually, switch to Custom codes and enter scancode set 2 codes in the following form:

F13:
$1F,$F0,$1F

and
Cut:
$E0,$43,$E0,$F0,$43

As you can see, the extension code prefix ($E0) comes before the break code prefix ($F0).

There are enough scancodes avallable to make sure that every single key producesa distinctive code.

The remaining problem is to find a way to upload these settings via Linux.

User avatar
Minskleip

24 Aug 2011, 14:50

That's still not for the 32 key modules right?

User avatar
7bit

24 Aug 2011, 15:21

Minskleip wrote:That's still not for the 32 key modules right?
No.

If I enter something like $1F,$F0,$1F they send only the $1F part, as I remember.

However, you can program them with another keyboard, so you can chain at least 3 together without any trouble. The only issue is when you want to use them along with a keyboard.

If you have a TM-KMQ-128A, or similar, then you can connect the MID-KM032 via the Tipro bus and disconnect their controller.

User avatar
Minskleip

24 Aug 2011, 15:59

I still can't believe how weird that is! Where can I get a newer controller so I can utilise the powers of the full scan code set and get the layer LEDs? :D

One more thing: if I first connect one module to the computer and program it, then chain together the programmed module with a few others using the bus connector and program all of them, will the first I programmed still have the first programming in its controller so that I can use it standalone (or with a regular keyboard) later without reprogramming it? (in my case the difference in the two programmings would be esc is grave and vice versa)

User avatar
kbdfr
The Tiproman

24 Aug 2011, 19:14

Minskleip wrote:(...)
One more thing: if I first connect one module to the computer and program it, then chain together the programmed module with a few others using the bus connector and program all of them, will the first I programmed still have the first programming in its controller so that I can use it standalone (or with a regular keyboard) later without reprogramming it? (in my case the difference in the two programmings would be esc is grave and vice versa)
Whenever you program a keyboard, you overwrite everything that was previously programmed in it, no matter if it's used as a standalone keyboard or as part of a multiple board consisting of more than one module. The keyboard does not contain several layouts, one for standalone use and one for another configuration, but always only one at a time.

So you have to reprogram a keyboard every time you want to change its layout. But of course that should not be a problem as you can save as many configuration files as you like and just have to upload the one to be used next.

By the way, when you program units connected via bus connector, the software recognises their physical configuration and if you try to upload a layout which is different from what you actually have on your desk, you get a warning and the software asks you if you want to upload anyway. Answering "yes" leads to quite interesting results :lol:

User avatar
Minskleip

24 Aug 2011, 19:24

Thanks! The reason I ask is that 7bit disconnected the controller from his modules and bus-connects them to his larger Tipro, so it could just happen that the layout/configuration was not stored on the device itself/its controller, but on the master device!

User avatar
7bit

24 Aug 2011, 20:04

Now, all modifiers don't work anymore. I should have tested this.

The reason is that the Tipro people were too stupid to make sure one can enter a breack and a make code such that the controller knows what to do. Instead I must now enter these USB codes for all modifiers and use scancode set 2 only for any other key which should never ever be a modifer key.

So, more work to do ...
kbdfr wrote:...
So you have to reprogram a keyboard every time you want to change its layout. But of course that should not be a problem as you can save as many configuration files as you like and just have to upload the one to be used next.
... except I've got to get my keyboard to the office to do that ...
kbdfr wrote: By the way, when you program units connected via bus connector, the software recognises their physical configuration and if you try to upload a layout which is different from what you actually have on your desk, you get a warning and the software asks you if you want to upload anyway. Answering "yes" leads to quite interesting results :lol:
I should have tested this today: Is it possible to program it without anything connected except the controller? Would avoid to bring the whole keyboard again.

User avatar
kbdfr
The Tiproman

24 Aug 2011, 20:31

7bit wrote:(...)
I should have tested this today: Is it possible to program it without anything connected except the controller? Would avoid to bring the whole keyboard again.
If by "program" you mean "upload", it would be logical to assume that it is not the case and that the program is stored in the keyboard itself and not in the controller, because you can program several keyboards (when connected via bus connector) with only one controller.
If by "program" you mean "configuring a ChangeMe file" using a normal keyboard plugged into the PS/2 socket of the Tipro controller, I see no reason why this should not work. But of course that would be silly, because you don't even need a Tipro keyboard to use the Tipro ChangeMe software.

I'm not sure, but... can't you just "virtually" configure a keyboard, save the file on a USB stick which you take to whatever place your keyboard is and then upload it to the keyboard?

User avatar
7bit

24 Aug 2011, 20:59

kbdfr wrote:
7bit wrote:(...)
I should have tested this today: Is it possible to program it without anything connected except the controller? Would avoid to bring the whole keyboard again.
If by "program" you mean "upload", it would be logical to assume that it is not the case and that the program is stored in the keyboard itself and not in the controller, because you can program several keyboards (when connected via bus connector) with only one controller.
If by "program" you mean "configuring a ChangeMe file" using a normal keyboard plugged into the PS/2 socket of the Tipro controller, I see no reason why this should not work. But of course that would be silly, because you don't even need a Tipro keyboard to use the Tipro ChangeMe software.

I'm not sure, but... can't you just "virtually" configure a keyboard, save the file on a USB stick which you take to whatever place your keyboard is and then upload it to the keyboard?
Programming the keyboard means for me to upload the file.

The idea would be to bring just the controller module and upload the new configuration to that module against all warnings.

I'm quite sure the configuration is stored in the controller unit and not somewhere on the keyboard PCB. At leasst I can change out the 8x4 modules without affecting the configuration.

User avatar
Lenny_Nero

07 Nov 2011, 07:12

Minskleip wrote:kbdfr: do you have an older version of Changeme?
I thought I had posted this in this thread before...

I have older versions of all the Tipro software (DOS win9x 2k etc.),
I cant remember the versions off hand but the CD's are from 2001.
When I get to them I will upload somewhere if still wanted.

User avatar
7bit

29 Dec 2011, 20:54

Because I'm just cleaning a 122 key Tipro module (FUTURO, TMC KMCV-C15-021) here some hints how to open it:

Turn it upside-down and make sure it is lying on a smooth surface.

You need a thin cross-point screwdriver.

Undo all screws.

Now you can remove the side-covers.

Turn it around another time to make sure you can remove the key caps.

To open it, you need at least to remove the key caps around the edges.

Now take a flat screwdriver and cover its head with isolation tape to make sure you don't scratch the surface of the mounting plate!

There are some clips at the bottom, top and sides. I you clicked them open, they hook in again at the PCB, so some of these you need to click open a 2nd time!

There are 2 size-clipe which mmust be opened from the sides (where the side-cover where).
Now, the whole think should fall apart.

If not, please contact one of the three Tipro experts in the forum.
:ugeek:

User avatar
Minskleip

14 Jan 2012, 20:14

I got the keyboards from 7bit! However Changeme doesn't recognise the keyboard properly. It's a TMC-KMCV-C15-112 USB with 122 keys, but is recognised as a TM-KMQ-128A (120 keys). Two keys are missing, and I can't get to them! The two switches under the 'caps lock' to the left of 'A', and the two switches under 'enter' are each recognised as one custom key.

Is this a fault with the usb controller?

User avatar
7bit

16 Jan 2012, 14:46

Minskleip wrote:I got the keyboards from 7bit! However Changeme doesn't recognise the keyboard properly. It's a TMC-KMCV-C15-112 USB with 122 keys, but is recognised as a TM-KMQ-128A (120 keys). Two keys are missing, and I can't get to them! The two switches under the 'caps lock' to the left of 'A', and the two switches under 'enter' are each recognised as one custom key.

Is this a fault with the usb controller?
Hi Minskleip,

great to read that the they arrived!

It is normal that it is recognised as TM-KMQ-128A and the 2 keys are not working on all of these keyboards. The only solution seems to solder them to some unused switch in the upper rows.

There is no difference between USB and PS/2 except that the USB version can only deliver USB codes, wile the PS/2 can send scancode type 1 or 2 or so ...

User avatar
Minskleip

16 Jan 2012, 18:11

Coolio, thank you! With my symmetric stagger layout it doesn't really matter. I put some less used macros there.

At least it's symmetric - the second most switch to the side is dead.

And man it's awkward to type on a regular board now after symmetry all day! Looks like I have to clean one more for use at home ;)

Edit: do you know of a way to use menu as hyper and scrolllock as compose on linux, without using xmodmap?

User avatar
7bit

16 Jan 2012, 19:26

Minskleip wrote:Coolio, thank you! With my symmetric stagger layout it doesn't really matter. I put some less used macros there.

At least it's symmetric - the second most switch to the side is dead.

And man it's awkward to type on a regular board now after symmetry all day! Looks like I have to clean one more for use at home ;)

Edit: do you know of a way to use menu as hyper and scrolllock as compose on linux, without using xmodmap?
Yes:
in /usr/share/X11/xkb you find all you need:

1. make a backup.
2. edit symbols/pc
This is how the section about the modifiers looks like (my Tipro version):

Code: Select all

   key <NMLK> {	[ Num_Lock, Pointer_EnableKeys		]	};
    key <FK16> {  	[ Caps_Lock	]	};

    key <LFSH> {	[ Shift_L	]	};
    key <RTSH> {	[ Shift_R	]	}; // must be Shift_R
    	// Shift_R can't be re-mapped to C-s in emacs. (2010-08-14)

    key <LSGT> {	[ XF86WWW	]	}; // SHIFT WORD


    key <LALT> {	[ Control_L	]	};
    key <RALT> {	[ Control_R	]	};

    key <PAUS> {        [ Multi_key   ]       };
//  key <FK11> {	[ Meta_L      ]       }; // mapped to H-M in emacs

    key <LWIN> {        [ Super_L     ]       };
    key <RWIN> {        [ Super_R     ]       }; // mapped to H-s in emacs

    key <CAPS> {	[ Hyper_L     ]       }; // Symbol key
    key <HKTG> {	[ Hyper_L     ]       };
    key <HENK> {	[ Hyper_R     ]       }; // mapped to A-s in emacs

    key <LCTL> {	[ Alt_L	      ]	      };
//  key <RCTL> {	[ Alt_R       ]	      }; // mapped to A-H in emacs
    key <RCTL> {	[ Meta_R      ]	      };

    // begin modifier mappings
    modifier_map Shift  { Shift_L, Shift_R };
    modifier_map Lock   { Caps_Lock, ISO_Lock };
    modifier_map Control{ Control_L, Control_R };

    //  Fake keys for virtual<->real modifiers mapping 
    key <LVL3> {	[ ISO_Level3_Shift	]	};
    key <MDSW> {	[ Mode_switch 		]	};
    // modifier_map Mod5   { <LVL3>, <MDSW> };

    modifier_map Mod2   { Num_Lock };
    // no Scroll_Lock, Mod3 is needed for Hyper (7bit)

    key <ALT>  {	[ NoSymbol, Alt_L	]	};
    modifier_map Mod1   { <ALT> };

    key <HYPR> {	[ NoSymbol, Hyper_L	]	};
    modifier_map Mod3   { <HYPR> };

    key <SUPR> {	[ NoSymbol, Super_L	]	};
    modifier_map Mod4   { <SUPR> };

    key <META> {	[ NoSymbol, Meta_L	]	};
    modifier_map Mod5   { <META> };
The word after 'key' between < and > is the key code.

You can look these up in:
/usr/share/X11/xkb/keycodes/evdev

compose is the multi-key:

key <SCLK> { [ Multi_key ] };

User avatar
Minskleip

16 Jan 2012, 21:06

Thank you 7bit. I didn't get hyper to work properly in Stumpwm (I think I got it to work with xmodmap yesterday though ...), but Emacs got it. I have to add support for compose in st (the terminal emulator I use. It worked fine in xterm).

User avatar
Icarium

27 Jan 2012, 21:27

Hm....so I have just wired a PS/2 cable...cut two off of old keyboards and wired them symmetrically. I can use the Tipro now but I can't seem to program it. The software says no keyboards found. Any suggestions? Did I miss something?

User avatar
kbdfr
The Tiproman

28 Jan 2012, 06:55

kbdfr wrote:(stolen picture)
Image

Make your own Tipro cable using a male/male PS/2 cable: carefully and completely remove the small plastic tongue between the pins on one end of the cable. The plug will now fit into the 8-pin socket of the keyboard (right side of the above picture, left side of course when sitting in front of the keyboard), connect the other end of the cable with the PS/2 socket of your computer, that's it.
The other socket of the Tipro keyboard is where you plug your "normal" keyboard into.

User avatar
Icarium

06 Feb 2012, 00:40

kbdfr wrote:
CeeSA wrote: [UMLAUTE]
if i put 'ö' in the second Layer i don't be able to get an upper case 'Ö'
shift + L2 + o - did not produce 'Ö' only 'ö'
any suggestions
I think there is a workaround, but the software says it won't work with a controller version prior to 4.00.00 (check version with Keyboard -> Info).
Have you found any remedies for this?

User avatar
kbdfr
The Tiproman

08 Feb 2012, 11:27

Icarium wrote:
kbdfr wrote:
CeeSA wrote: [UMLAUTE]
if i put 'ö' in the second Layer i don't be able to get an upper case 'Ö'
shift + L2 + o - did not produce 'Ö' only 'ö'
any suggestions
I think there is a workaround, but the software says it won't work with a controller version prior to 4.00.00 (check version with Keyboard -> Info).
Have you found any remedies for this?
Use S2 (shift to layer 2 = temporary switching to layer 2) instead of L2 (lock to layer 2 = permanent switching to layer 2).
If it still doesn't work, reverse the pressing sequence of shift and S2.
If it still doesn't work, try using the right instead of the left shift key.
And please report.

User avatar
Icarium

08 Feb 2012, 11:32

Okay, I have always been using "shift to layer" instead of lock to layer. I have tried alternating the sequence, one sequence gives the lowercase letter the other gets the shift key stuck. I have not tried the right shift key yet, will report later.

Post Reply

Return to “Workshop”