Is remapping a USB keyboard using Teensy possible?

RC-1140 wrote:That's apparently an USB Tipro Controller board. I wish I had an USB one too. I only have two PS/2 ones.

Since I'm from Tiproland, I can get you some USB ones ;)
Half-Saint
User avatar

Unread post24 Jun 2012, 21:00

User avatar
X
Half-Saint
 
Posts: 1800
Joined: 20 Feb 2011, 10:24
Location: Slovenia, Europe
Main keyboard: Raptor Gaming K1
Main mouse: Logitech G5 Mk.2
Favorite switch: Cherry MX Blue
Club member: -
 
I added USB to USB converter in my keyboard firmware repository.
See this post. http://geekhack.org/index.php?topic=330 ... #msg653549

Image

My Sparkfun Host Shield is obsolete and incompatible with Leonardo, this needed messy cables to connect with Leonardo. Of course Circuit@Home Shield doesn't need this messy cables, it can be stacked well on Leonardo.
hasu
User avatar

Unread post03 Sep 2012, 14:41

User avatar
X
hasu
 
Posts: 359
Joined: 02 Sep 2011, 14:47
Location: Japan
Main keyboard: HHKB
Main mouse: HHKB
Favorite switch: Topre
Club member: -
 
How exciting!
So, I need to purchase
1. https://www.circuitsathome.com/products ... ino-boards
[ Edit: this is not what is needed. It is Arduino Leonardo that is needed for this mod. Link for Arduino Leonardo http://arduino.cc/en/Main/arduinoBoardLeonardo ]
2. https://www.circuitsathome.com/products ... r-arduino/

Does this support second layer customizing? (is your firm ware easily modifiable?)
Why is the standard B connector on Arduino is mini B connector in your Arduino board?

Not sure exactly how firmware update is done or whether firm ware is edit friendly, but definitely interesting!! Thanks hasu!
Last edited by Limmy on 06 Sep 2012, 12:49, edited 1 time in total.
Limmy

Unread post05 Sep 2012, 23:02

X
Limmy
 
Posts: 184
Joined: 19 Jan 2012, 14:55
Location: US
Main keyboard: HHKB Pro 2
Main mouse: G700, Mamba
Favorite switch: Topre, Red, Brown
Club member: -
 
1. No, not the Uno, you want the Arduino Leonardo. (explains the connector difference as well).
2. Yes. This one fits neatly on the Arduino. If you don't want to solder there's also an assembled version.

Alternatively, a Teensy 2.0 with the mini shield should work too, as in my earlier post. I haven't got round to trying hasu's code on it yet though!
Soarer
User avatar

Unread post05 Sep 2012, 23:47

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
Right, Leonardo is needed instead of Uno. Circuit@Home has no Leonardo, you need to find other shop.
Of course, multi layer, media key and mouse key are supported. Just edit keymap.c to have your favourite keymap.
https://github.com/tmk/tmk_keyboard/blo ... b/keymap.c

Note that my USB to USB converter is not mature enough and has some limitations.
- Hub is not supported, this means HHKB pro2 will not work.
- Only 'boot protocol'(6KRO) is supported, not NKRO keyboards like Noppoo Choc mini. (Never support NKRO)
- keyboard LED is not supported. (I don't have keyboard with LED around :)
- wake/resume is not supported.
- You may need unplug and plug your keyboard to start initialization process. (maybe needs some hardware mod)
hasu
User avatar

Unread post06 Sep 2012, 02:10

User avatar
X
hasu
 
Posts: 359
Joined: 02 Sep 2011, 14:47
Location: Japan
Main keyboard: HHKB
Main mouse: HHKB
Favorite switch: Topre
Club member: -
 
Thank you for the update!
With PS/2 to USB converter using Teensy(one developed by Soarer or another by hasu) and this USB device, I should be able to remap any keyboard except keyboards with integrated USB hub.

I don't put my computer to sleep nor require NKRO(6KRO is enough for me), so I am happy with the solution you guys provided. Thank you guys!
Limmy

Unread post06 Sep 2012, 13:01

X
Limmy
 
Posts: 184
Joined: 19 Jan 2012, 14:55
Location: US
Main keyboard: HHKB Pro 2
Main mouse: G700, Mamba
Favorite switch: Topre, Red, Brown
Club member: -
 
Soarer wrote:Alternatively, a Teensy 2.0 with the mini shield should work too, as in my earlier post. I haven't got round to trying hasu's code on it yet though!

Sorry for bump, but have you found some time to test it?
Franzl

Unread post30 Oct 2012, 02:13

X
Franzl
 
Posts: 8
Joined: 22 Sep 2012, 08:13
Location: .de
Club member: -
 
 
Franzl
Franzl wrote:
Soarer wrote:Alternatively, a Teensy 2.0 with the mini shield should work too, as in my earlier post. I haven't got round to trying hasu's code on it yet though!

Sorry for bump, but have you found some time to test it?

I tried hasu's code with the mini shield without success - I get "HID init: failed" with both an ML4100 and an MX3000, both when starting from the bootloader and when just plugging it in. I'm not sure at this point whether the code doesn't like those keyboards, or whether the different hardware is causing the problem, and I just haven't had time to look into it further :(

I'm assuming that some configuration issue is most likely, since it's failing at a very early stage. My hardware setup passes the board_qc test in the USBHostShield2 libary though, and that can read the device descriptor OK.
Soarer
User avatar

Unread post30 Oct 2012, 13:58

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
Right, got it working... simply a config setting in tmk_keyboard/protocol/usb_hid/USB_Host_Shield_2.0/avrpins.h: needed to uncomment #define BOARD_TEENSY to get it working with the Teensy 2.0 + Mini shield combo.
Soarer
User avatar

Unread post31 Oct 2012, 02:26

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
Soarer wrote:Right, got it working... simply a config setting in tmk_keyboard/protocol/usb_hid/USB_Host_Shield_2.0/avrpins.h: needed to uncomment #define BOARD_TEENSY to get it working with the Teensy 2.0 + Mini shield combo.

Got any pictures, pictures are always good.
fossala
User avatar
Elite +1

Unread post31 Oct 2012, 06:45

User avatar
X
fossala
Elite +1
 
Posts: 2730
Joined: 05 Aug 2011, 15:25
Location: UK
Main keyboard: HHKB Type-S
Main mouse: Rollermouse Free2
Favorite switch: Topre
Club member: -
 
The next step will be to fold it over and use header pins in some of the spare holes to hold it together.

Teensy_with_Mini_Shield_real.jpg
Soarer
User avatar

Unread post31 Oct 2012, 12:45

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
Wonderful! Now, it would be perfect if we could get a decent housing for the parts. Is there a popular way to put them in a case? It seems it would be hard to hold the boards in place. Is there an easy solution to this? Hmm.. glue gun?
Limmy

Unread post01 Nov 2012, 03:57

X
Limmy
 
Posts: 184
Joined: 19 Jan 2012, 14:55
Location: US
Main keyboard: HHKB Pro 2
Main mouse: G700, Mamba
Favorite switch: Topre, Red, Brown
Club member: -
 
Do you plug the keyboard into the mini shield or the teensy? It would be better into the mini shield because it's usb 2.0. What is a mini shield?
fossala
User avatar
Elite +1

Unread post01 Nov 2012, 08:06

User avatar
X
fossala
Elite +1
 
Posts: 2730
Joined: 05 Aug 2011, 15:25
Location: UK
Main keyboard: HHKB Type-S
Main mouse: Rollermouse Free2
Favorite switch: Topre
Club member: -
 
There was a link just a few posts ago! It's the USB host, so that's where the keyboard plugs in :P

Casing it properly would be tricky. A custom made case using layers of acrylic or aluminium might work nicely. But I'll probably just use tape or heatshrink (after smoothing sharp solder joints and PCB corners) :D
Soarer
User avatar

Unread post01 Nov 2012, 11:11

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
Dammit Soarer and Hasu, you're just adding to the list of things I NEED to buy.
fossala
User avatar
Elite +1

Unread post01 Nov 2012, 12:23

User avatar
X
fossala
Elite +1
 
Posts: 2730
Joined: 05 Aug 2011, 15:25
Location: UK
Main keyboard: HHKB Type-S
Main mouse: Rollermouse Free2
Favorite switch: Topre
Club member: -
 
I am not a hardware engineer and have quite frankly never done something like this myself, but hell would I like to have such a thing lying around! I will be checking this post every once in a while to check for updates. Sounds promising.
Janner

Unread post03 Nov 2012, 13:30

X
Janner
 
Posts: 1
Joined: 03 Nov 2012, 13:28
Main keyboard: HHKB Pro 2
Favorite switch: Topre
Club member: -
 
The easiest option for hardware is an Arduino Leonardo plus the circuits@home USB shield 2.0 - much larger than the mini combo above, but no fiddly soldering to do, they just plug together. Also, they both have mounting holes and the connectors come out on the same side, so it would be far easier to mount into a box.

However, the edge with the connectors of the host shield doesn't line up with the edge of the Leonardo, which is a shame. This picture is of some other Arduino, not a Leonardo, but the dimensions are similar:

Image

tinyosshop have a USB host shield that appears to be the same design as the circuits@home shield, and slightly cheaper. Even cheaper to buy on ebay though, and free postage. They also have Tosduino Leonardo which is priced well (again, search ebay for it, can be found with free postage).

But still, I don't think hasu will mind me saying, the software needs work before it could really be called ready for general use.
Soarer
User avatar

Unread post03 Nov 2012, 14:41

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
Forgive me for being dense, but does this mean that the Soarer Converter will not work when connected to a typical USB keyboard connected through a simple USB to PS/2 adapter?
http://www.cyberguys.com/product-detail ... uctid=4202
Hubbert

Unread post24 Nov 2012, 21:05

X
Hubbert
 
Posts: 20
Joined: 24 Nov 2012, 17:55
Location: USA
Main keyboard: Laptop (until I modify a desktop keyboard)
Main mouse: touchpad
Favorite switch: Buckling Spring or Cherry Blue
Club member: -
 
Hubbert wrote:Forgive me for being dense, but does this mean that the Soarer Converter will not work when connected to a typical USB keyboard connected through a simple USB to PS/2 adapter?
http://www.cyberguys.com/product-detail ... uctid=4202

My converter works just fine like that (as long as the keyboard supports PS/2). :D

This project's slow progress is mostly explained by its limited applicability. On the one hand most simple 6KRO USB keyboards also work fine over PS/2, so a PS/2 converter can be used instead. On the other, supporting fancier USB keyboards which have >6KRO (or even media keys etc) requires a lot of work. So this just fills a small niche, for now.
Soarer
User avatar

Unread post24 Nov 2012, 21:41

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
Thanks; that's good news. All my keyboards are either native PS/2 or include an adapter in the box, which should be enough for now. WASD claims NKRO over the included hunk-o-plastic PS/2 adapter, which should make an interesting test.
Hubbert

Unread post24 Nov 2012, 21:51

X
Hubbert
 
Posts: 20
Joined: 24 Nov 2012, 17:55
Location: USA
Main keyboard: Laptop (until I modify a desktop keyboard)
Main mouse: touchpad
Favorite switch: Buckling Spring or Cherry Blue
Club member: -
 
Soarer wrote:tinyosshop have a USB host shield that appears to be the same design as the circuits@home shield, and slightly cheaper. Even cheaper to buy on ebay though, and free postage. They also have Tosduino Leonardo which is priced well (again, search ebay for it, can be found with free postage).

... if you don't mind the wait :lol: I ordered both on the 9th. The host shield arrived today, and the Leornardo clone arrived a few days ago. Not toooo bad, I suppose, but the ethernet shield I ordered at the same time arrived over a week ago!

The things I want to play around with first are actually pointer device related - upping report rate to 500Hz or 1000Hz, and allowing sensitivity and acceleration settings per device (for when multiple pointer devices are in use).
Soarer
User avatar

Unread post01 Dec 2012, 22:17

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
How would the Noppoo Choc Mini work with this? If I remember correctly, it manages NKRO over USB by emulating two keybaords. I may have confused it with another model. Just a theoretical question.
Last edited by damorgue on 05 Jan 2013, 14:57, edited 1 time in total.
damorgue
User avatar

Unread post01 Dec 2012, 22:48

User avatar
X
damorgue
 
Posts: 841
Joined: 14 Jul 2011, 20:08
Location: Sweden
Main mouse: MX500
Favorite switch: BS, MX Green and MX Clear
Club member: -
 
It wouldn't - anything other than the basic 6KRO means a lot of work :(

- read descriptors
- parse descriptors
- set up some structures for dealing with the report described by the descriptor
- map that report data into the output reports
- send output reports when needed

Hasu (who has done _all_ the work on this so far) doesn't seem keen to do it, and I've no idea when I would find time to have a look at it (or even the pointer stuff I want to play with, if I'm honest). If Hasu doesn't beat me to it, I do want to try and get the reset working nicely though, and perhaps also get it working for keyboards with built-in hubs (although the hub wouldn't work).

edit: forgot about the other bit I thought I might look at - telling the keyboard to use 6KRO mode, like a BIOS does. That might make the noppoo work, I don't know.
Soarer
User avatar

Unread post01 Dec 2012, 23:18

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
In my quest to use learn a new keyboard layout, I actually did a Leonard + USB Host Shield 2 combo and came up with the code to make it work (for me).

I have posted my code and seutp here if you are interested:

http://forum.colemak.com/viewtopic.php?pid=10837

Cheers!
darkness

Unread post03 Dec 2012, 12:50

X
darkness
 
Posts: 1
Joined: 03 Dec 2012, 12:47
Club member: -
 
One year on, and I still haven't found the time or motivation to work on this at all :(

I did just stumble across another possible approach, and thought I might as well throw some links up. Hobbytronics have a USB Host Board using the Microchip 24FJ64GB002 microcontroller. They have various firmwares for it, including keyboard, however it outputs a serial stream that's not flexible enough for our wants. I don't know if their source is available, or if it would be better to start from the samples included in the 24F Starter Kit from Microchip.
Soarer
User avatar

Unread post07 Dec 2013, 18:55

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
You could also use a MBED-thing.. that one has both USB-host and USB out.. would be WAY overkill, but it should be possible :P
Aleksander

Unread post07 Dec 2013, 19:13

X
Aleksander
 
Posts: 272
Joined: 13 Jul 2012, 19:13
Location: Ålesund, Norway
Club member: -
 
Overkill is fine if the price is cheap! (And if writing/loading code is easy and doesn't require buying more stuff). But €49 (for this one) is more than a Teensy with a module costs... for now! Is there a cheaper one with USB host and device?
Soarer
User avatar

Unread post07 Dec 2013, 19:45

User avatar
X
Soarer
 
Posts: 999
Joined: 03 Jul 2011, 01:03
Location: UK
Favorite switch: F
Club member: -
 
Previous

Who is online

Users browsing this forum: No registered users and 37 guests