Author Topic: TMK ADB to USB keyboard converter  (Read 674659 times)

0 Members and 1 Guest are viewing this topic.

Offline taiwanesekid05

  • Posts: 5
Re: ADB to USB keyboard converter
« Reply #450 on: Thu, 21 May 2015, 16:07:43 »
Ah, it complies now.  Thank you Hasu!

Edit: I seem to have another problem now.  After I load the .hex onto the Teensy 2.0 and restart it, my cursor immediately goes to the top left hand corner of my screen and continues to go back up there even after I move the mouse.  And the keyboard doesn't work.  Any idea why this might be happening?
« Last Edit: Fri, 22 May 2015, 03:18:28 by taiwanesekid05 »

Offline urbanredfox

  • Posts: 4
Re: ADB to USB keyboard converter
« Reply #451 on: Mon, 25 May 2015, 00:24:12 »
taiwanesekid05,

Do you use a mouse? I had this issue while doing some coding and didn't have one plugged in. I downloaded a fresh copy from git hub at it worked so I'm not sure what exactly is going on there. If you don't use an ADB mouse you could also try commenting out the MOUSE_KEY_ENABLE option in the Makefile and see if it goes away.

Offline FattyFatty2by4

  • Posts: 3
  • Location: Canada
Re: ADB to USB keyboard converter
« Reply #452 on: Tue, 26 May 2015, 16:42:34 »
Sorry, I had a problem but it's sorted out now.
« Last Edit: Wed, 27 May 2015, 15:59:22 by FattyFatty2by4 »

Offline taiwanesekid05

  • Posts: 5
Re: ADB to USB keyboard converter
« Reply #453 on: Thu, 28 May 2015, 09:25:16 »
taiwanesekid05,

Do you use a mouse? I had this issue while doing some coding and didn't have one plugged in. I downloaded a fresh copy from git hub at it worked so I'm not sure what exactly is going on there. If you don't use an ADB mouse you could also try commenting out the MOUSE_KEY_ENABLE option in the Makefile and see if it goes away.

I tried commenting out MOUSEKEY_ENABLE with no avail.  I make'd while having my mouse plugged in and that did nothing.  And a fresh download from GitHub didn't help either.  I should also add that not only does plugging in the Teensy force the keyboard to go to the upper lefthand corner, but also that none of the keys on my Apple Extended Keyboard II work. 

Offline tufty

  • Posts: 347
  • Location: French Alps
Re: ADB to USB keyboard converter
« Reply #454 on: Thu, 28 May 2015, 09:36:12 »
Did you try reading the previous page of the thread?  Specifically, the post immediately before your first post on the thread?

Offline superbia

  • Posts: 133
  • Location: Republique de Croatie
Re: ADB to USB keyboard converter
« Reply #455 on: Sun, 14 June 2015, 15:19:40 »
My homebrew attempt to make my own adb-usb converter using an stm32 micro gloriously failed :rolleyes:

Now I just ended up ordering an arduino clone with 32u4 for 5$...
I hope everything will work this time  :eek: while waiting it to arrive...
Keebio Iris 2.8 (Alps) X Colemak Mod-DH

Offline mougrim

  • Posts: 768
  • Location: Ukraine
Re: ADB to USB keyboard converter
« Reply #456 on: Mon, 15 June 2015, 03:11:10 »
My homebrew attempt to make my own adb-usb converter using an stm32 micro gloriously failed :rolleyes:

Now I just ended up ordering an arduino clone with 32u4 for 5$...
I hope everything will work this time  :eek: while waiting it to arrive...

It will.
IBM AT Model F, Vortexgear Race 3, AEKII (Alps Cream Damped), Metoo Zero (modded to Kailh Box Navy)

Offline phosphoric

  • Posts: 229
Re: ADB to USB keyboard converter
« Reply #457 on: Mon, 15 June 2015, 11:57:29 »
no clue about c language or anything at all, but ghosting with jkl; is pretty common - was mashing these keys in notepad just to play with the 3-key rollover and p popped up a couple of times. thought i would leave a note here - not sure if i'm contributing at all, but documentation is documentation
Let's get this straight. There is nothing cool about keyboards we're all lame as fk.

speak for yourself

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #458 on: Mon, 15 June 2015, 19:30:25 »
I can't know why you leave the note here :D
Ghost occurs in matrix of keyboard not converter, keyboard has responsibility for handling ghost.

BTW, I never noticed phantom keys on my ADB keyboards, I think they have decent ghost block.

Offline phosphoric

  • Posts: 229
Re: ADB to USB keyboard converter
« Reply #459 on: Tue, 16 June 2015, 16:50:03 »
haha! this is why i post here. i'm still fairly new to the world of mechanical keyboards (and keyboard tech in general) so i learn from peoples' replies  ;D
Let's get this straight. There is nothing cool about keyboards we're all lame as fk.

speak for yourself

Offline FattyFatty2by4

  • Posts: 3
  • Location: Canada
Re: ADB to USB keyboard converter
« Reply #460 on: Tue, 16 June 2015, 20:52:49 »
Apologies for the rather long reply.

Apparently this is a new problem and it may have been sorted out for other people.
I've already soldered all of the components to the teensy and keyboard, I've checked my soldering and it's all clean, (I even tested it with a multimeter.) So then I do all of the technical steps, get my .hex file and upload it to the teensy through teensyloader. It goes asking around through windows update and all that, then once it's found the device, my mouse cursor moves to the top left of my monitor. I cannot move it back unless I unplug the teensy. I've tried it with 3 other mice but the problem persists. No LEDs on the keyboard light up, even though there's a current going through. It also does not type any keystrokes. I've tried it with 2 other proven-working .hex files and the same thing happens, except the mouse cursor works fine.

I have soldered wires directly to the PCB as seen in the pictures below. (The green wire is not connected to anything.) Here's the wiring:
RED: Data (Connected to D0)
WHITE: +5v (Connected to lower VCC)
BLACK: Ground (Connected to lower GND)
There is a 1k resistor connected on the bottom of the board to +5v and Data.
*UPDATE* I have taken off the 1k resistor to see if that was causing the problem. It still happens even when there's no resistor connected.

I'm fairly sure that my soldering is fine and I've even resoldered them because my previous attempt was poorly done. Just to be on the safe side, would you mind telling me if my soldering has any faults in it?

Unfortunately, the keyboard is from a brand that doesn't exist now and I cannot find much info about it. It's a Mac-101 E keyboard from DataDesk International. 1 month before attempting this project, it worked quite well with the Mac Quadra 660AV it was connected to.

Back to the issue, I used Cygwin to make a .hex file and I think I did it right. Here's the code:
$ cd /cygdrive/c/users/admin/desktop/tmk_keyboard/converter/adb_usb
$ make clean
$ make

I got a .hex file which I mounted onto the Teensy, and then my cursor goes to the top left and the keyboard doesn't work. I saw the previous posts and I've tried every single thing there. Still doesn't work... :(

Thanks in advance.
« Last Edit: Tue, 16 June 2015, 20:57:36 by FattyFatty2by4 »

Offline tufty

  • Posts: 347
  • Location: French Alps
Re: ADB to USB keyboard converter
« Reply #461 on: Wed, 17 June 2015, 12:34:03 »
If you're not seeing LEDs on the keyboard, my guess would be that you're not connected correctly at the keyboard end.  Specifically, IIRC, the Mac101 should have a power indicator LED.  If that's not lighting up, you're not giving the keyboard power, or, more correctly, are giving it power at the wrong pin.

That otherwise unconnected green wire, for example, looks like it goes to the ground plane.  Check the keyboard end, paying careful attention to where the ADB connectors are and where the pins connect to.  A good bet would be to wire your teensy to a cut-in-half ADB or S-video cable, and then connect it externally to the board via its built-in ADB ports.

It's easy to read the ADB pinout back to front.  If you're tracing from a back-to-front pinout, you would expect things to fail interestingly; that swaps power with gnd, and adb with the power switch.
« Last Edit: Wed, 17 June 2015, 12:41:06 by tufty »

Offline FattyFatty2by4

  • Posts: 3
  • Location: Canada
Re: ADB to USB keyboard converter
« Reply #462 on: Wed, 17 June 2015, 19:28:40 »
I think you may be right. I'll try to reverse the pins and see what happens.

*UPDATE*
Thank you so much. I reversed the pins and it works great. Funny I hadn't thought of that before.
« Last Edit: Sun, 21 June 2015, 19:22:20 by FattyFatty2by4 »

Offline chuchana

  • Posts: 2
Re: ADB to USB keyboard converter
« Reply #463 on: Sun, 21 June 2015, 10:28:13 »
Does uploading the firmware change the bootloader? I wanted to upload a new version of the firmware to the Arduino and I cannot see the port anymore (it used to be /dev/cu.usbmodem1421).

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #464 on: Sun, 21 June 2015, 16:52:57 »
It depends on how you upload, with ISP connector bootloader will be removed while it will be there if you upload with normal Aruduino method.

Offline chuchana

  • Posts: 2
Re: ADB to USB keyboard converter
« Reply #465 on: Fri, 03 July 2015, 12:35:16 »
Thank you for your answer and for the project!

I have uploaded it directly as I could not find how to upload it via Arduino. Is there documentation on how to do that?

Offline superbia

  • Posts: 133
  • Location: Republique de Croatie
Re: ADB to USB keyboard converter
« Reply #466 on: Fri, 03 July 2015, 15:10:55 »
Quick start for people who bought 32u4 arduino clones on ebay (5$):

1. get avrdude (for flashing)  :thumb:
2. make the software, as hasu sugested  :thumb:
2. use avrdude to flash the firmware
2.b note: you need to press "reset" once, than fast 2 times to get into bootloader (or if you dont have the button short RST and GND pins), so you need to short it total of 3 times  :thumb:
2.c dont wait long and use this command to flash it $ avrdude -p m32u4 -c avr109 -P /dev/ttyACM0 -U flash:w:adb_usb_lufa.hex:i          ( replace /dev/ttyACM0 with your port)  :thumb:

After that, you may will find some keys working and some not, i suggest you make your own layout, as hasu documented.
I had to try my layout like 4 times to get it right, because half of modifier keys wer either swaped or not working, and i also decided to swap caps and ctrl in the end....
Pretty easy, i hope i helped somebody... Btw. i used it on french azerty aekii  :thumb:
Keebio Iris 2.8 (Alps) X Colemak Mod-DH

Offline 88slides

  • Posts: 1
Re: ADB to USB keyboard converter
« Reply #467 on: Mon, 06 July 2015, 11:24:13 »
After spending about a week testing things, I still have the same issue. Whenever I attach the +5V cable from the teensy to the keyboard, my Macbook Pro shuts down the connection with a popup saying "Unplug the device using too much power to re-enable USB devices." The keyboard is the only thing plugged into my computer.

Any ideas?

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #468 on: Mon, 06 July 2015, 13:28:55 »
Seems like something goes wrong on connection of power line and it makes short circuit.
Or perhpas the keyboard is extremely power hog. What is your keyboard?

From first post...
Quote
NEED HELP?
Your converter doesn't work?
Frist, post pics of your hardware and wriring this really save time of us. Don't save your time by omitting this.

If you edit code
Post your code. Don't hesitate to show your dirty code!

Offline ShawnMeg

  • Posts: 144
  • Location: Parts Unknown
Re: ADB to USB keyboard converter
« Reply #469 on: Mon, 06 July 2015, 17:05:04 »
Quick start for people who bought 32u4 arduino clones on ebay (5$):

1. get avrdude (for flashing)  :thumb:
2. make the software, as hasu sugested  :thumb:
2. use avrdude to flash the firmware
2.b note: you need to press "reset" once, than fast 2 times to get into bootloader (or if you dont have the button short RST and GND pins), so you need to short it total of 3 times  :thumb:
2.c dont wait long and use this command to flash it $ avrdude -p m32u4 -c avr109 -P /dev/ttyACM0 -U flash:w:adb_usb_lufa.hex:i          ( replace /dev/ttyACM0 with your port)  :thumb:

After that, you may will find some keys working and some not, i suggest you make your own layout, as hasu documented.
I had to try my layout like 4 times to get it right, because half of modifier keys wer either swaped or not working, and i also decided to swap caps and ctrl in the end....
Pretty easy, i hope i helped somebody... Btw. i used it on french azerty aekii  :thumb:

http://deskthority.net/workshop-f7/how-to-use-a-pro-micro-as-a-cheap-controller-converter-like-soarer-s-t8448.html

According to this tutorial, you may not need to do step 2b above if the pro Micro is new and hasn't been flashed before.  The tutorial says that it'll go into bootloader mode once plugged in.  I'm about to make a converter, but awaiting for all the parts to arrive.
« Last Edit: Thu, 09 July 2015, 09:25:29 by ShawnMeg »


IBM Model F122 X 2 internal Soarer's || IBM Model M122 internal Soarer's || AEK II SKCM Salmon ALPS external adb_usb converter ||  AEK M0115 SKCM Orange ALPS click mod external adb_usb converter || AEK M0115 SKCM Salmon ALPS external adb_usb converter ||

Offline ShawnMeg

  • Posts: 144
  • Location: Parts Unknown
Re: ADB to USB keyboard converter
« Reply #470 on: Sun, 12 July 2015, 21:57:39 »
--
« Last Edit: Sat, 21 January 2017, 23:21:35 by ShawnMeg »


IBM Model F122 X 2 internal Soarer's || IBM Model M122 internal Soarer's || AEK II SKCM Salmon ALPS external adb_usb converter ||  AEK M0115 SKCM Orange ALPS click mod external adb_usb converter || AEK M0115 SKCM Salmon ALPS external adb_usb converter ||

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #471 on: Sun, 12 July 2015, 22:33:17 »
I don't thnk it breaks your keyboard and converter but not completely sure.
I guess It works as far as you don't use power key, which is normally pulled-up to VCC and pulled down to GND when pressed.


Offline taiwanesekid05

  • Posts: 5
Re: ADB to USB keyboard converter
« Reply #472 on: Sat, 18 July 2015, 00:14:23 »
Did you try reading the previous page of the thread?  Specifically, the post immediately before your first post on the thread?

I did put in a 1K resistor, it produced the same problem.  So I removed the resistor, same problem.  Resoldered the resistor, same problem.  I'm not sure if it's something I'm doing wrong, or something worse.  I've attached some photos so maybe someone can let me know what I'm doing wrong.  Nothing is currently permanently soldered from the Teensy to the keyboard, so that's why I just have wires sticking out of the ADB plug.  I think I've put everything in the right place (Data to the 1 hole, VCC to the 3 hole, and Ground to the 4 hole) but I'm not 100% sure. 

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #473 on: Sun, 19 July 2015, 04:27:55 »
Did you check README and the first post of this thread? The latest source is configured to use D0 for data. If you want to use F0 you have to change config.h.

Offline taiwanesekid05

  • Posts: 5
Re: ADB to USB keyboard converter
« Reply #474 on: Sun, 19 July 2015, 17:29:07 »
Did you check README and the first post of this thread? The latest source is configured to use D0 for data. If you want to use F0 you have to change config.h.

Ahh... that was the issue... I based my soldering off of photos I saw and wasn't 100% sure if that was the issue.  The converter works perfectly now.  Thanks a lot Hasu!

Offline applekey2

  • Posts: 1
Re: ADB to USB keyboard converter
« Reply #475 on: Sun, 30 August 2015, 11:43:09 »
I have about 400 ADB keyboards and about 400 adb mice in brand new condition. I need to design and make a adb to usb converter that has an adb plug on one side and a usb plug on the other side. I need to make something in bulk and cost efficient.  Anyone have suggestions? I want to make something similar to the ps2 to usb converter ? Would the same chip work? Any suggestions?

Offline superbia

  • Posts: 133
  • Location: Republique de Croatie
Re: ADB to USB keyboard converter
« Reply #476 on: Mon, 31 August 2015, 11:06:28 »
I have about 400 ADB keyboards and about 400 adb mice in brand new condition. I need to design and make a adb to usb converter that has an adb plug on one side and a usb plug on the other side. I need to make something in bulk and cost efficient.  Anyone have suggestions? I want to make something similar to the ps2 to usb converter ? Would the same chip work? Any suggestions?

First, you are doing something commercial.

Secondly, you can't just assume people will design the pcb, write the software, arrange the manufacturing and ship 400 converters to you.
Thirdly, check the licencing on the firmwares/tools you gonna use, best of luck.
Keebio Iris 2.8 (Alps) X Colemak Mod-DH

Offline mr.squishy

  • Posts: 215
  • I like beer and keebs
Re: ADB to USB keyboard converter
« Reply #477 on: Mon, 07 September 2015, 23:58:20 »
So, I've been using my converted M0116 for a while and I'm kind of curious, since my keyboard doesn't have F keys, what do you guys do when you need to use one of the F keys?Unless I missed something and there is some sort of function layer, I haven't been able to figure out how to press F keys, so I use a second keyboard. What do you guys think?
Also, has the 2key rollover issue been solved yet, or is that a hardware level issue?

Offline Yoe

  • Posts: 273
  • Location: Skellefteå, Sweden
  • Alps & ISO <3
Re: ADB to USB keyboard converter
« Reply #478 on: Tue, 08 September 2015, 01:10:13 »
So, I've been using my converted M0116 for a while and I'm kind of curious, since my keyboard doesn't have F keys, what do you guys do when you need to use one of the F keys?Unless I missed something and there is some sort of function layer, I haven't been able to figure out how to press F keys, so I use a second keyboard. What do you guys think?

You can use the tap key function in TMK and use a non modifier key of choice. I have used the escape key for this in my keyboards and adapters. When just pressing and releasing the escape key, you get escape, but keep it pressed and you activate the fuction layer. As an example, this is what keymap_iso.c looks like in my ADB to USB adapters:

Code: [Select]
#include "keymap_common.h"


const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    KEYMAP_EXT_ISO(
    FN0, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,PAUS,                   PWR,
    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS, HOME,PGUP,    NLCK,PEQL,PSLS,PAST,
    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,ENT,      DEL, END, PGDN,    P7,  P8,  P9,  PMNS,
    LCAP,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,NUHS,                             P4,  P5,  P6,  PPLS,
    LSFT,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,     RSFT,          UP,           P1,  P2,  P3,
    LCTL,LALT,LGUI,          SPC,                               RALT,RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT
    ),


    KEYMAP_EXT_ISO(
    TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,           TRNS, TRNS, TRNS,                      TRNS,
    TRNS, F1,   F2,   F3,   F4,   F5,   F6,   F7,   F8,   F9,   F10,  F11,  F12,   DEL,     TRNS, TRNS, TRNS,    TRNS, TRNS, TRNS, TRNS,
    PWR,  TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,     TRNS, TRNS, TRNS,    TRNS, TRNS, TRNS, TRNS,
    TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,                                TRNS, TRNS, TRNS, TRNS,
    TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MPRV, MNXT, MUTE, VOLD, VOLU, TRNS,       TRNS,           PGUP,          TRNS, TRNS, TRNS,
    TRNS, TRNS, TRNS,             MPLY,                               TRNS, TRNS,           HOME, PGDN, END,     TRNS,       TRNS, TRNS
    ),

};

const uint16_t PROGMEM fn_actions[] = {
  [0] = ACTION_LAYER_TAP_KEY(1, KC_ESC),
};

Offline skullydazed

  • * Vendor
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: ADB to USB keyboard converter
« Reply #479 on: Tue, 08 September 2015, 10:46:38 »
So, I've been using my converted M0116 for a while and I'm kind of curious, since my keyboard doesn't have F keys, what do you guys do when you need to use one of the F keys?Unless I missed something and there is some sort of function layer, I haven't been able to figure out how to press F keys, so I use a second keyboard. What do you guys think?
Also, has the 2key rollover issue been solved yet, or is that a hardware level issue?

Personally I plan to replace the caps lock switch with a non-locking switch and that can be my fn key. Then it's just a matter of configuring a function layer in keymap_<whatever>.c.

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #480 on: Wed, 09 September 2015, 18:37:44 »
So, I've been using my converted M0116 for a while and I'm kind of curious, since my keyboard doesn't have F keys, what do you guys do when you need to use one of the F keys?Unless I missed something and there is some sort of function layer, I haven't been able to figure out how to press F keys, so I use a second keyboard. What do you guys think?
Also, has the 2key rollover issue been solved yet, or is that a hardware level issue?

Current default keymap is very plain and has no function layer, you need to define your own keymap.

Instead you can use my keymap, you can access function layer by holding down backslash key.
https://github.com/tmk/tmk_keyboard/blob/master/converter/adb_usb/keymap_hasu.c

Build firmware like this.
Code: [Select]
make KEYMAP=hasu

Offline tufty

  • Posts: 347
  • Location: French Alps
Re: ADB to USB keyboard converter
« Reply #481 on: Fri, 11 September 2015, 02:28:39 »
So, I've been using my converted M0116 for a while and I'm kind of curious, since my keyboard doesn't have F keys, what do you guys do when you need to use one of the F keys?Unless I missed something and there is some sort of function layer, I haven't been able to figure out how to press F keys, so I use a second keyboard. What do you guys think?
Also, has the 2key rollover issue been solved yet, or is that a hardware level issue?

Personally I plan to replace the caps lock switch with a non-locking switch and that can be my fn key. Then it's just a matter of configuring a function layer in keymap_<whatever>.c.
Thats what I did.  Numbers row -> function keys, arrows -> home end pgup pgdn, keypad +- -> volume keys, etc.

(well out of date) https://github.com/tufty/tmk_keyboard/blob/master/converter/adb_usb/keymap_tufty.c

2 key rollover is hardware level.  You won't beat that without rewiring the matrix

Offline skullydazed

  • * Vendor
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: ADB to USB keyboard converter
« Reply #482 on: Sat, 12 September 2015, 14:10:26 »
I designed an adaptor that fits inside the AEKII case and replaces one of the ADB ports. I just got my prototypes back however it looks like I made a mistake and specified .1uf instead of 1uf for the UCAP cap, and I left out the VBUS/VCC cap entirely. I can program the board but when I attempt to use it I get this from hid_listen:

Code: [Select]
adb_host_kbd_recv: ERROR(-30)

When I run the teensy blinky program on my board the LED blinks too quickly to make out the morse code. This leads me to believe that specifying an incorrect cap and leaving out one cap has thrown off the timing the atmega uses enough to break the ADB protocol. I have ordered some 1uf caps and will attempt to replace them, but while I wait for that can anyone tell me if my hypothesis seems correct?

My schematic, if that will help in answering, can be found here.

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #483 on: Sat, 12 September 2015, 19:58:21 »
Sorry if I'm treating you as a too noob.

First did you read the first post of this thread?

Your schematic looks good to me and you should have correct caps on UVCC pin. Check chip datasheet, I think you need 10% tolerant good caps I usually use a 10% X5R cap. But I dont think the caps causes your problem.

Teensy has a LED on different port from your board. Did you change blinky code properly?

Probably your wiring of ADB lines have someting wrong.

Offline skullydazed

  • * Vendor
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: ADB to USB keyboard converter
« Reply #484 on: Sat, 12 September 2015, 22:40:44 »
Sorry if I'm treating you as a too noob.

First did you read the first post of this thread?

I never mind when people check the basics. It saves times if there's something I missed. I have read the first post and the tmk_keyboard/converter/adb_usb/README.md many times.

Your schematic looks good to me and you should have correct caps on UVCC pin. Check chip datasheet, I think you need 10% tolerant good caps I usually use a 10% X5R cap. But I dont think the caps causes your problem.

Thanks for double-checking. That's the updated schematic with corrected caps, so it's good to know that it looks good to you. The caps are YAGEO2/CC0603KRX7R9BB104 CAP CER 0.1UF 50V 10% X7R 0603 so should be within spec. The 1uf's I have on the way are also 10%.

Teensy has a LED on different port from your board. Did you change blinky code properly?

I did change the blinky code properly, the LED turns on it just flashes with improper timing. These are the only differences between the two blinky.hex's I tried:

Code: [Select]
--- blinky-teensy.c 2015-09-12 20:06:23.000000000 -0700
+++ blinky-adaptor.c 2015-09-12 19:49:58.000000000 -0700
@@ -30,8 +30,8 @@

 // Teensy 2.0: LED is active high
 #if defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB1286__)
-#define LED_ON (PORTD |= (1<<6))
-#define LED_OFF (PORTD &= ~(1<<6))
+#define LED_ON (PORTF |= (1<<0))
+#define LED_OFF (PORTF &= ~(1<<0))

 // Teensy 1.0: LED is active low
 #else

Probably your wiring of ADB lines have someting wrong.

The only thing I can think of here is that for some reason my pull-up resistor doesn't work in the current configuration. You can see the trace for the DATA line very clearly, it's the one to the right of the U1 silkscreen text, and on the back of the board are the traces that go to the via's that connect R4 between that pin and VCC:





I'm using this resistor: VD2/CRCW06031K00FKEA RES SMD 1K OHM 1% 1/10W 0603

My meter reads perfect continuity between the pin on the atmega and pin 1 on the adb connector on the other side.

Offline skullydazed

  • * Vendor
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: ADB to USB keyboard converter
« Reply #485 on: Sat, 12 September 2015, 23:01:20 »
One more quick data point, I have a teensy I wired up to the same pin as my adaptor (F4) and the teensy works perfectly, while my adaptor does not.



When I measured I had continuity between F4 on the teensy and F4 on my adaptor's atmega while plugged in that way. I also had continuity between VCC and GND on the teensy and various points on the adaptor.

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #486 on: Sun, 13 September 2015, 01:26:31 »
As for blinky you'll also need to set   the pin as output with DDRF somewhere.

And F4-F7 pins are not used as general IO by default. They are used for JTAG interface . You have to disable JTAG before use.
See tmk FAQ entry on github or check datasheet.
Teensy chip is configured with chip fuse settings at factory so you don't have to.


Offline skullydazed

  • * Vendor
  • Posts: 307
  • Location: Bay Area, CA
  • Had to turn PM's off. Email info@clueboard.co!
    • Clueboard
Re: ADB to USB keyboard converter
« Reply #487 on: Sun, 13 September 2015, 08:55:10 »
That was it! Thanks for helping me get this going.

I didn't even know that TMK had that FAQ or the wiki, and I've been looking at these pages for months now. Change blindness or similar I suppose. It might help to put a link to the FAQ and/or wiki in the README.md rather than only in the first page of this post, after a while I started to assume the content was the same between that and the first page of this thread.

(And now I have a bunch of NOTEs to read in the issue tracker, lots of great background there.)

Offline powaa

  • Posts: 5
  • Location: Western Australia
Re: ADB to USB keyboard converter
« Reply #488 on: Wed, 16 September 2015, 05:43:29 »
Hi,

I managed to get my M0116 working with this adapter through a pro micro, wiring is all correct. Infact I'm typing this post on it. So thankyou so much for the firmware

I was wondering if I could get help with my keymap. EVerything works except for the 1st function layer that changes the numberpad to mimic the home cluster and the arrow keys, the second function layer for Fkeys works beautifully so I dont understand what I'm doing wrong.

Code: [Select]
#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  /* Default layer : plain keymap IGNORE THE DIAGRAMS, THEY ARE NOT INDICATIVE OF THE KEYBOARD
   *                     +-------+
   *                     | FN1   |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | bks | |clr| = | / | * |
   * +---------------------------------------------------------+ +---+---+---+---+
   * | tab | q | w | e | r | t | y | u | i | o | p | [ | ] |   | | 7 | 8 | 9 | + |
   * +-----------------------------------------------------+   | +---+---+---+---+
   * | caps | a | s | d | f | g | h | j | k | l | ; | ' |return| | 4 | 5 | 6 | - |
   * +---------------------------------------------------------+ +---+---+---+---+
   * | shift  | z | x | c | v | b | n | m | , | . | / |  shift | | 1 | 2 | 3 |   |
   * +---------------------------------------------------------+ +-------+---|ent|
   * |Ctrl|opt|comnd| ` |                   | \ |lef|rig|dwn|up | |   0   | . |   |
   * +---------------------------------------------------------+ +-------+---+---+
   */
  KEYMAP_M0116_ANSI(
    FN2,
    ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC,   DEL, EQL, PSLS,NLCK,
    TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC,       P7,  P8,  P9,  PPLS,
    LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT,   ENT,  P4,  P5,  P6,  PMNS,
    LSFT,  Z, X, C, V, B, N, M, COMM,  DOT, SLSH, RSFT,  P1,  P2,  P3,
    FN1,LALT,LGUI,GRV,   SPC,   BSLS,LEFT,RGHT,DOWN,UP,  P0,       FN2,PENT
  ),
  /* Layer 1 :
   *                     +-------+
   *                     | FN1   |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|     | |   |   |   |Mut|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |     |   |   |   |   |   |   |   |   |   |   |   |   |   | |   |   |   |VoU|
   * +-----------------------------------------------------+   | +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |   |      | |   |   |   |VoD|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |Capslock| |   |   |   |   |
   * +---------------------------------------------------------+ +-------+---|   |
   * |Fn1|   |     |   |                   |   |Hom|End|PgD|PgU| |       |   |   |
   * +---------------------------------------------------------+ +-------+---+---+
   */
  KEYMAP_M0116_ANSI(
    FN2,
    ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,TRNS,TRNS,   TRNS,                 INS, HOME, PGUP, MUTE,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,                      DEL, END,PGDN, VOLU,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,    TRNS,                  TRNS, UP, TRNS,   VOLD,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,        TRNS,                   LEFT,DOWN,RGHT,
    TRNS,TRNS , TRNS, TRNS,         TRNS,      TRNS, CALC,PSCR,SLCK,BRK,                            TRNS,     TRNS,    TRNS
  ),
 
    /* Layer 2 :
   *                     +-------+
   *                     | FN1   |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|     | |   |   |   |Mut|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |     |   |   |   |   |   |   |   |   |   |   |   |   |   | |   |   |   |VoU|
   * +-----------------------------------------------------+   | +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |   |      | |   |   |   |VoD|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |Capslock| |   |   |   |   |
   * +---------------------------------------------------------+ +-------+---|   |
   * |Fn1|   |     |   |                   |   |Hom|End|PgD|PgU| |       |   |   |
   * +---------------------------------------------------------+ +-------+---+---+
   */
  KEYMAP_M0116_ANSI(
    FN2,
    ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,F11,F12,          TRNS,                 TRNS, TRNS, TRNS, TRNS,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,      TRNS, TRNS, TRNS, TRNS,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,    TRNS,   TRNS, TRNS, TRNS,   TRNS,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,        TRNS,      TRNS,TRNS, TRNS,
    TRNS,TRNS , TRNS, TRNS,         TRNS,      TRNS, TRNS,TRNS,TRNS,TRNS,              TRNS,     TRNS,    TRNS
  ),
};

const uint16_t PROGMEM fn_actions[] = {
ACTION_LAYER_TOGGLE(1),
ACTION_LAYER_TAP_KEY(2, KC_CAPS),
};
/*copied and edited from tufty's keymap
*/

Thanks in advance.


Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #489 on: Wed, 16 September 2015, 15:30:47 »
I didn't even know that TMK had that FAQ or the wiki, and I've been looking at these pages for months now. Change blindness or similar I suppose. It might help to put a link to the FAQ and/or wiki in the README.md rather than only in the first page of this post, after a while I started to assume the content was the same between that and the first page of this thread.

Indeed, I'll update README and check other documentations again some later.

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #490 on: Wed, 16 September 2015, 15:38:17 »
FN1 should be ACTION_LAYER_MOMENTARY(1) because the left bottom key of M0116 has mechanical locking switch and it toggles layer with its own function, you don't need TOGGLE action in this case.

Hi,

I managed to get my M0116 working with this adapter through a pro micro, wiring is all correct. Infact I'm typing this post on it. So thankyou so much for the firmware

I was wondering if I could get help with my keymap. EVerything works except for the 1st function layer that changes the numberpad to mimic the home cluster and the arrow keys, the second function layer for Fkeys works beautifully so I dont understand what I'm doing wrong.

Code: [Select]
#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  /* Default layer : plain keymap IGNORE THE DIAGRAMS, THEY ARE NOT INDICATIVE OF THE KEYBOARD
   *                     +-------+
   *                     | FN1   |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | bks | |clr| = | / | * |
   * +---------------------------------------------------------+ +---+---+---+---+
   * | tab | q | w | e | r | t | y | u | i | o | p | [ | ] |   | | 7 | 8 | 9 | + |
   * +-----------------------------------------------------+   | +---+---+---+---+
   * | caps | a | s | d | f | g | h | j | k | l | ; | ' |return| | 4 | 5 | 6 | - |
   * +---------------------------------------------------------+ +---+---+---+---+
   * | shift  | z | x | c | v | b | n | m | , | . | / |  shift | | 1 | 2 | 3 |   |
   * +---------------------------------------------------------+ +-------+---|ent|
   * |Ctrl|opt|comnd| ` |                   | \ |lef|rig|dwn|up | |   0   | . |   |
   * +---------------------------------------------------------+ +-------+---+---+
   */
  KEYMAP_M0116_ANSI(
    FN2,
    ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC,   DEL, EQL, PSLS,NLCK,
    TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC,       P7,  P8,  P9,  PPLS,
    LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT,   ENT,  P4,  P5,  P6,  PMNS,
    LSFT,  Z, X, C, V, B, N, M, COMM,  DOT, SLSH, RSFT,  P1,  P2,  P3,
    FN1,LALT,LGUI,GRV,   SPC,   BSLS,LEFT,RGHT,DOWN,UP,  P0,       FN2,PENT
  ),
  /* Layer 1 :
   *                     +-------+
   *                     | FN1   |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|     | |   |   |   |Mut|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |     |   |   |   |   |   |   |   |   |   |   |   |   |   | |   |   |   |VoU|
   * +-----------------------------------------------------+   | +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |   |      | |   |   |   |VoD|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |Capslock| |   |   |   |   |
   * +---------------------------------------------------------+ +-------+---|   |
   * |Fn1|   |     |   |                   |   |Hom|End|PgD|PgU| |       |   |   |
   * +---------------------------------------------------------+ +-------+---+---+
   */
  KEYMAP_M0116_ANSI(
    FN2,
    ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,TRNS,TRNS,   TRNS,                 INS, HOME, PGUP, MUTE,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,                      DEL, END,PGDN, VOLU,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,    TRNS,                  TRNS, UP, TRNS,   VOLD,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,        TRNS,                   LEFT,DOWN,RGHT,
    TRNS,TRNS , TRNS, TRNS,         TRNS,      TRNS, CALC,PSCR,SLCK,BRK,                            TRNS,     TRNS,    TRNS
  ),
 
    /* Layer 2 :
   *                     +-------+
   *                     | FN1   |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|     | |   |   |   |Mut|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |     |   |   |   |   |   |   |   |   |   |   |   |   |   | |   |   |   |VoU|
   * +-----------------------------------------------------+   | +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |   |      | |   |   |   |VoD|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |Capslock| |   |   |   |   |
   * +---------------------------------------------------------+ +-------+---|   |
   * |Fn1|   |     |   |                   |   |Hom|End|PgD|PgU| |       |   |   |
   * +---------------------------------------------------------+ +-------+---+---+
   */
  KEYMAP_M0116_ANSI(
    FN2,
    ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,F11,F12,          TRNS,                 TRNS, TRNS, TRNS, TRNS,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,      TRNS, TRNS, TRNS, TRNS,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,    TRNS,   TRNS, TRNS, TRNS,   TRNS,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,        TRNS,      TRNS,TRNS, TRNS,
    TRNS,TRNS , TRNS, TRNS,         TRNS,      TRNS, TRNS,TRNS,TRNS,TRNS,              TRNS,     TRNS,    TRNS
  ),
};

const uint16_t PROGMEM fn_actions[] = {
ACTION_LAYER_TOGGLE(1),
ACTION_LAYER_TAP_KEY(2, KC_CAPS),
};
/*copied and edited from tufty's keymap
*/

Thanks in advance.



Offline mr.squishy

  • Posts: 215
  • I like beer and keebs
Re: ADB to USB keyboard converter
« Reply #491 on: Wed, 16 September 2015, 16:25:33 »
Oh that's cool, I wish I had function keys. Is there any way I can update or reflash my teensy while it is already soldered into a project? I'd love to reflash it to include the right code to make the power button a function key so that I can finally use F keys.

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #492 on: Wed, 16 September 2015, 18:29:47 »
Yes, Teensy(and many alternatives) is still reflashable via USB even after soldered and assembled.

Offline powaa

  • Posts: 5
  • Location: Western Australia
Re: ADB to USB keyboard converter
« Reply #493 on: Thu, 17 September 2015, 00:27:01 »
Sorry, I think you misunderstand

the caps lock latch has been removed and currently works as tap (see code) (although I have swapped caps and ctrl it swaps them itself, I dont know but it works). My issue is that when the power button is pressed (FN2) it is meant to toggle the numberpad so it has arrow keys and home cluster, however this does not happen. it works fine otherwise .

Offline tjweir

  • * Exquisite Elder
  • Posts: 1039
  • Location: Toronto
Re: ADB to USB keyboard converter
« Reply #494 on: Thu, 17 September 2015, 12:49:57 »
Thanks Hasu, Blargg and everyone else on this thread that helped.

I'm typing on a lovely condition AEKII thanks to this lovely converter.

:)
« Last Edit: Fri, 09 October 2015, 12:53:04 by tjweir »

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #495 on: Thu, 17 September 2015, 15:41:22 »
Confused.

Quote
EVerything works except for the 1st function layer that changes the numberpad to mimic the home cluster and the arrow keys, the second function layer for Fkeys works beautifully so I dont understand what I'm doing wrong.

It says '1st function layer'(Layer 1) is issue and 'the second function layer'(Layer 2) works, right?
Did I read incorectly? Long English sentese is hard to understand to me :p


Sorry, I think you misunderstand

the caps lock latch has been removed and currently works as tap (see code) (although I have swapped caps and ctrl it swaps them itself, I dont know but it works). My issue is that when the power button is pressed (FN2) it is meant to toggle the numberpad so it has arrow keys and home cluster, however this does not happen. it works fine otherwise .

Your issue is Layer 2(FN2) now?
But I think I understand your problem, In default config.h 'Power button' is used as 'magic command' trigger key, you can't use it for your usage unless you change the config.
https://github.com/tmk/tmk_keyboard#magic-commands

Easy workaround is disable 'magic command' in Makefile. Comment out the following line with '#'.
Code: [Select]
COMMAND_ENABLE = yes

Other is that you define your own IS_COMMAND macro in config.h. See the file in other projects also.
Code: [Select]
#define IS_COMMAND() ( \
    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LALT) | MOD_BIT(KC_LGUI)) \
)

Offline powaa

  • Posts: 5
  • Location: Western Australia
Re: ADB to USB keyboard converter
« Reply #496 on: Thu, 17 September 2015, 21:50:51 »
Sorry, Its a bit confusing because computers start at 0 while the real world starts counting at 1.

I have moved FN2 to the period on the numberpad so I don't have to play around with the power key.

In my code I have commented in all caps what I think it is meant to do and where (obviously not because its not working) :P.

Code: [Select]
#include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  /* Default layer : plain keymap IGNORE THE DIAGRAMS, THEY ARE NOT INDICATIVE OF THE KEYBOARD
   *                     +-------+
   *                     | FN1   |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | bks | |clr| = | / | * |
   * +---------------------------------------------------------+ +---+---+---+---+
   * | tab | q | w | e | r | t | y | u | i | o | p | [ | ] |   | | 7 | 8 | 9 | + |
   * +-----------------------------------------------------+   | +---+---+---+---+
   * | caps | a | s | d | f | g | h | j | k | l | ; | ' |return| | 4 | 5 | 6 | - |
   * +---------------------------------------------------------+ +---+---+---+---+
   * | shift  | z | x | c | v | b | n | m | , | . | / |  shift | | 1 | 2 | 3 |   |
   * +---------------------------------------------------------+ +-------+---|ent|
   * |Ctrl|opt|comnd| ` |                   | \ |lef|rig|dwn|up | |   0   | . |   |
   * +---------------------------------------------------------+ +-------+---+---+
   *FROM WHAT I UNDERSTAND FN2 (WHICH IS CURRENTLY SET AS PERIOD ON THE NUMBERPAD) ACTIVATES THE TOGGLE COMMAND I HAVE LABELED AT THE BOTTOM
   */
  KEYMAP_M0116_ANSI(
    NO,
    ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC,   DEL, EQL, PSLS,NLCK,
    TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC,       P7,  P8,  P9,  PPLS,
    LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT,   ENT,  P4,  P5,  P6,  PMNS,
    LSFT,  Z, X, C, V, B, N, M, COMM,  DOT, SLSH, RSFT,  P1,  P2,  P3,
    FN1,LGUI,LALT,GRV,   SPC,   BSLS,LEFT,RGHT,DOWN,UP,  P0,       FN2,PENT
  ),
  /* Layer 1 :
   *                     +-------+
   *                     | FN1   |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|     | |   |   |   |Mut|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |     |   |   |   |   |   |   |   |   |   |   |   |   |   | |   |   |   |VoU|
   * +-----------------------------------------------------+   | +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |   |      | |   |   |   |VoD|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |Capslock| |   |   |   |   |
   * +---------------------------------------------------------+ +-------+---|   |
   * |Fn1|   |     |   |                   |   |Hom|End|PgD|PgU| |       |   |   |
   * +---------------------------------------------------------+ +-------+---+---+
   *THIS LAYER IS MEANT TO ACTIVATE WHEN I TOGGLE FN2
   */
  KEYMAP_M0116_ANSI(
    TRNS,
    ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,TRNS,TRNS,   TRNS,                 INS, HOME, PGUP, MUTE,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,                      DEL, END,PGDN, VOLU,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,    TRNS,                  TRNS, UP, TRNS,   VOLD,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,        TRNS,                   LEFT,DOWN,RGHT,
    TRNS,TRNS , TRNS, TRNS,         TRNS,      TRNS, CALC,PSCR,SLCK,BRK,                            TRNS,     TRNS,    TRNS
  ),
 
    /* Layer 2 :
   *                     +-------+
   *                     | FN1   |
   *                     +-------+
   * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
   * |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|     | |   |   |   |Mut|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |     |   |   |   |   |   |   |   |   |   |   |   |   |   | |   |   |   |VoU|
   * +-----------------------------------------------------+   | +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |   |      | |   |   |   |VoD|
   * +---------------------------------------------------------+ +---+---+---+---+
   * |      |   |   |   |   |   |   |   |   |   |   |Capslock| |   |   |   |   |
   * +---------------------------------------------------------+ +-------+---|   |
   * |Fn1|   |     |   |                   |   |Hom|End|PgD|PgU| |       |   |   |
   * +---------------------------------------------------------+ +-------+---+---+
   */
  KEYMAP_M0116_ANSI(
    NO,
    ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,F11,F12,          TRNS,                 TRNS, TRNS, TRNS, TRNS,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,      TRNS, TRNS, TRNS, TRNS,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,    TRNS,   TRNS, TRNS, TRNS,   TRNS,
    TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,        TRNS,      TRNS,TRNS, TRNS,
    TRNS,TRNS , TRNS, TRNS,         TRNS,      TRNS, TRNS,TRNS,TRNS,TRNS,              TRNS,     TRNS,    TRNS
  ),
};

const uint16_t PROGMEM fn_actions[] = {
ACTION_LAYER_TOGGLE(1), /*THIS IS MEANT TO ACTIVATE THE LAYER THAT IS LABELED LAYER 1*/
ACTION_LAYER_TAP_KEY(2, KC_CAPS),
};
/*copied from tufty's keymap
*/

sorry for the confusion

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: ADB to USB keyboard converter
« Reply #497 on: Thu, 17 September 2015, 22:13:51 »
Ah, you alreadly answered your problem yourself :D
You define only FN0 and FN1 but you are using undefined FN2.

I'd recommend you use this GCC C language extenstion in your keymap definition.
https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html#Designated-Inits

Voila, far less confusing now.
Code: [Select]
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* Layer 0 */
    [0] =  KEYMAP_M0116_ANSI(.....

    /* Layer 1 */
    [1] =  KEYMAP_M0116_ANSI(.....
    ....
};

const uint16_t PROGMEM fn_actions[] = {
    [1] = ACTION_LAYER_TOGGLE(1), /*THIS IS MEANT TO ACTIVATE THE LAYER THAT IS LABELED LAYER 1*/
    [2] = ACTION_LAYER_TAP_KEY(2, KC_CAPS),
};

Offline tominabox1

  • Posts: 288
Re: ADB to USB keyboard converter
« Reply #498 on: Fri, 18 September 2015, 06:44:22 »
Hasu - I'd like to use Scroll Lock as a layer indicator, can you help? I have not found anyone who has done this.

Offline tjweir

  • * Exquisite Elder
  • Posts: 1039
  • Location: Toronto
Re: ADB to USB keyboard converter
« Reply #499 on: Fri, 18 September 2015, 09:48:52 »
Hasu - I'd like to use Scroll Lock as a layer indicator, can you help? I have not found anyone who has done this.

Oh, that would be handy.