Author Topic: Macintosh M0110 USB converter  (Read 141440 times)

0 Members and 1 Guest are viewing this topic.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« on: Wed, 14 December 2011, 00:43:53 »

This firmware converts the protocol of Apple Macintosh 128K/512K/Plus Keyboards like M0110, M0110A(with keypad) and M0120(keypad) into USB. The retro keyboard can be revived connecting to mordern compter with this converter.




Preassembled TMK converter is available here! https://geekhack.org/index.php?topic=72052

Rev.2.5 Micro USB/ATMega32u2 with detachable cable




YOUR HELP NEEDED for International(ISO) keyboard support
To add international-layout M0110 support some help is needed.
If you have international-layout M0110 read this post.

https://geekhack.org/index.php?topic=24965.msg3152999#msg3152999



Supported Models
M0110


M0110A


More
M0110 + M0120


M0120







M0110 Protocol - Technical resources
https://github.com/tmk/tmk_keyboard/tree/master/converter/m0110_usb
https://github.com/tmk/tmk_keyboard/wiki/Apple-M0110-Keyboard-Protocol





Changes:
2012/05/26: M0110A is now supported. Thanks for your contribution, skagon!
2013/08: Change port for signals PF to PD
2013/09: Change port again, it uses inversely PD0 for data and PD1 for clock line now.
2015/03: Add support for "International"(ISO) keyboard(keymap_intl.c)
2015/07: Update keymap editor(for Rev.1)
2016/01: Updated keymap editor(for Rev.2)
2019/01: Reorgarnized first post a bit.  This thread is not dead :)
2020/09: Add NEED HELP section in this post
2024/01: Add Keymap Editor support for International layout  See Issue #771.





Build Hardware yourself
You need 4P4C cable and ATMega32U4 or ATMega32U2 dev board. Port of the MCU PD1 is assigned to CLOCK line and PD0 to DATA by default, you can change pin configuration with editing config.h.


4P4C Plug:
You can find 4P4C plug as phone handset cable if you don't have Mac keyboard cable.
http://en.wikipedia.org/wiki/Modular_connector#4P4C

NOTE: Original cable used with Mac is straight while phone handset cable is crossover. Close-up pics of handset cable. You can see one end of plug has reverse color codes against the other. Click to enlarge.
More




Socket pinout:
Quote

Mac 128k/512k/Plus Keyboard pinout
.---------,
| 1 2 3 4 | 1 GND
|         | 2 Clock
|         | 3 Data
`---___---' 4 5V
from front of socket on keyboard

This image displays pinouts on Mac side socket but same on keyboard side.
http://www.kbdbabel.org/conn/kbd_connector_macplus.png
http://old.pinouts.ru/Inputs/MacKeyboard_pinout.shtml



Pull-up resistor:
You are strongly recommended to have pull-up resistors on two signal lines though it might work well without them. In particular when you use long or coiled cable you probably need them.





Keymap Editor
You can use Keymap Editor to define your keymap and download firmware using web browser(Chrome is recommended).
http://www.tmk-kbd.com/tmk_keyboard/editor/



For preassembled TMK M0110 Converter(ATmega32u2):
- M0110 US layout: http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?m0110_usb
- M0110 International layout: Use this link
- M0110A layout: http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?m0110_usb_m0110a

For DIY converter with ATmega32u4:
- M0110 US layout: http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?m0110_usb_rev1
- M0110 International layout: Use this link
- M0110A layout: http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?m0110_usb_rev1_m0110a


Flash firmware
Refer this wiki page for how to flash firmware onto the converter.

https://github.com/tmk/tmk_keyboard/wiki#flash-firmware



Build Frimware
When Keyamp Editor is not enough for your need you can build firmware from source codes.

$ git clone git://github.com/tmk/tmk_keyboard.git
$ cd converter/m0110_usb
$ make
and program your controller with compiled firmware.

Firmware Source: https://github.com/tmk/tmk_keyboard/tree/master
See also:https://github.com/tmk/tmk_keyboard/tree/master/converter/m0110_usb





Locking CapsLock key support
See this entry. Use keycode 'LCAP' instead of 'CAPS' for the key in short. You can find it as 'Locking Caps Lock' in 'Function and Keypad' tab on Keymap Editor.
https://github.com/tmk/tmk_keyboard/#mechanical-locking-support


Turn locking CapsLock key into normal momentary
For M0110 and M0110A(Alps model): You need to get a descrete SKCC 'short stem' switch for locking switch replacement.

For M0110A(MITSUMI model): You can just remove locking mechanism of the switch easily instead of replacement. It still requires desoldering though.








TROUBLE WITH YOUR DIY CONVERTER?
You are using Pro Micro?
Confirm it is a 5V version with 16MHz crystal. Make solder bridge on J1 and use VCC for 5V power, not RAW.  MUST check this page also.

I'm never willing to recommend you to use Pro Micro unless you are already familiar to it and have skill to solve problems yourself. Pro Micro is bad choice especially if this is your first time project. Alternatives are PJRC Teensy2.0 and TMK converter, of course!

Please don't ask help for problem specific to Pro Micro here.

Don't ask help before placing pull-up resistors and trying solder on J1!

More
In most cases your wiring is wrong. Check your wiring yourself again and again, one hundred times! And try swapping wires at your own risk, note that your wiring are already wrong at this point probably :D It won't break your keyboard unless you are extremely unlucky.

Now you need help? OK. If you are not sure about your wiring, post pics of your hardware and wriring this really save our time. Don't save your time by omitting this. Shots of controller side and ADB connector/keyboard side would be helpful. If you edit code post your code. Don't hesitate to show your dirty code! Also output from hid_listen command would be useful to debug hardware and firmware.

[rant]
Don't take advantage of generosity of kind and helpful members(yes, including me, of course  ;))! Their time is more precious than your time, use your time to learn and look into your problem first.
[/rant]
« Last Edit: Mon, 29 January 2024, 02:13:40 by hasu »

Offline JMK

  • Posts: 31
pinout and connection
« Reply #1 on: Sat, 10 March 2012, 15:50:42 »
Hello.
I am jmk, a complete newbie here.
It is odd that I used to see many comments and discussions here, but suddenly they are all gone.
Anyway, inspired by hasu's mod of m0110, I also tried to do the mod in a slightly different but fundamentally the same way.
But I encountered a problem with figuring out pinout and connection between the keyboard and teensy.
I sent hasu a message, and he thinks it is better to discuss it publicly. So here is my question and hasu's answer.

I asked about the arrangement of the color of 4p4c because 4p4c is usually crossover-wired. So, for example, yellow can be either +5V or GND (to put is another way, it can be either #4, or #1)

Images below are the messages that I traded with hasu

[ Attachment Invalid Or Does Not Exist ] 43488[/ATTACH]
[ Attachment Invalid Or Does Not Exist ] 43489[/ATTACH]
[ Attachment Invalid Or Does Not Exist ] 43490[/ATTACH]

I hope this helps someone who has the same issue like me.

As I do the mod, I will post my questions and solutions.

Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #2 on: Sat, 10 March 2012, 16:26:48 »
I have tried to hand-wire the keyboard and teensy without using handset cable.
Based on the information of kbdbabel, I connected keyboard and teensy (directly from keyboard pcb to teensy).
The result was not very good.
Here is the result:
[ Attachment Invalid Or Does Not Exist ] 43491[/ATTACH]

As I strike each key, each letter is typed twice as shown above. After "\" key stroke, the keyboard stopped working, and I disassemble what I did today so far and reverted the keyboard to its original condition.
As soon as I retrieve an handset cable next week, I will try the mod in the exactly the same way that hasu did and post the result.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #3 on: Sat, 10 March 2012, 17:44:14 »
JMK, thanks for posting here again to share.

I tried the converter to test just now and it didn't register any keys at all without pull-up resistors.
Though I think it worked well without them last time, but it doesn't work today.

You might need to add two pull-up resistors on DATA and CLOCK lines in Teensy side in particular when you used long cable or coiled cable.
I used 1.5K Ohm resistors but 1K-10K will be OK.

Now I'm typing my M0110 through the converter with pull-up resistors. No problem.
My pull-up resistors is like this:

Offline JMK

  • Posts: 31
thanks
« Reply #4 on: Sat, 10 March 2012, 22:37:45 »
Thank you hasu
It seems like you plugged both ends of the resistors to clock/data and +5V. So clock and data ports have lines from the 4p4c connector cables and a leg of resistor, and +5V port has two legs of registers from data and clock as well as a line from the 4p4c connector cables.
I don't have resistors. So I think I will have to purchase a bunch of them on ebay or utilize some of the tiny little load resistors on an unused keyboard controller (mx8000, the switches and keycaps of which I used for another project.)
I will keep you updated on this thread.


Quote from: hasu;541592
JMK, thanks for posting here again to share.

I tried the converter to test just now and it didn't register any keys at all without pull-up resistors.
Though I think it worked well without them last time, but it doesn't work today.

You might need to add two pull-up resistors on DATA and CLOCK lines in Teensy side in particular when you used long cable or coiled cable.
I used 1.5K Ohm resistors but 1K-10K will be OK.

Now I'm typing my M0110 through the converter with pull-up resistors. No problem.
My pull-up resistors is like this:
Show Image

Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #5 on: Fri, 23 March 2012, 10:09:54 »
Hello.
I finally received a bunch of resistors, and add two to teensy.
[ Attachment Invalid Or Does Not Exist ] 45395[/ATTACH]
[ Attachment Invalid Or Does Not Exist ] 45396[/ATTACH]


I tried two different ways, but it still doesn't work. Maybe, the cord that I use is too long?
Can you identify what problem I have?
It is more difficult that I thought. Thanks though. It is a fun process.
« Last Edit: Fri, 23 March 2012, 10:12:21 by JMK »

Offline JMK

  • Posts: 31
images
« Reply #6 on: Fri, 23 March 2012, 10:20:24 »
I don't know why the images that I uploaded do not appear properly.
Here are the images again. I hope this works.

[ Attachment Invalid Or Does Not Exist ] 45399[/ATTACH]
[ Attachment Invalid Or Does Not Exist ] 45398[/ATTACH]
« Last Edit: Fri, 23 March 2012, 10:31:33 by JMK »

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #7 on: Fri, 23 March 2012, 10:43:25 »
It looks OK.  Hmm, I can't see your problem.
Your RJ plug has same color order as this?  From left yellow, green, red and black.


And you can use PJRC's 'hid_listen' tool to see debug print. This may help you if Teensy already can receive any signal from M0110.
« Last Edit: Sat, 21 September 2013, 01:44:08 by hasu »

Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #8 on: Fri, 23 March 2012, 10:48:23 »
Hi, thanks for the prompt response.
The connection is correct. I tested if the electricity flows to the keyboard's connection part.
I guess I need to see the debug print. Everything is new to me, and I don't know what exactly the "debug print" is, but I will just try.
Thanks again.

Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #9 on: Fri, 23 March 2012, 11:46:47 »
I guess its over midnight in Japan.
Here is the screen shot of what I got from debug print.
I first did not get any result, and I checked out the connection again. Obviously, the connection was not stable.
Now I got the result that I got when I did not have pull up resistors. Multiple entires are typed at one key stroke.
[ Attachment Invalid Or Does Not Exist ] 45410[/ATTACH]

Any idea?

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #10 on: Fri, 23 March 2012, 11:51:31 »
Congrat!
It seems to be working well and sending keys to PC.
Did you try to just type on editor or other apps?

EDIT: Ah you mean you get two chars per one key press? It is Odd.
« Last Edit: Fri, 23 March 2012, 11:56:38 by hasu »

Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #11 on: Fri, 23 March 2012, 15:00:20 »
It does not work properly yet. One of the problems that I had in the process was that the handset cable lines were very weak. They get cut off just too easily. So I had to remove the coat of each line several times. I will try to find a better way to connect the cord/resistor and teensy.

Offline JMK

  • Posts: 31
config.h
« Reply #12 on: Fri, 23 March 2012, 22:45:06 »
hello.
As I was working on teensy, I almost ruined the connecting holes. I tested them and confirmed that they are, strangely, still working, but I think I need a backup plan just in case.
[ Attachment Invalid Or Does Not Exist ] 45492[/ATTACH]

If I want to use the portion that marked in yellow rectangle to connect it with the cables, how should I modify your config.h?
The following is the original configuration:
#define M0110_CLOCK_PORT PORTF
#define M0110_CLOCK_PIN PINF
#define M0110_CLOCK_DDR DDRF
#define M0110_CLOCK_BIT 0
#define M0110_DATA_PORT PORTF
#define M0110_DATA_PIN PINF
#define M0110_DATA_DDR DDRF
#define M0110_DATA_BIT 1


IF I want to use D4 and D5 port along with GND and VCC on the same row, I guess...
#define M0110_CLOCK_PORT PORTD
#define M0110_CLOCK_PIN PIND
#define M0110_CLOCK_DDR DDRD
#define M0110_CLOCK_BIT 4
#define M0110_DATA_PORT PORTD
#define M0110_DATA_PIN PIND
#define M0110_DATA_DDR DDRD
#define M0110_DATA_BIT 5

will this be working?

Thank you again.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #13 on: Fri, 23 March 2012, 22:59:53 »
You are  right.
It should work.

Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #14 on: Sat, 24 March 2012, 15:15:40 »
Thanks.
Let me ask one more question.
Can cables be a problem?

[ Attachment Invalid Or Does Not Exist ] 45546[/ATTACH]

The cord that I use has the type of wire as seen the picture above. However I carefully strip the coat, I failed to strip it perfectly. So the inner fiber-like white thread is always exposed.
When I tried the mod, I just ignore the cable after I check that electric signals flows anyway.
Other than that, I don't know why my mod failed. It is really odd.

Currently, I just ordered 4p4c sockets and stripboards. I will try the mod without cutting the handset cord. Instead, I will solder the 4p4c socket and teensy on the stripboard, and wire them. This way, I can avoid ruining the cable, which I think is the problem of the failure, and probably I can make the mod a little more conveniently and neatly. Maybe I can later make a acrylic case.

Thanks hasu for your support.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #15 on: Mon, 26 March 2012, 10:37:54 »
I don't know exactly your problem but the white thread can cause bad solder.

What did you see when you press keys on M0110? You got characters doubly? or got nothing?

Offline JMK

  • Posts: 31
another way
« Reply #16 on: Mon, 26 March 2012, 13:39:21 »
Hi.
The screenshot that I uploaded on 23 Mar 2012, 16:46, is actually the "debug print" if my understanding is correct.
I see multiple characters.
Here it is again.
[ Attachment Invalid Or Does Not Exist ] 45827[/ATTACH]

I am going to do the mod this way as seen in the sketch below. Parts were ordered, but it's going to take several weeks cause it's delivered from hongkong as economy mail.
[ Attachment Invalid Or Does Not Exist ] 45828[/ATTACH]

If you have any comment please let me know.

Offline JMK

  • Posts: 31
my firmware
« Reply #17 on: Fri, 30 March 2012, 23:42:26 »
[ Attachment Invalid Or Does Not Exist ] 46493[/ATTACH]
Hello hasu
I was wondering if you would test my firmware. I see no hardware problem, so I guess there may be a software problem.
I merely changed the keymap suitable for mac (command, L-Alt, and Fn2) and "make" the hex file.
But it was my first time and I am not sure if it is properly done.

I changed the extension of the file as txt to upload it, otherwise the file cannot be uploaded. So I guess you need to simply remove "txt" to make it hex file.
Thank you.
« Last Edit: Fri, 30 March 2012, 23:44:29 by JMK »

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #18 on: Sat, 31 March 2012, 07:23:28 »
JMK,
I tried your binary but it didn't work. Port D4 is for clock and D5 for data in your pin configuration, right?
I can't get any debug print on hid_listen when I pressed a key and don't know why.

You had better not edit codes except for config.h until it works well once.
Try this. This changes pin configuration only.

Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #19 on: Sat, 31 March 2012, 17:28:45 »
I am sorry that I gave you misconception. I did not change config.h in my firmware yet. So the pinout is the same with your original code: F0 and F1 for clock and data respectively.
The only thing that I changed in the uploaded firmware here is the keymap.
Thank you for the hex file. I will try it with my next try.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #20 on: Sat, 31 March 2012, 18:53:47 »
Ah, sorry.
I tried yours with F0 and F1, it works well and also your keymap seems to be OK.
No problem with my M0110. I think your binary should work on your M0110.

Let me know result when you put some parts together.
« Last Edit: Sat, 31 March 2012, 18:56:10 by hasu »

Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #21 on: Sat, 31 March 2012, 21:58:27 »
If my firmware works for your m0110, maybe either my keyboard or teensy is the problem.
The parts arrive about ten days later. I will keep you updated.

Is there anyway that I can test my keyboard without the original Macintosh 128k/512k?

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #22 on: Sun, 01 April 2012, 09:16:31 »
Port on your Teensy can become out of order under severe conditions though this will not happen so often.
But still there is possibility of it, if you have suspect of it you can try some other ports by editing config.h.

I can't come up with  a way to test keyboard without Mac.

Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #23 on: Sun, 01 April 2012, 15:58:48 »
When my parts arrive, I will just try one last time with the same port. If the same thing happens or the keyboard doesn't work at all, I will try other ports like D4 and D5.
Thank you.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #24 on: Sun, 15 April 2012, 19:26:57 »
Looks like posts are removed with server incident so I re-post mine here:

JMK,
I found there are two different version of M0110 and they have different signal timing. Let's call them 'old' and 'new', this picture from lowpoly's mod article shows 'old' one at top and 'new' one at bottom.


At this time my firmware  seems to support only 'new' one and can't host 'old' one. Mine is 'new' one.
See this Github issue page for the detail: https://github.com/tmk/tmk_keyboard/issues/6
Github user skagon is working on support of 'old' M0110 and M0110A. It will be done before too long.

I guess your M0110 is 'old' and is not supported in my firmware. In fact which is yours?
I should let you know this before this, sorry. I think my code is problematic and not your M0110 probably.

I will check my M0110 PCB and look into your pic later.

Quote from: JMK
I tried the mod once more using your hex file, and it didn't work at all.
And I did "make" after modifying the config.h file once again and tried the mod again. Nothing happened.
So I opened the keyboard and tested the controller. Please see the image.

(Attachment Link)

As shown in the image, I tested the connection between "1" and the controller part, and I found its direct connection.
But the bx in yellow rectangle are all connected, probably short-circuit. Is it normal? If it's not, I think this is definitely the problem.
I checked some other pins of the controller, and there are more short-circuit.

I think I just need a new controller rather than a converter. Lowpoly's mod will my last option then.
Please let me know your thoughts.
Thanks.

Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #25 on: Mon, 16 April 2012, 00:42:29 »
Oh! I see.
Mine is the old one.
Well, there seems to be a problem with geekhack, and I find that my last post was erased.

After I posted my last reply, I have been studying humble hacker's keyboard firmware to use it for my m0110 (old).
If "skagon" comes up with a solution sooner or later, I will just wait and see. But humble hacker's source code is very helpful to make a keyboard controller for other projects.
And don't be sorry for anything. I enjoyed the whole process, though sometimes was frustrated.
Thank you.

Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #26 on: Mon, 23 April 2012, 15:18:24 »
The most recent three posts have bee erased again. It is weird.

Anyway, I tried Skagon's code this time without changing anything. My computer recognizes my m0110 but two characters are typed at one key stroke.
First I did not use resistors and second I added resistors, but the result is the same.

Maybe my keyboard is defective.

Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #27 on: Mon, 23 April 2012, 17:09:18 »
Here is what I did today.
Instead of cutting an end of the handset cable, I used a socket and a stripboard

[ Attachment Invalid Or Does Not Exist ] 48756[/ATTACH]

As I mentioned in the previous post, I tried both your and Skagon's firmwares. In the case of your firmware, I simply changed the port to use B0 and B1 (which is the default setting of skagon's)
My computer recognizes the keyboard (without resistors with your firmware as well), but two characters are typed at one key stroke.

I ordered m0110a and it is on its way to my place. I will try skagon's firmware with m0110a. If it works, it maybe a proof that my m0110 is defective.

************************
update:
I just received m0110a, installed skagon's firmware (original/no change), plugged in.
The result is the same, two characters at one key stroke.
I assume that it may have something to do with my computer or OS.
« Last Edit: Mon, 23 April 2012, 18:53:56 by JMK »

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #28 on: Mon, 23 April 2012, 19:00:29 »
Thanks for reporting.

Hmm, it is too bad...
Did you try OS key repetition setting or other OS than OSX?
I've never tried this converter on OSX.

Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #29 on: Mon, 23 April 2012, 22:22:42 »
I don't have windows machine. I did try on windows but as a virtual machine, and the result was the same.
What is interesting is that your firmware actually worked without pull up resistors.

Did you not say that you actually updated your code? If you come up with a solution please let me know. Thank you.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #30 on: Tue, 24 April 2012, 09:39:51 »
Ah, it seems to be problematic only on OSX.  I just remembered this bug which fixed one year ago.
http://geekhack.org/showwiki.php?title=Island:14290&viewfull=1&page=4&do=comments#post307392
Looks like the bug come back again at some point. Unfortunately I have no usable Mac to fix and verify now.

This tentative patch might cure the bug.
Code: [Select]

diff --git a/pjrc/usb.c b/pjrc/usb.c
index 2b69b6a..3e18144 100644
--- a/pjrc/usb.c
+++ b/pjrc/usb.c
@@ -657,6 +657,7 @@ ISR(USB_GEN_vect)
                        }
                }
                 /* TODO: should keep IDLE rate on each keyboard interface */
+/*
 #ifdef NKRO_ENABLE
                if (!keyboard_nkro && usb_keyboard_idle_config && (++div4 & 3) == 0) {
 #else
@@ -677,6 +678,7 @@ ISR(USB_GEN_vect)
                                }
                        }
                }
+*/
        }
 }


Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #31 on: Tue, 24 April 2012, 13:52:48 »
Thank you for the patch. I follow the link and noticed that I knew this thread. It was about "vendor id" right?
But I am not sure where I use your patch. Is it config.h? I did find "vendor id (0xfeed)" on line 25 in config.h.
Sorry. Please let me know how to use your patch. Thanks.


*******************
Hey!
Good news!
I just changed the vendor id to 0x05AC, and it works now. I will try to remap the code and re-make my hex file and try to type again.
Thank you so much. I will update this post after I update my code. Thank you again.


*******************
Now I am typing on my m0110. Everything works fine. I did not add pull up resistor, but it works just fine. But it once stopped working. I unplugged and replugged. It started working again. If stability is an issue without pull up resistors, I will add them later.

Well, I noticed that I have a couple of bad keys that needs to be repaired.

Another thing that I noticed is that compared to m0110a, m0110 is much heavier.

I have a question hasu. How do I toggle or enter other layers? If I hold fn2 key, I can use a wasd layer, but I don't know how to enter other layers.

Again, thank you for sharing your mod and code.
« Last Edit: Tue, 24 April 2012, 15:21:12 by JMK »

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #32 on: Tue, 24 April 2012, 20:28:50 »
Great!
I'll fix the bug of my firmware on Mac SET_IDLE behaviour at some point of near future.

My firmware has no 'software' layer toggle feature currently, you need to keep Fn key down to use a layer.
M0110 has a locking switch for CapsLock so you can assign Fn key into the key to get 'mechanical' toggle feature.

To use other layers you can hold ;(Fn0) for mouse key layer and hold /(Fn1) for cursor key layer.
These layers use 'vi editor like' key binding due to my preference.

Code: [Select]
    * HHKB/WASD Layer:
     * You can register Esc by hitting(press&release) Fn0 quickly.
     * ,---------------------------------------------------------.  
     * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet|  
     * |---------------------------------------------------------|
     * |Caps |Hom| Up|PgU|   |   |   |   |Psc|Slk|Pau|Up |Ins|  \|
     * |---------------------------------------------------------|
     * |Contro|Lef|Dow|Rig|   |   |   |   |Hom|PgU|Lef|Rig|Return|
     * |---------------------------------------------------------|
     * |Shift   |End|   |PgD|   |VoD|VoU|Mut|End|PgD|Dow|   Shift|
     * `---------------------------------------------------------'  
     *      |xxx|Alt |         Space               |Gui |xxx|        
     *      `-----------------------------------------------'
     * mouse key                                                                                      
     * ,---------------------------------------------------------.
     * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet|
     * |---------------------------------------------------------|
     * |Caps |   |   |   |   |   |WwL|MwD|MwU|MwR|   |   |   |   |
     * |---------------------------------------------------------|
     * |Contro|Vod|VoU|Mut|   |   |McL|McD|McU|McR|xxx|   |Return|
     * |---------------------------------------------------------|
     * |Shift   |   |   |   |   |Mb3|Mb2|Mb1|   |   |   |   Shift|
     * `---------------------------------------------------------'
     *      |   |Alt |         Mb1                 |Gui |   |
     *      `-----------------------------------------------'
Mw: Mouse wheel
Mc: Mouse cursor
Mb: Mouse button(1: left, 2: right, 3: middle)
     * cursor key
     * ,---------------------------------------------------------.
     * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet|
     * |---------------------------------------------------------|
     * |Caps |   |   |   |   |   |Hom|PgD|PgU|End|   |   |   |   |
     * |---------------------------------------------------------|
     * |Contro|   |   |   |   |   |Lef|Dow|Up |Lef|   |   |Return|
     * |---------------------------------------------------------|
     * |Shift   |   |   |   |   |   |Hom|PgD|PgU|End|xxx|   Shift|
     * `---------------------------------------------------------'
     *      |   |Alt |         Space               |Gui |   |
     *      `-----------------------------------------------'


Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #33 on: Tue, 24 April 2012, 22:05:39 »
Thank you so much.
So to use "cursor keys" layer, I need to press and hold Fn1 key, right?
I guess on mac osx, "mousekeys" layer is not working.
But "wasd" and "cursorkeys" layers are working very well.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #34 on: Wed, 25 April 2012, 00:02:26 »
I beleive mouse key feature was confirmed also on Mac about year ago.
But the SET_IDLE bug may affect this feature on Mac at this time.

Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #35 on: Wed, 25 April 2012, 09:44:39 »
Oh, I see. You assigned Fn0 to the ' key. If I press and hold the ' key, it types ''''''''''''''''''''''''''''''''''''''' like this, rather than enters the layer mode.
If Fn1 key, which is assigned to the / key, is pressed and hold, it enters the assigned layer mode.
Well, anyway, I am very satisfied with your converter, hasu. Without wiring and installing a new controller, I can use all the keys that the full size keyboard has.
In fact, except for HHKB, I don't even know if there is any keyboard that only has 58 keys with the capability of full size keyboard.
It's really great.

Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #36 on: Sat, 28 April 2012, 17:19:36 »
Hi
I just checked out your github repository. Your converter finally supports M0110A as well. It's fantastic! I will try it!

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #37 on: Sat, 28 April 2012, 22:38:26 »
Unfortunately M0110A support has bugs at this time and won't be done until I get the keyboard for development.
But I appreciate if you try my code and report.

Instead you can try skagon's repository which already used without problem for himself for a while.
https://github.com/skagon/tmk_keyboard
But it also has Mac SET_IDLE problem so you sill may need work around for it.
I mean, you will need this patch or use of Apple id(0x05AC) as VENDOR_ID in config.h.
https://github.com/tmk/tmk_keyboard/commit/e6f79b1e5aa083c892e2c077c15a762639c7848d

Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #38 on: Sun, 29 April 2012, 00:07:57 »
Hmm, I see.
In the case of skagon's firmware, changing vendor id did not work when I tried.
I will try the patch this time and report how it goes. Thank you for the links.

I wish we live near by so that I can lend my m0110a to you for your code development, which will eventually benefit my keyboard life. :-)

***********
update

Good news!
Your patch is very good. My m0110a has no problem with multiple characters at a stroke. I need to remap several keys. But other than that, it seems your patch solves the problem. Great!!!!


************
bad news
skagon's firmware stopped working after i changed the keymap.
I restored the firmware that worked previously, but it still doesn't work. lol
Maybe i made a mistake when restoring.
« Last Edit: Mon, 30 April 2012, 08:06:45 by JMK »

Offline skagon

  • Posts: 12
    • http://www.skagon.com
Macintosh M0110 USB converter
« Reply #39 on: Thu, 03 May 2012, 09:38:53 »
Hello there!
Yup, I'm the same skagon from GitHub.
I haven't yet understood if my fork works with your M0110A or not. Could you please elaborate on that?
Also, I don't have any Macintoshes around here -- well, I mean *modern* Macs -- so I don't know what's going on with those.
If everything works, after applying the Mac patch on my fork, I'd like you to do some tests for me. You could also read my (long) commentary from GitHub on the problems I ran into with the M0110A and shift keys and keypad and arrow keys. That should provide some insight on what to check. ;)

Thanks, guys!

Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #40 on: Thu, 03 May 2012, 13:20:35 »
Quote from: skagon;589009
Hello there!
Yup, I'm the same skagon from GitHub.
I haven't yet understood if my fork works with your M0110A or not. Could you please elaborate on that?
Also, I don't have any Macintoshes around here -- well, I mean *modern* Macs -- so I don't know what's going on with those.
If everything works, after applying the Mac patch on my fork, I'd like you to do some tests for me. You could also read my (long) commentary from GitHub on the problems I ran into with the M0110A and shift keys and keypad and arrow keys. That should provide some insight on what to check. ;)

Thanks, guys!

Hello skagon,
Thank you for your code.
Your code worked for my m0110a. After confirming that, I tried to modify some positions of keys and removed the small device inside Caps Lock key that holds the key when pushed. After then, for some strange reason, my m0110a started not working. So currently it is not working. It's a mystery.
By the way, it's nice to meet you, though we've never actually met. :-)

Offline skagon

  • Posts: 12
    • http://www.skagon.com
Macintosh M0110 USB converter
« Reply #41 on: Thu, 03 May 2012, 14:33:18 »
Hi JMK! Well, that's the beauty of the Internets! :P You can be better friends with someone you met on-line rather than your next-door neighbour.

Anyway... onto the case now. You said you did something with the caps lock key and now the keyboard isn't working? Or was it because you changed the keymap?
I haven't touched the keys of my A, well, apart from cleaning and some TLC and desoldering the controller and soldering an IC socket in its place, and lots and lots of cleaning. And cleaning. I guess the previous owners were pigs and used the keyboard as a plate for pizza, burgers and chips.
Anyway... can you get a multimetre and verify that the Caps Lock isn't shorted? You can test it from the back side of the PCB, by targeting the two solder points of the switch.
Besides, you can always download a fresh copy of my fork and rebuild from there. Then, it should work again. I can say from experience that the keymaps are very touchy pieces of "code". Make sure the compiler is actually compiling and not producing errors, and also you can use the HID_listen and see what debug info it's spitting out.
Somehow, I don't think you 'killed' your A by removing the locking mechanism.
On another note... I just love typing on this little baby. Much better feel than the plain M0110. The difference in cinematic terms is like comparing the "War Games" keyboard with the "Star Trek 4" "hello computer" keyboard. Oh wait, the "hello computer" keyboard actually *is* the M0110A... *shrug* hey ho... :)

Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #42 on: Thu, 03 May 2012, 20:08:25 »
Quote from: skagon;589271
Hi JMK! Well, that's the beauty of the Internets! :P You can be better friends with someone you met on-line rather than your next-door neighbour.

Anyway... onto the case now. You said you did something with the caps lock key and now the keyboard isn't working? Or was it because you changed the keymap?
I haven't touched the keys of my A, well, apart from cleaning and some TLC and desoldering the controller and soldering an IC socket in its place, and lots and lots of cleaning. And cleaning. I guess the previous owners were pigs and used the keyboard as a plate for pizza, burgers and chips.
Anyway... can you get a multimetre and verify that the Caps Lock isn't shorted? You can test it from the back side of the PCB, by targeting the two solder points of the switch.
Besides, you can always download a fresh copy of my fork and rebuild from there. Then, it should work again. I can say from experience that the keymaps are very touchy pieces of "code". Make sure the compiler is actually compiling and not producing errors, and also you can use the HID_listen and see what debug info it's spitting out.
Somehow, I don't think you 'killed' your A by removing the locking mechanism.
On another note... I just love typing on this little baby. Much better feel than the plain M0110. The difference in cinematic terms is like comparing the "War Games" keyboard with the "Star Trek 4" "hello computer" keyboard. Oh wait, the "hello computer" keyboard actually *is* the M0110A... *shrug* hey ho... :)

Hey! I am back again with good news!
I noticed when I desoldered Caps Lock switch, I actually ruined a small portion of the pcb pattern which disabled electric circuit.
I fixed the problem by wiring one pin of caps lock and one pin of L-shift. I already had the zip file of your code and started from the beginning to build my firmware.
I modified usb.c according to hasu's patch, and rearranged keymap a little bit. I assigned FN2 to BSLSH and LCTL to the actual Caps Lock key.
And the result is... IT WORKS!!!

The switches of M0110A (made in the US not somewhere else) feel better than M0110. M0110 is much heavier and noisier, though which are the attractiveness of M0110.
I like the arrow keys and DEL key assigned to "clear" key. I think I am going to use it as my primary keyboard for a while. My only complain is its right shift key, which is ridiculously small due to the up-arrow key. Well, anyway, M0110A is one of the most wonderful keyboard that I have ever used so far.

Thank you, skagon. It is really great.
« Last Edit: Thu, 03 May 2012, 21:37:51 by JMK »

Offline skagon

  • Posts: 12
    • http://www.skagon.com
Macintosh M0110 USB converter
« Reply #43 on: Thu, 03 May 2012, 22:14:37 »
I'm glad you got it working, mate. Actually, I did something similar with one of my M0110s. Dislocated the pad off the PCB, that is.

Anyhow... now that you've got it working, I'd like some feedback regarding the combination of shift plus arrow keys, you know, selecting text or something, shift plus keypad keys, etc. If you read my notes, that's the whole issue with the A keyboards: the fact that the arrows and the 'calc' keys are essentially the same keys, only the 'calc' keys are shifted arrow keys. I've really tried to make the code tell them apart, but I'd like to see how well my code works in various usage scenarios. Ok, realistically, there's no reason you should press the calc keys with shift since they don't do anything, but I don't know, someone else might have mapped them as different keys. Also, the arrow keys plus shift, that's not such a far-fetched scenario. Basically what I'm interested in is to see how well the keyboard behaves when the shift and arrow/calc/pad/whatever keys are pressed or released simultaneously. And yeah, I already know that sometimes, pressing shift and one arrow key simultaneously, will produce a calc key event. I'm sorry, that can't be helped. I want to know if it happens too frequently for your typing patterns, if it's noticeable, if anything else weird happens, **** like that.

Incidentally, the keypad numerical keys when combined with shift change to arrow keys (8, 4, 6, 2), page up/down (9, 6), home/end (7, 1) and insert/del (0, dot) BY DEFAULT. So, if you need these keys, you don't really *have* to assign extra layers, if the layout and un-combina-bility with 'shift' doesn't concern you. Personally, I kinda need them, so the only extra layer I'm using is utilising the (unmodified) Caps Lock.

Actually, I too love the feel of the A and even though I can't really use it as a primary, when it comes to just typing text (which is mostly linear), I'm using that. For the rest, I've got an... Apple A1048! Yeah, I guess these guys knew how to make good keyboards... up until they started those chiclet things.

Oh, and... mainly, thank tmk who made the bulk of the code. I just made sure it's working with the A. ;)
[Well, ok, in all fairness, dealing with the keypad and shift codes was a *****... :P]

Offline skagon

  • Posts: 12
    • http://www.skagon.com
Macintosh M0110 USB converter
« Reply #44 on: Sat, 12 May 2012, 08:23:13 »
I seriously don't know what the hell's going on here... it's like groundhog day! You come back and everything's the same, posts missing etc.
...

Anyway, JMK you might want to recheck my code, just to be on the safe side... ;)

Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #45 on: Sat, 12 May 2012, 14:53:56 »
Quote from: skagon;590604
I seriously don't know what the hell's going on here... it's like groundhog day! You come back and everything's the same, posts missing etc.
...

Anyway, JMK you might want to recheck my code, just to be on the safe side... ;)

Yeah. most recent posts keep being erased. Well. I just want to let you know that I have not found anything wrong with your code so far.
I will try your new code and post the result here again sometime soon. See you then.

Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #46 on: Sat, 12 May 2012, 15:27:46 »
Hey skagon.
I just tried your most recent code and have not notice any problem or mis-behavor whatsoever.
Only problem for mac user is "RALT." Mac users must redesign their keymap for their own convenience. Other than that, there is no problem.

Offline YakMN

  • Posts: 35
Macintosh M0110 USB converter
« Reply #47 on: Mon, 14 May 2012, 22:47:26 »
I just wanted to thank TMK for the adapter mod I have been looking for, for like 5 years. I had hoped KDBabel would work out, but it never quite got there. I couldn't figure out the keyboard hack that the guy with the mac-mini-in-a-mac512 case did (also incredible mod overall). THIS, however, I can do. Especially now that JMK and Skagon and TMK have been so great in ironing out bugs. Can't wait for the Teensy to get here!!.

TMK, if I was going to Tokyo this year, I'd drop off a M0110A for you, but sadly, I'm skipping this year. You'll probably have one by next summer, but if not, let me know.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #48 on: Tue, 15 May 2012, 12:45:14 »
Hi YakMN, welcome to GeekHack!
I finally got my M0110A yesterday so I can do things for this keyboard now.

skagon, thanks for your commentary on the code. I saw your code in action and it works well.
And I could debug and fix some problems of my code due to my M0110A and my code seems to work well too.
I'll look into your code in detail and compare its behaviour with mine later on.

BTW My M0110A(made in Japan/Mitsumi  switch) is very bad shape, it has dirty rust on mounting plate and some faulty switches. And I don't feel better with Mitsumi swtich than M0110 ALPS so far. My M0110 is way better than this lame board though it is just heavier. This comparison is not fair because my m0110 was completely overhauled and lubricated thoroughly. Above all  I love compact and minimalist keyboard :)

Offline snoopy

  • The Flying Ace
  • * Elevated Elder
  • Posts: 1828
  • Location: Industrial Environment
  • Gone with the Wind
Macintosh M0110 USB converter
« Reply #49 on: Wed, 16 May 2012, 16:37:52 »
Now, that I finally got my m0110, I don't know what to do.... Replacing the complete pcb or only usimg a teensy as adapter? What are the advantages/disadvantages?

Offline skagon

  • Posts: 12
    • http://www.skagon.com
Macintosh M0110 USB converter
« Reply #50 on: Wed, 16 May 2012, 17:16:31 »
Hasu, I don't know if you've got some private code version mate, but I just checked your latest code from GitHub and... it's not working for me. I mean, yeah, the main keyboard is ok but the arrows and calc keys send out letter code (Z, C etc), and the main keypad keys are all wrong; for example, key '1' sends out '2', key '6' sends out '=', the keypad 'enter' key sends out G or something... I don't know if it's working for you or how it could do that. From what I see, you need some major redesigning. Moreover, there's no code that deals with key misinterpretations like my code does -- i.e. when a shift plus calc release gets misinterpreted as arrow or the opposite. I could even point out the code pieces in your code which are wrong (if you don't mind).
Actually, JMK could you try Hasu's recent code on the M0110A branch and verify what I'm saying?

Incidentally, I just **LOVE** the Mitsumi switches so, if you don't want the keyboard I'd love to have it.

@snoopy : please, please don't butcher the keyboard, mate! Why would you want to replace anything, since you can use the adapter and keep it in its original state? If it's in working condition, I'd strongly... beg you not to butcher the keyboard. If it's not working at all, which means the circuitry is fried, then yes, by all means... replace the PCB.

Offline snoopy

  • The Flying Ace
  • * Elevated Elder
  • Posts: 1828
  • Location: Industrial Environment
  • Gone with the Wind
Macintosh M0110 USB converter
« Reply #51 on: Wed, 16 May 2012, 17:49:22 »
I didn't look at the code yet, but is there the possibility to use a second layer?

Offline skagon

  • Posts: 12
    • http://www.skagon.com
Macintosh M0110 USB converter
« Reply #52 on: Wed, 16 May 2012, 18:10:10 »
snoopy, there's the option to use up to 7 layers, as the code is right now. Is that enough? :D

Offline snoopy

  • The Flying Ace
  • * Elevated Elder
  • Posts: 1828
  • Location: Industrial Environment
  • Gone with the Wind
Macintosh M0110 USB converter
« Reply #53 on: Wed, 16 May 2012, 18:13:28 »
Only 7?

:-p ok, that sounds good... So I will first try the adapter

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #54 on: Wed, 16 May 2012, 21:55:14 »
8! if you count default layer :)
As long as you have extra flash program memory you will be able to increase layers in theory.

snoopy,
You can keep your precious keyboard intact using this converter. If you are a keyboard collector this will be preferable.
lowpoly's mod make your board a retro-look complete modern USB keyboard with NKRO feature. If you use layers intensively NKRO will be useful or must-have. 2KRO keyboard will fail to register certain multiple key combinations sometime though in most case 2KRO is enough.
Anyway try our converter first!

skagon,
Weird. It looks like same behavior of my previous code with bugs or 'master' branch. Are you sure it is latest 'm0110a' branch? My latest commit in 'm0110a' branch is "f5f48c2a24...". Please check again.

My Mitsumi switches may be in worst shape... Some switches has rust even on its contact! Looks like I got a completely junk board :(
Now two more M0110A is on the way :^) one is 'made in USA' which maybe has ALPS, another 'made in Japan' has Mitsumi SW for replacement.

Offline skagon

  • Posts: 12
    • http://www.skagon.com
Macintosh M0110 USB converter
« Reply #55 on: Thu, 17 May 2012, 00:37:42 »
hasu, actually you were right about the first part: I had downloaded an older commit. Now, I did download the latest. Actually, the keys are working properly... sort of. Sorry to be raining on your parade, mate.
The arrow keys and keypad keys are working perfectly... on their own. However, the moment you combine them with shift, as I had experienced when debugging my code... it's like deja vu. You can see it yourself, with *all* the keypad and arrow keys. Press shift, press any keypad or arrow or calc key and try to release them simultaneously. After a few tries, you'll see what I mean. Just open notepad and input a few lines of text. Then try what I'm saying. Shift, any arrow/keypad/calc key, release together. What you'll get will be stuck keys repeating ad infinitum, until you press them again. Sometimes it's the shift stuck along with an arrow key, sometimes it's just a keypad key misinterpreted, sometimes a keypad key stuck. That's what all those "ifs" and checks in my code are for.
I mean, you've dealt with the multiple return codes in a different way than I have, but you still need those checks to correct the misinterpretations. And as you can see from my code, you'd need to be outside m0110.c to do that. In fact, you need to add those checks in the matrix.c file, so that you can add checks for already pressed keys that their release gets misinterpreted. I have noticed that you're really trying to keep the code additions inside m0110.c for some reason, which I don't know.
Also, I've noticed you're using only 'immediate' commands. I don't know, I don't like it, even though it *could* be somewhat helpful, in that it makes simultaneous key releases more improbable. However, I like to be doing things "by the book", as per Apple specifications, so I prefer to stick to the 'inquire' command for the most part. It also keeps the communication frequency down. With the 'immediate' command, you get a LOT more inquiries per second than with 'inquiry'. I estimate around 5-10x more, given that the 'inquiry' command results in around 5 scans per second (my code and your older code) and the 'instant' command gets around or more than 50. I don't think I like that a lot...
Anyhow... that's all for now. I hope you don't take it the wrong way, I'm not trying to discard your code or anything. I'm just reporting back.
Oh, one last thing: where the hell do you find all these keyboards? I'd like one or two more Mitsumi M0110As but I can't seem to find any (at a reasonable price).

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #56 on: Thu, 17 May 2012, 11:27:37 »
Quote from: skagon;594428
hasu, actually you were right about the first part: I had downloaded an older commit. Now, I did download the latest. Actually, the keys are working properly... sort of. Sorry to be raining on your parade, mate.
The arrow keys and keypad keys are working perfectly... on their own. However, the moment you combine them with shift, as I had experienced when debugging my code... it's like deja vu. You can see it yourself, with *all* the keypad and arrow keys. Press shift, press any keypad or arrow or calc key and try to release them simultaneously. After a few tries, you'll see what I mean. Just open notepad and input a few lines of text. Then try what I'm saying. Shift, any arrow/keypad/calc key, release together. What you'll get will be stuck keys repeating ad infinitum, until you press them again. Sometimes it's the shift stuck along with an arrow key, sometimes it's just a keypad key misinterpreted, sometimes a keypad key stuck. That's what all those "ifs" and checks in my code are for.


Thank you, skagon. You are very helpful and patient with me :D
Ah, I see. I seemed to miss the case of simultaneous release keys carelessly. Do you have other test cases I should try?


Quote

I mean, you've dealt with the multiple return codes in a different way than I have, but you still need those checks to correct the misinterpretations. And as you can see from my code, you'd need to be outside m0110.c to do that. In fact, you need to add those checks in the matrix.c file, so that you can add checks for already pressed keys that their release gets misinterpreted. I have noticed that you're really trying to keep the code additions inside m0110.c for some reason, which I don't know.


My intention is just to stuff code of protocol process into one compact file instead of clutter of code. It is a encapsulation or modular of code for better ease of use with other project. I prefer to push a protocol code into one file if possible.


Quote

Also, I've noticed you're using only 'immediate' commands. I don't know, I don't like it, even though it *could* be somewhat helpful, in that it makes simultaneous key releases more improbable. However, I like to be doing things "by the book", as per Apple specifications, so I prefer to stick to the 'inquire' command for the most part. It also keeps the communication frequency down. With the 'immediate' command, you get a LOT more inquiries per second than with 'inquiry'. I estimate around 5-10x more, given that the 'inquiry' command results in around 5 scans per second (my code and your older code) and the 'instant' command gets around or more than 50. I don't think I like that a lot...
Anyhow... that's all for now. I hope you don't take it the wrong way, I'm not trying to discard your code or anything. I'm just reporting back.


I use 'instant' command to make main loop faster as possible. 'Inquiry' command often blocks controller some hundred milli-seccond and other process code can't run during this without proper reason. I think there is no reason to limit scan rate low if the keyboard goes wrong.
I want to scan keyboard and run main loop every tens of milli-second or less. Actually keymap layer switching code depends on this frequency of main loop. Long blocking of 'inquiry' caused a latency of layer switching which user can perceive.


Quote

Oh, one last thing: where the hell do you find all these keyboards? I'd like one or two more Mitsumi M0110As but I can't seem to find any (at a reasonable price).


You can easily find the boards at 2000-4000yen on Yahoo Japan Auction. Looks like a cheap junk board occasionally comes up at less 1000yen.
Most of boards has exotic Japanese legends, US layout is a bit rare in Japan. I'm not sure whether these are reasonable or not. If you are interested PM me.

http://page9.auctions.yahoo.co.jp/jp/auction/k145664300
http://page11.auctions.yahoo.co.jp/jp/auction/n111542144
http://page.auctions.yahoo.co.jp/jp/auction/153713302
http://page5.auctions.yahoo.co.jp/jp/auction/e122481874

Offline YakMN

  • Posts: 35
It works! Thanks Guys!
« Reply #57 on: Fri, 18 May 2012, 00:51:32 »
Hasu and Skagon and JMK:

Thanks a ton. I got my teensy today (fast!), so I whipped up the adapter. 1 hr 15 mins from cold start (including unsoldering the telephone handset-like socket, downloading teensy load and the AVR stuff) to a fully working M0110 keyboard on OS X. Another 30 mins to fine tune the keyboard map to my tastes. Wow. I've been wanting to have this for at least 4-5 years. And you guys gave it to me in less than 2 hours. incredible.

I haven't tried any M0110A keyboards yet. THe first M0110 I tried had a bad backspace key, but the second has all keys working. I didn't want to ruin the night by plugging in a M0110A and having mixed results. This works perfectly. I didn't really have any intention of using the Plus keyboard anyway, one of the reasons I like the 128K keyboard is the compact aspect.

Anyway, thanks again!

Offline skagon

  • Posts: 12
    • http://www.skagon.com
Macintosh M0110 USB converter
« Reply #58 on: Fri, 18 May 2012, 15:56:14 »
@YakMN: Don't thank me, mate! :D It's unfair for hasu who wrote the code. I've just written the code for the M0110A compatibility. :D Incidentally, if you don't want your -A keyboard, and it's made in Japan... I want it! :D

@Hasu: Taking things from the top, no, I can't think of any other tests I'd have you do. The whole problem is telling apart when the shift key is from a user-press or an automatic calc key, or both!
About the code... well, mate, you already have a separate matrix.c file for M0110, what's the problem in adding some more code in there? It's not like, we're adding code in some 'outside' general file! It's still kept inside the M0110/A bundle.
About the 'instant' vs 'inquire'... I can understand what you're saying. However, I don't know the consequences of over-using 'instant' and pushing the keyboard m/c in sending reports every 10msec or less, when it's supposed to send them once every 200-250msec or so.
Besides, I just use one extra layer, assigned to the switching Caps Lock, so I don't care about timing issues and pressing keys at the same time. Actually, the M0110A has enough keys so that you don't need many layers, since it's got a numpad, arrows etc. Essentially, the only reason you need layers is the F-keys, Escape and... that's about it! :D

On the keyboards... well... looking at the Euro-Yen rate, some of those keyboards are ok, but I'd also have to know the shipping price. I would definitely want 2 of those, if they're the "made in Japan" - Mitsumi switch variety. I had no idea you guys in Japan are all over Yahoo auctions!

Offline YakMN

  • Posts: 35
Macintosh M0110 USB converter
« Reply #59 on: Fri, 18 May 2012, 21:39:18 »
Skagon: 3 of my Plus keyboards have Made in Japan on the back. Those keys definitely feel different than the one Plus keyboard I have which says made in USA. The made in USA one feels exactly like the M0110 keyboards I have, while the Made in Japan Plus ones feel closer to maybe an Apple Extended Keyboard. Lighter touch, less "dull" if you will. I wish I had an M0110 with those switches, to be honest. The USA plus keyboard I have is beige, the Japan plus keyboards are all platinum, so maybe they switched to making them in Japan at the point they switched to the platinum pluses. Or it's just a coincidence.

Hasu: in another geekhack post, you showed a pic of some rubber material you put into the M0110 to deaden the sound. Any idea where one buys that kind of thing? I tried googling rubber sheets and whatnot, but there are so many kinds of rubber I have no idea what I'm looking at. Did you get yours online, or do they maybe sell it in craft stores?

Offline skagon

  • Posts: 12
    • http://www.skagon.com
Macintosh M0110 USB converter
« Reply #60 on: Fri, 18 May 2012, 21:51:22 »
Well, the keyboard I have, and the ones I'm looking for, are like this one here: http://deskthority.net/keyboards-f2/macintosh-plus-keyboard-t472.html
So, if any of you have one or two and wouldn't mind parting with it for a *reasonable* price (*not* the $100 they ask in eBay), let me know! :D

Offline YakMN

  • Posts: 35
Macintosh M0110 USB converter
« Reply #61 on: Fri, 18 May 2012, 23:05:11 »
Yep, they look like that (3 of them anyway). I haven't cracked one open in a long while, so I'd have to do that and confirm what the switches look like. I also haven't checked any of them for broken switches in a few years. I'd be happy to work out something on the price, but won't shipping make it cheaper to get one from someone in Europe anyway?

Offline YakMN

  • Posts: 35
Anyway to map shift + backspace to DEL?
« Reply #62 on: Fri, 18 May 2012, 23:07:54 »
I thought this was a mac system functionality, but maybe it is in the keyboard. I am used to hitting shift-backspace on laptop keyboards, and getting DEL functionality. Is there anyway to map that with the M0110s?

Offline skagon

  • Posts: 12
    • http://www.skagon.com
Macintosh M0110 USB converter
« Reply #63 on: Sat, 19 May 2012, 00:03:08 »
Well, mate... thing is, there are none for sale in Europe right now, and they only come up once in a blue moon. And you never know if the one that comes up will be the correct one (i.e. made in Japan and with Mitsumi switches). So, I'd rather give you or Hasu the money and get it done.
Also, I don't really care about working PCB, since I want them for spare parts anyhow. Actually, I think Hasu should have the best deals, since there should be lots of non-working Mitsumis in Japan... Not so sure about shipping cost from Japan, though...

On the Shift-Backspace thing... uhm... actually, I think my code can very easily be adapted to provide that kind of functionality, even without a separate layer, since it's checking for Shift events all the time! :D

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #64 on: Sat, 19 May 2012, 05:48:13 »
Quote from: skagon;595663
Well, mate... thing is, there are none for sale in Europe right now, and they only come up once in a blue moon. And you never know if the one that comes up will be the correct one (i.e. made in Japan and with Mitsumi switches). So, I'd rather give you or Hasu the money and get it done.
Also, I don't really care about working PCB, since I want them for spare parts anyhow. Actually, I think Hasu should have the best deals, since there should be lots of non-working Mitsumis in Japan... Not so sure about shipping cost from Japan, though...

You can find shipping cost from Japan here: http://www.post.japanpost.jp/cgi-charge/index.php?lang=_en
M0110A weighs about 1.2Kg. Let's see cost of 1.5Kg package to Greece...

EMS: 3700yen
Air small packet: 2310yen
SAL small packet: 1580yen
Surface small packet: 1080yen

Not bad.
If your package weighs less than 2.0Kg you can use 'small packet' option to get lower rate.
EMS is most reliable but expensive. I'll recommend SAL(small packet).


Quote

On the Shift-Backspace thing... uhm... actually, I think my code can very easily be adapted to provide that kind of functionality, even without a separate layer, since it's checking for Shift events all the time! :D


Right. At this time there is no easy way. You'll need to write some code to do Shift-Backspace thing. Or very tricky layer definitions may help but I'm not sure.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #65 on: Sat, 19 May 2012, 11:11:10 »
Quote from: skagon;595502

@Hasu: Taking things from the top, no, I can't think of any other tests I'd have you do. The whole problem is telling apart when the shift key is from a user-press or an automatic calc key, or both!
About the code... well, mate, you already have a separate matrix.c file for M0110, what's the problem in adding some more code in there? It's not like, we're adding code in some 'outside' general file! It's still kept inside the M0110/A bundle.
About the 'instant' vs 'inquire'... I can understand what you're saying. However, I don't know the consequences of over-using 'instant' and pushing the keyboard m/c in sending reports every 10msec or less, when it's supposed to send them once every 200-250msec or so.
Besides, I just use one extra layer, assigned to the switching Caps Lock, so I don't care about timing issues and pressing keys at the same time. Actually, the M0110A has enough keys so that you don't need many layers, since it's got a numpad, arrows etc. Essentially, the only reason you need layers is the F-keys, Escape and... that's about it! :D


You are right. It is not a real problem becuase the code still be inside M0110 bundle as you said.
But I'm trying to make the code fit into one file. I just prefer one file though I'm not sure if it is possible. Just my preference.

I use normal keys like ';' and '/' as Fn key to get mouse key and cursor key. In this case timing is very critical for layer switching code.
Like if you press and release ';' key in 150ms then ';' is registered, if you hold ';' key in more than 150ms  a layer switching will occur and etc...
These complicated and mess code in layer.c depends on fast main loop iteration unfortunately. (It'll be possible to rewrite them using timer interrupt.)
And this is a must-have feature for me and one of main reasons that I wrote this keyboard firmware.

I'm very fanatic about keyboard layers for my laziness. I don't want to move my hand to use mouse and cursor keys. :D

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #66 on: Mon, 21 May 2012, 20:55:16 »
To fix key stuck problem I made following test cases for special key operations, and managed to have my code pass the tests. I think these tests are not complete but reasonable and enough to avoid the problem. Any other key combination to consider?

My latest code for M0110A is commit:805ce3c13 on 'm0110a' branch.
https://github.com/tmk/tmk_keyboard/tree/m0110a

skagon,
I confirmed your code pass most of the tests at my local rig only except case3.
To test this case you can hold Shift before then release Shift and press Arrow(Down). This will cause registered Insert(I think this is not problem) and stuck Shift key. Can you check this?


Code: [Select]

/*
Handling for exceptional case of key combinations for M0110A

Shift and Calc/Arrow key could be operated simultaneously:

    Case Shift   Arrow   Events          Interpret
    -------------------------------------------------------------------
    1    Down    Down    71, 79, DD      Calc(d)*a *b
    2    Down    Up      71, 79, UU      Arrow&Calc(u)*a
    3    Up      Down    F1, 79, DD      Shift(u) *c
    4    Up      Up      F1, 79, UU      Shift(u) and Arrow&Calc(u)*a

    Case Shift   Calc    Events          Interpret
    -------------------------------------------------------------------
    5(1) Down    Down    71, 71, 79, DD  Shift(d) and Cacl(d)
    6(2) Down    Up      F1, 71, 79, UU  Shift(u) and Arrow&Calc(u)*a
    7(1) Up      Down    F1, 71, 79, DD  Shift(u) and Calc(d)
    8(4) Up      Up      F1, F1, 79, UU  Shift(ux2) and Arrow&Calc(u)*a

During Calc key is hold:
    Case Shift   Arrow   Events          Interpret
    -------------------------------------------------------------------
    A(3) ----    Down    F1, 79, DD      Shift(u) *c
    B    ----    Up      79, UU          Arrow&Calc(u)*a
    C    Down    ----    F1, 71          Shift(u) and Shift(d)
    D    Up      ----    F1              Shift(u)
    E    Hold    Down    79, DD          Normal
    F    Hold    Up      79, UU          Arrow&Calc(u)*a
    G(1) Down    Down    F1, 71, 79, DD  Shift(u)*b and Calc(d)*a
    H(2) Down    Up      F1, 71, 79, UU  Shift(u) and Arrow&Calc(u)*a
    I(3) Up      Down    F1, F1, 79, DD  Shift(ux2) *c
    J(4) Up      Up      F1, 79, UU      Shift(u) and Arrow&Calc(u)*a

    Case Shift   Calc    Events          Interpret
    -------------------------------------------------------------------
    K(1) ----    Down    71, 79, DD      Calc(d)*a
    L(4) ----    Up      F1, 79, UU      Shift(u) and Arrow&Calc(u)*a
    M(1) Hold    Down    71, 79, DD      Calc(d)*a
    N    Hold    Up      79, UU          Arrow&Calc(u)*a

    Where DD/UU indicates part of Keypad Down/Up event.
    *a: Impossible to distinguish btween Arrow and Calc event.
    *b: Shift(d) event is ignored.
    *c: Arrow/Calc(d) event is ignored.
*/

Offline skagon

  • Posts: 12
    • http://www.skagon.com
Macintosh M0110 USB converter
« Reply #67 on: Tue, 22 May 2012, 14:57:51 »
Ooops... I forgot to post an answer!
Hm, you're right actually. I added a simple check in matrix.c and have uploaded an update in GitHub around 15 hours ago. Essentially, I am solving that issue by noticing whether the shift event and the subsequent key event are reverse -- i.e. shift release and key press or shift press and key release. Since calc keys cannot and will never transmit a sequence like "F1 79 1B" or "71 79 8D", I just make sure that it registers as two separate events, i.e. shift event and arrow event.
I have to admit that that hadn't occured to me before (otherwise I would have fixed it) and it was rather hard to reproduce. In any case, thanks for the input. Now it's solved. ;)

In any case, we're talking about rather impossible combinations and I guess the main thing is that we don't have 'stuck' keys. Everything else is just a mere inconvenience. And you got an 'insert' key because I have mapped the keypad '=' to be insert, since I use that all the time for "paste". Yup, I know, I'm an old timer. Back in my MS-DOS days, we used ctrl-ins for copy and shift-ins for paste. I still use them. :D
Just like I'm not particularly interested in many layers. The M0110A has enough keys for my taste, so the only layer I need is the one with the F-keys and ESC. Everything else, I don't care about. "Mouse" keys and the likes, I never use... even the audio keys I very rarely use, even though I've got them on my main Apple keyboard by default. I'm just used to the plain old 101-key layout. Don't even care about "Windows" and "menu" keys. I've got them disabled. They just get in the way. Call me quaint.

Anyhow... the shipping prices are ok, especially the surface. What's that "SAL"? Sounds like "Sent And Lost" to me. :P
So, would you be willing to get a couple of M0110A's for me? How do I pay you back? Paypal?

@YakMN: you can actually make an M0110 keyboard with Mitsumi switches yourself! Just unsolder the switches from one of your As and solder them onto an M0110 board (after you remove the old Alps, of course). Simple! Anyway... if you'd want to part with one or two of your keyboards... and match that Japan price... by all means. ;)

Offline YakMN

  • Posts: 35
Macintosh M0110 USB converter
« Reply #68 on: Tue, 22 May 2012, 21:22:22 »
Skagon: I was actually thinking about doing that. I'm not sure it would be "better", just different. I'm kind of fond of the clunky sound the M0110 makes. What I'm more interested in is grafting keys from a Model M into an M0110 frame. I'm having a little trouble getting used to the cursors being on another layer. I first had them on the default layer, in the upper right corner, thinking I don't use =, [, ], and \ much. Which is true... except for when coding. Oh, that = is used A LOT!  Now I have cursors on a layer, but the delay is a bit weird for me. If I only wanted one layer, and was only ever going to use the capslock key for it, is there a way I can remove the delay? (I mean, delay before the layer kicks in).

Do you guys ever get situations where the keyboard stops responding? I have to unplug the USB and plug it back in every once in a while. Sometimes, I have to fire up teensy and hit the button on the board so it reloads or reboots or something. Maybe something wrong with my wiring? I didn't do the pullups.

M0110A:

As near as I could tell, it was going to be about $30 to ship by US mail to Athens. I checked UPS, but it was about a billion dollars. I popped a key off one the other day, and they look just like that photo in the link you sent. I checked on ebay, and oh my... are those guys actually getting buyers for those keyboards? $150? you can still get a whole mac plus around here for $50-150 on craigslist. Let me know what you want to pay. I'm sure we can work something out. If you need it in a hurry though, I'm not sure, because I'm prepping for a critical work trip, and have very little free time at the moment. Maybe better to get one from Hasu in that case.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #69 on: Tue, 22 May 2012, 23:44:47 »
I tried your new code and confirmed cure of case 3 but found new problem in case 4.
If you press Shift and Arrow simultaneously you'll get stuck Shift and Arrow key but Up Arrow has no problem.  I don't know why. It is weird.
And out of my test cases I found another problem: Holding a Calc key(keypad =/*+) then press Shift you'll get '+'(main part key not keypad) and the key get stuck. It is also weird.

Yeah. Key layout/layer thing depends completely on personal preference. No one universal configuration.
Any time users want to use their favorite layout they can fork the code to edit and it is welcome.

Quote from: skagon;597786
Anyhow... the shipping prices are ok, especially the surface. What's that "SAL"? Sounds like "Sent And Lost" to me. :P
So, would you be willing to get a couple of M0110A's for me? How do I pay you back? Paypal?
Paypal is OK. Send a private message to me on GeekHack or GitHub to talk about this further.

Quote
@YakMN: you can actually make an M0110 keyboard with Mitsumi switches yourself! Just unsolder the switches from one of your As and solder them onto an M0110 board (after you remove the old Alps, of course). Simple! Anyway... if you'd want to part with one or two of your keyboards... and match that Japan price... by all means. ;)

Footprint of ALPS and Mitsumi is not compatible. I don't think you can put Mitsumi on M0110's PCB.

Offline skagon

  • Posts: 12
    • http://www.skagon.com
Macintosh M0110 USB converter
« Reply #70 on: Wed, 23 May 2012, 00:03:51 »
Yak, mate, I know exactly what you mean about the prices. Like, $135 is the cheapest you can get? Get real, dude! Yeah, I get the whole "collector" thing but the truth is, you're selling a three-decade-old keyboard! A KEYBOARD! Not a computer! A KEYBOARD! FOR A COMPUTER! That was MASS PRODUCED! I mean, WTFH? It's not like you're selling the keyboard of, I don't know... "FM Towns" or some other exotic computer that only... I don't know... 3 were ever built!
Anyways, I'm ranting... So, I got my first and so far only -A at the bargain price of... £5 plus £20 shipping costs from the UK. Yes, it was one hell of a bargain. Right now, I have another offer for a Japanese one for $25 plus shipping, which I consider a fair price for the keyboard. Most of the links Hasu sent me are from $28 - $38, which is a bit on the high side but not unreasonable. Finally, yeah, $30 for postage is again, reasonable for US Mail which gets here in a week to ten days anyhow. I know, I've had lots of stuff shipped from the US to Greece.
So... let me know what you think.

Oh, yeah, and... my keyboard never stopped responding. Ever. And I don't have pull-ups. I do, however, have been using the B-port instead of the F-port of the teensy (it says so in the Atmel manual, B-port has 'stronger' outputs). I'm also using the original Apple coiled cable and a handset jack with (thankfully) nice thick wires inside.
And I know what you mean about the cursor keys. That's why I switched to the -A. Can't live without immediate access to cursor keys, keypad and ins, del and home, end. In fact, I'm used to using the entire keyboard, but at least the ins, del, home, end and such keys are available on the keypad combined with shift, by default. The arrows too, but... I want them there, to be used *with* shift for selecting text and ****. Hey ho.

@Hasu... I'd need one or two keyboards from you too, mate. If it's ok... and you can verify switches and stuff... I'd like at least one of those @ 3500 yen or the 2800 yen, if it's Mitsumi switches. Could you ask the seller, please?

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #71 on: Wed, 23 May 2012, 01:19:05 »
Quote from: YakMN;598024
Now I have cursors on a layer, but the delay is a bit weird for me. If I only wanted one layer, and was only ever going to use the capslock key for it, is there a way I can remove the delay? (I mean, delay before the layer kicks in).

It is a know issue to be fixed. I think you can work around this by editing layer.c like:
Code: [Select]

#define LAYER_ENTER_DELAY 0




Quote

Do you guys ever get situations where the keyboard stops responding? I have to unplug the USB and plug it back in every once in a while. Sometimes, I have to fire up teensy and hit the button on the board so it reloads or reboots or something. Maybe something wrong with my wiring? I didn't do the pullups.

I have not experienced the situation like the keyboard completely stops for a while. I also don't have pull-up resistors using Port F and it is no problem so far.
After stop responding Teensy's LED still lights up when press keys?
Light up of LED indicates that main loop still works and gets keys from the keyboard. I guess it is a problem of USB communication with Host PC(Mac?).
If you cannot see any light up it looks like controller get stuck completely in somewhere of code.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Macintosh M0110 USB converter
« Reply #72 on: Sun, 27 May 2012, 01:04:48 »
My firmware finally supports M0110A now. Thank you, skagon.
BTW, did you receive a PM from me?

And fixed the delay of layer switching bug at commit 225de7a, you don't need a work around with latest firmware.

Offline JMK

  • Posts: 31
Macintosh M0110 USB converter
« Reply #73 on: Wed, 30 May 2012, 15:57:55 »
Quote from: hasu;601106
My firmware finally supports M0110A now. Thank you, skagon.
BTW, did you receive a PM from me?

And fixed the delay of layer switching bug at commit 225de7a, you don't need a work around with latest firmware.
fantastic!!!!!!

Offline slaction

  • Posts: 41
  • Location: US
Re: Macintosh M0110 USB converter
« Reply #74 on: Mon, 26 November 2012, 20:59:33 »
I have this apple keyboard (M0110A) and I've been looking for an adapter for a long time.  I'm not very hardware savvy, so building on my own doesn't seem like the best option.

I would be willing to pay for one if someone has any extra already made, or if you know of a place to purchase something like this.

Any help would be appreciated greatly.  Thanks

Offline fohat.digs

  • * Elevated Elder
  • Posts: 6462
  • Location: 35°55'N, 83°53'W
  • weird funny old guy
Re: Macintosh M0110 USB converter
« Reply #75 on: Mon, 26 November 2012, 21:03:38 »
I think that this will be what you need. Decent price already, might as well offer less.

http://www.ebay.com/itm/Griffin-iMate-ADB-to-USB-adapter-BRAND-NEW-/321030354811?pt=LH_DefaultDomain_0&hash=item4abee6777b
State Freedom Caucus News 2024
Missouri state Senator Nick Schroer sponsors a bill that would allow senators to duel one another — in the Senate chambers! – legally.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #76 on: Tue, 27 November 2012, 00:57:00 »
No, iMate supports only ADB not M0110.

slaction,
if you don't mind paying 40$US and shipping fee from Japan(maybe 5-10$), I can work for you.
You will get:
- converter and M0110 cable(Teensy 2.0 & cable with plug)
- no enclosure
- keymap customizing service
- generous 1-month money back guarantee($40) for any reason(You must pay shipping fee for sending back.)
« Last Edit: Tue, 27 November 2012, 00:58:32 by hasu »

Offline fohat.digs

  • * Elevated Elder
  • Posts: 6462
  • Location: 35°55'N, 83°53'W
  • weird funny old guy
Re: Macintosh M0110 USB converter
« Reply #77 on: Tue, 27 November 2012, 07:12:46 »
Hasu -

Thank you, my mistake. I would have felt bad if I steered someone wrong. I am not an Apple guy.

I thought that I had owned a 110 previously, and used it with an iMate, but maybe it was the 116.
State Freedom Caucus News 2024
Missouri state Senator Nick Schroer sponsors a bill that would allow senators to duel one another — in the Senate chambers! – legally.

Offline slaction

  • Posts: 41
  • Location: US
Re: Macintosh M0110 USB converter
« Reply #78 on: Tue, 27 November 2012, 19:24:19 »
No, iMate supports only ADB not M0110.

slaction,
if you don't mind paying 40$US and shipping fee from Japan(maybe 5-10$), I can work for you.
You will get:
- converter and M0110 cable(Teensy 2.0 & cable with plug)
- no enclosure
- keymap customizing service
- generous 1-month money back guarantee($40) for any reason(You must pay shipping fee for sending back.)

Hasu,

That would be great.  I'd be happy to pay you for the adapter. 

Send me a PM with the details when you have a chance.

Thanks again!

slaction

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #79 on: Wed, 28 November 2012, 07:29:44 »
fohat, recently I looked your beautiful Model F mod and now I know you are an IBM guy :)

slaction, I'll pm you later.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #80 on: Sat, 01 December 2012, 05:15:04 »
Converter with enclosure looks like this finally. Not Bad.

Offline tufty

  • Posts: 347
  • Location: French Alps
Re: Macintosh M0110 USB converter
« Reply #81 on: Tue, 04 December 2012, 04:49:19 »
Sweet.

As an aside, I have a little issue with your converter software.  I'm using it to hook up an M0116 (compact ADB) keyboard, and have been using the "default" keymap for a while.  Unfortunately, this (amongst other things) swaps Command and Option (which is get-around-able using OSX), and doesn't give me the layers I want.

So I cloned your repo locally, and hooked in my own initial layers  for the M0116 (capslock with the locking pin removed to swap layers, forward delete on numpad clear, second layer with function and media keys mapped).  That works swimmingly, although I've been unable to get "eject" working, but the major problem is that it's now enormously slow (to the point of dropping 50% of keypresses).

Any ideas what might be causing the slowdown? I was originally using https://github.com/tmk/tmk_keyboard/commit/9f05dc6f444e159af3805baf5117be4d0da2d349 (and have reverted to using that) which is more than fast enough to keep up with my typing.

I've forked your repo with my changes here : https://github.com/tufty/tmk_keyboard (you'll need to swap around the ADB pins if you recompile, as I'm using an "adb-enabled" teensy I was using for another project).

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #82 on: Tue, 04 December 2012, 08:47:02 »
I recently seemed to push some bug into somewhere in my code in this two months.
https://github.com/tmk/tmk_keyboard/issues/14
At this time one of work arounds is using old repository commit:33d58c2b5647623d2b.

And there is ADB converter thread at: http://geekhack.org/index.php?topic=14290.90

Offline tufty

  • Posts: 347
  • Location: French Alps
Re: Macintosh M0110 USB converter
« Reply #83 on: Tue, 04 December 2012, 11:53:48 »
Thanks hasu.

I'll take further discussion to the other thread.

Offline ComradeSniper

  • HHKB Pro
  • * Esteemed Elder
  • Posts: 1086
  • Location: Seattle, WA
Re: Macintosh M0110 USB converter
« Reply #84 on: Tue, 16 September 2014, 19:54:39 »
I'm having issues with the converter software seemingly not working with either of my M0110s. The process of building and programming the firmware is pretty simple so I think that I've simply made a soldering error.
It's difficult to get good closeup photos of it, but I tried:
http://i.imgur.com/MkfAsDn.jpg
http://i.imgur.com/BAb73rf.jpg

So I've got the yellow wire hooked up to ground, black to VCC, red to F0 and green to F1. Is this correct? I'm using the Teensy 2.0

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #85 on: Tue, 16 September 2014, 19:59:11 »
Ah, you should use PD0 and PD1 instead of PF0 and PF1.
Pin configuration changed a years ago.

Offline Charger

  • Posts: 168
Re: Macintosh M0110 USB converter
« Reply #86 on: Tue, 16 September 2014, 20:00:53 »
I'm having issues with the converter software seemingly not working with either of my M0110s. The process of building and programming the firmware is pretty simple so I think that I've simply made a soldering error.
It's difficult to get good closeup photos of it, but I tried:
http://i.imgur.com/MkfAsDn.jpg
http://i.imgur.com/BAb73rf.jpg

So I've got the yellow wire hooked up to ground, black to VCC, red to F0 and green to F1. Is this correct? I'm using the Teensy 2.0

looks like you are also going to have wires shorting across each other like that

Offline ComradeSniper

  • HHKB Pro
  • * Esteemed Elder
  • Posts: 1086
  • Location: Seattle, WA
Re: Macintosh M0110 USB converter
« Reply #87 on: Tue, 16 September 2014, 20:03:54 »
Ah, you should use PD0 and PD1 instead of PF0 and PF1.
Pin configuration changed a years ago.

Ahh, okay. Thanks! I will get that swapped.

Offline did

  • Posts: 3
Re: Macintosh M0110 USB converter
« Reply #88 on: Sat, 31 January 2015, 12:30:48 »
Hi. I have followed all the instructions. I have successfully uploaded the hex file into my Teensy 2.0 but it doesn't work. I have nothing except when I une the hid_listen.mac I have :

from the terminal
Waiting for device:
Listening:
m0110_send err: 01
m0110_recv err: 01
m0110_send err: 01
m0110_recv err: 01
m0110_send err: 01
m0110_recv err: 01
m0110_send err: 01
m0110_recv err: 01
m0110_send err: 01
m0110_recv err: 01
m0110_send err: 01
m0110_recv err: 01
m0110_send err: 01


The layout is not qwerty but azerty I suppose this should at least give some results even with a bad keymap
So I would like to know if there is a way to see what is coming from the keyboard to the arduino from the PD0 and PD1 pins.
Thanks a lot for this code, it seems to be a lot of work :)

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #89 on: Sat, 31 January 2015, 21:56:32 »
Seems to me like your problem is hardware, maybe wiring or keyboard itself.

Are you sure your signal and power connection?
and do you have idea whether your keyboard is functional?

Offline did

  • Posts: 3
Re: Macintosh M0110 USB converter
« Reply #90 on: Tue, 03 February 2015, 04:09:41 »
Thanks for the reply. You are right it was a hardware problem. I had a lot of tests (i have an oscilloscope or I made some real dirty arduino sketches to test the keyboard) I thought the keyboard was faulty (I stored it almost ten years in a basement) but at the end it was only the ground solder that was bad. So now everything is working super good. The only wierd thing is the upmost left key (£ and `) is not making what it should do it writes < and > instead but no big deal, I'll have a look later to the layout customisation. Anyway, the french layout is instantly recognized.
I decided to put my teensy inside the kbd as there is a lot of room and the teensy is incredibly small so here is a picture :



THanks again. I just have to figure what to do with this keyboard now. Maybe write a book, it has the feel of an old typewriter... :)
thanks
« Last Edit: Tue, 03 February 2015, 05:22:48 by did »

Offline did

  • Posts: 3
Re: Macintosh M0110 USB converter
« Reply #91 on: Tue, 03 February 2015, 04:14:39 »
and by the way, does anyone know if there is a similar project for the mouse that comes with the keyboard :) :)

Offline tufty

  • Posts: 347
  • Location: French Alps
Re: Macintosh M0110 USB converter
« Reply #92 on: Thu, 05 February 2015, 02:18:29 »
IIRC, the original mac mouse was "dumb", feeding unprocessed quadrature signals and a button signal straight back to the computer.

If I was looking at interfacing one, I'd probably look at using the guts of an old USB *mechanical* mouse to do it. 

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #93 on: Sun, 12 July 2015, 14:23:05 »
Recent updates! :D

Quote
2015/03: Add support for "International"(ISO) keyboard(keymap_intl.c)
2015/07: Update keymap editor(for Rev.1)

And preassembled TMK converter is available here: https://geekhack.org/index.php?topic=72052.msg1751398#msg1751398


Keymap editor for M0110 converter:
http://www.tmk-kbd.com/tmk_keyboard/editor/m0110/m0110.html
http://www.tmk-kbd.com/tmk_keyboard/editor/m0110/m0110a.html

Offline lkong

  • Posts: 78
  • Location: United States
Re: Macintosh M0110 USB converter
« Reply #94 on: Tue, 21 July 2015, 23:13:15 »
Thanks for the reply. You are right it was a hardware problem. I had a lot of tests (i have an oscilloscope or I made some real dirty arduino sketches to test the keyboard) I thought the keyboard was faulty (I stored it almost ten years in a basement) but at the end it was only the ground solder that was bad. So now everything is working super good. The only wierd thing is the upmost left key (£ and `) is not making what it should do it writes < and > instead but no big deal, I'll have a look later to the layout customisation. Anyway, the french layout is instantly recognized.
I decided to put my teensy inside the kbd as there is a lot of room and the teensy is incredibly small so here is a picture :

Show Image


THanks again. I just have to figure what to do with this keyboard now. Maybe write a book, it has the feel of an old typewriter... :)
thanks

I'm having the exact problem you described.
I put the Oscope on Data lane, it has the waveform shown: http://i.imgur.com/pqMU4Iv.jpg
But it's not stable, DC kicks in in a few seconds and disappear.
It's stuck in this loop.
Can you share how did you solve your problem?
Thanks

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #95 on: Mon, 11 January 2016, 11:04:55 »

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #96 on: Sun, 01 January 2017, 17:54:58 »
New keymap editor is available for M0110 converter now. Use new one instead of old in post above.

For M0110:
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?m0110_usb
For M0110A:
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?m0110_usb_m0110a

Offline tjweir

  • * Exquisite Elder
  • Posts: 1039
  • Location: Toronto
Re: Macintosh M0110 USB converter
« Reply #97 on: Mon, 02 January 2017, 08:06:38 »
New keymap editor is available for M0110 converter now. Use new one instead of old in post above.

For M0110:
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?m0110_usb
For M0110A:
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?m0110_usb_m0110a

Awesome!

Offline sanitypotion

  • Posts: 3
  • Location: NY, United States
Re: Macintosh M0110 USB converter
« Reply #98 on: Wed, 05 July 2017, 23:15:54 »
Thanks for directing me to the right place hasu! I'll just put the rest of the original post here:

Hi, and thank you hasu for your great work. I was wondering if you might be able to help with my M0110-USB setup with Teensy 2.0. With a couple of modifications to the makefile (which seems to be configured for Teensy 3.x by default now?) I was able to get the code onto my Teensy 2.0 just fine. I also soldered pins to either side of the Teensy so I could do the whole thing in a breadboard for now. I've wired the breadboard so that VCC-CLK-DATA-GND are all in a nice line in one corner.

I have a 4P4C connector which I can plug into the breadboard and use the original M0110A's cord, as well as soldered some wires to points on the M0110A's main board that I have found near that connector that correspond to VCC-CLK-DATA-GND. I've used the continuity tester on my multimeter to figure out exactly which wires soldered to the board go with which ones on the 4P4C connector, and determined that there's no shorts and they are in fact connected to the same things.

When I take the wires I've soldered to the M0110A's main board and connect them to the Teensy via the breadboard, everything works just fine. (I press keys on the keyboard and letters show up on the computer screen.) Excellent.

However, when I connect the M0110A to the Teensy via the 4P4C jack plugged into the breadboard, again making sure that all wires are going to the correct places, it does not work (i.e. pressing keys does absolutely nothing). I have tried using 1K and 10K pullup resistors on CLK and DATA as well as on only CLK or only DATA. No luck--it still does not work. The second I remove the 4P4C connector and reconnect the M0110A main board wires, it starts working again.

So I have tested the cable and made sure that the connections are equivalent, and tried weak, strong, and no pullup resistors in different combinations. Yet the main board wires always work, and the 4P4C connector always doesn't work. Am I missing anything? Is it possible that I somehow need even stronger pullups than 1K, or weaker than 10K?

Thank you for any advice you may be able to give.
-sanitypotion

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #99 on: Wed, 05 July 2017, 23:53:43 »
Seems like wrong connection? did you try reverse order of wires and swap DATA and CLK or 5V and GND?

Offline sanitypotion

  • Posts: 3
  • Location: NY, United States
Re: Macintosh M0110 USB converter
« Reply #100 on: Thu, 06 July 2017, 13:49:48 »
Seems like wrong connection? did you try reverse order of wires and swap DATA and CLK or 5V and GND?

I am laughing at myself now :)) Turns out, when I found those solder points on the main board so long ago, I got CLK and DATA switched. And when I plugged those main board wires in, my brain subconsciously re-switched them. Then, when I was troubleshooting at a time I should have been in bed instead, I never even thought I could have gone wrong in my main board connections! I simply switched two wires on the breadboard and it is now working perfectly with the 4P4C connector--I'd be typing this on it right now if I wasn't too lazy to put it back together first. I should know now that nothing I do is infallible--thanks for your help and for reminding me not to always trust my past self in simple tasks  :thumb:

Offline dothedog

  • Posts: 10
  • Location: San Francisco
Re: Macintosh M0110 USB converter
« Reply #101 on: Wed, 12 July 2017, 22:11:03 »
I'm a little confused at the cross-over/straight problem. So if someone can correct me if I'm wrong that would be very helpful

Using a phone cable:
Facing the keyboard port, the wires from left to right go: black red green yellow. So
black = gnd
red = clock
green = data
yellow = 5v

and the original mac cable would be the same, if black is on the left? Opposite way around if yellow is on the left?

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #102 on: Wed, 12 July 2017, 22:54:57 »
Yea, description in first post is a little confusing I'll update it later.
You will know correct wiring in the end if you examine cable with multimeter.

Pinouts of keyboard connector is also same as this.


And see this for difference between hadset cable and Mac one.
https://en.wikipedia.org/wiki/Modular_connector#Data_port

Offline dothedog

  • Posts: 10
  • Location: San Francisco
Re: Macintosh M0110 USB converter
« Reply #103 on: Mon, 17 July 2017, 00:30:18 »
http://imgur.com/a/16Fxx

I hope you can make out the wire colors. left to right facing the keyboard: yellow-green-red-black

hid_listen prints out
m0110_send err: 04
m0110_recv err: 01

sometimes 02, 03 randomly

I'm building using rev1 makefile with the current master branch revision.

I believe that the keyboard works. I got the keyboard to spit out random keys without a pullup resistor but I messed up the teensy trying to solder on a pullup resistor, so i got another teensy and tried again. I'm using a chinese teensy clone. I did continuity checks on the plug end and the teensy end and it seems fine, so if there's anything else i can check, that would be helpful.
« Last Edit: Mon, 17 July 2017, 00:32:56 by dothedog »

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #104 on: Mon, 17 July 2017, 02:12:39 »
search pull up resistor and learn. It seems you soldered resistor wrongly. you need two resistors on both data and clock btw.
« Last Edit: Mon, 17 July 2017, 05:23:31 by hasu »

Offline dothedog

  • Posts: 10
  • Location: San Francisco
Re: Macintosh M0110 USB converter
« Reply #105 on: Mon, 17 July 2017, 22:11:39 »
Ahh yes it should be between VCC and D0 and VCC and D1. I wasn't thinking. Thanks!

Edit: Yup that was it. Typing on my m0110a right now. :). On to getting my IBM Model F XT to work  :))
« Last Edit: Mon, 17 July 2017, 23:11:47 by dothedog »

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #106 on: Tue, 18 July 2017, 14:35:24 »
Ahh yes it should be between VCC and D0 and VCC and D1. I wasn't thinking. Thanks!

Edit: Yup that was it. Typing on my m0110a right now. :). On to getting my IBM Model F XT to work  :))

Great!
it would be nice if you keep subscribing this thread to help new comers in trouble.

Offline jeffooi

  • Posts: 2
Re: Macintosh M0110 USB converter
« Reply #107 on: Thu, 28 September 2017, 04:42:16 »
Hi All (Deep breath) my first post.

I have used a Macintosh Plus shell to house a Raspberry Pi running RetroPi and EMulation station.
I was very keen to get my M0110 keyboard hooked up to the Pi via USB and the converter. However it is not picking up the keyboard. I haven't compiled any firmware or installed anything yet and I am wondering whether you could help a noob like me. Please keep in mind that I know nothing of linix and the last time I compiled something was in the 1990s in something called Turbo C.


Thanks in advance.
Jeff

Offline jeffooi

  • Posts: 2
Re: Macintosh M0110 USB converter
« Reply #108 on: Thu, 28 September 2017, 23:26:56 »
Hi there thanks Shawnmeg for your help, I've got my machine running with my ancient m0110 keyboard now. Next thing will be to work out how to map function keys but that's a discussion for another forum I think :thumb:


Offline PancakeMSTR

  • Posts: 491
Re: Macintosh M0110 USB converter
« Reply #109 on: Sat, 02 June 2018, 02:33:05 »
Hi all,
Trying to convert an M0110 over here. Don't know if I've done anything right, at all, but...anyway. I have a pro micro wired up to the keyboard, and I've got (two) 1.5 kilohm pull up resistors running from/across  VCC to the clock and data lines.

I pulled the git repository and compiled it, seems like it got flashed to the pro micro okay. I tried m0110_usb.hex and the rev1 file in the binary folder.  No output from the keyboard on either. Should I try 5 kilohm resistors or am I doing something wrong? Thanks.
   

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #110 on: Tue, 25 September 2018, 21:34:52 »
Current default key mapping on Keymap Editor places Control on Caps lock key because I replaced locking switch of the key with normal one on my M0110 and have used it as Control comfortably. But this is not useful at all for users with stock lockingswitch. I like to make default keymap more useful for many of users as possible.
Current mapping: http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?m0110_usb_m0110a


Now I wonder how M0110/A users place Control key on their keyboard. Can you share your keymap/idea?

With 'dual-role key' function(ACTION_MODS_TAP_KEY) defining Controls on Tab and Enter is my idea so far.
https://goo.gl/YXvTkb


EDIT:
Btw, you can get descrete SKCC short stem switch for locking switch replacement here.
https://www.aliexpress.com/item/SKCC-BJ0001-keyboard-switch-button-switch-reset-switch-micro-switch/32813803943.html
If your M0110A is MITSUMI model you can just remove locking mechanism of the switch easily instead of replacement. It still requires desoldering though.
« Last Edit: Tue, 25 September 2018, 21:47:26 by hasu »

Offline supermario802.1

  • Posts: 31
    • tinkerBOY
Re: Macintosh M0110 USB converter
« Reply #111 on: Thu, 04 October 2018, 22:06:50 »
Is the M0110A firmware compatible with both M0110 and M0110A keyboards? Or do I need different firmware for each?

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #112 on: Fri, 05 October 2018, 02:15:25 »
Is the M0110A firmware compatible with both M0110 and M0110A keyboards? Or do I need different firmware for each?

Yes, it is compatible.

Offline liscombc

  • Posts: 1
Re: Macintosh M0110 USB converter
« Reply #113 on: Mon, 10 June 2019, 23:52:42 »
Needing some help here. I have Hasu's converter, but I wanted the converter inside the case. I removed both telephone Jack's and wired it without success.

My understanding is the wiring should be crossed over, as that's how the adapter was positioned. If that's right and I'm crossing the wires then from the keyboard I should have 1-4, 2-3, 3-2, and 4-1?

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #114 on: Thu, 13 June 2019, 16:03:10 »
Needing some help here. I have Hasu's converter, but I wanted the converter inside the case. I removed both telephone Jack's and wired it without success.

My understanding is the wiring should be crossed over, as that's how the adapter was positioned. If that's right and I'm crossing the wires then from the keyboard I should have 1-4, 2-3, 3-2, and 4-1?

I think you are right, TMK M0110 converter is designed for use with phone handset cord(crossover cable).
So TMK M0110 converter 4P4C socket pins(marked as "cross" on current PCB) are:
1 5V
2 Data
3 Clock
4 GND
Note that pins are reversed to socket on keyboard.

You should wire them crossover as you described.

Offline SuccnYeet

  • Posts: 18
  • Location: Australia
Re: Macintosh M0110 USB converter
« Reply #115 on: Mon, 13 January 2020, 16:52:09 »
Hello, I am currently trying to convert my M0110. I have managed to wire it up and get it flashed with the firmware from your github, but this places CONTROL on the locking caps lock. How can I change the layout so it works when I flash it? I am using AVRDUDESS and attempting to use any other firmware causes the keyboard not to work at all.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #116 on: Mon, 13 January 2020, 17:00:54 »
You can use Tmk keymap editor to remap. You should select rev.1 firmware for pro micro or atmega32u4 while Rev.2 firmware fits only for TMK M0110 converter or atmega32u2.

Offline SuccnYeet

  • Posts: 18
  • Location: Australia
Re: Macintosh M0110 USB converter
« Reply #117 on: Mon, 13 January 2020, 17:07:44 »
Okay, it seems to be working now, I'm not sure why it wasn't before. Thank you very much!

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #118 on: Mon, 13 January 2020, 17:39:44 »
No problem.
I know people can solve problem by themselves in the end if they take enough time :D
Glad to help you somewhat.

Offline supermario802.1

  • Posts: 31
    • tinkerBOY
Re: Macintosh M0110 USB converter
« Reply #119 on: Fri, 24 January 2020, 06:11:51 »
How do you jump into bootloader mode? In an ADB converter you just press Magic + Pause key and it goes to bootloader mode.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #120 on: Sat, 25 January 2020, 20:34:41 »
How do you jump into bootloader mode? In an ADB converter you just press Magic + Pause key and it goes to bootloader mode.

Didn't work Magic  + Pause on your M0110* keyboard?
If so the key combo be blocked by keyboard's rollover limitation probably.

Offline sharpfork

  • Posts: 1
Re: Macintosh M0110 USB converter
« Reply #121 on: Wed, 25 March 2020, 20:30:56 »
Thanks for putting this together!

I successfully flashed my 32u4 with M0110A-USB Converter rev.1 for M0110A and got it working fine with my M0110A.  I figured out that my "O" key is physically broken so I pulled out a M0110 I have.  I changed the TMK Keymap Editor to
M0110-USB Converter rev.1 for M0110, downloaded the hex, erased my 32u4 in dfu-programmer, reflashed the M0110 file (named differently than the M0110A file), and reset the 32u4.  The M0110 isn't working but the M0110A is still working.  I tried this a bunch of times, downloading a new hex and making sure I had the right file but I can only get the M0110A to work even after I flash with the M0110 hex.

I'm guessing this is me being dumb but figured I'd ask for some tips incase I might be doing something dumb on the TMK Keymap Editor page.

Thanks again!

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #122 on: Wed, 25 March 2020, 21:14:07 »
The firmwares are equivalent and should work with both M0110 and M0110A,  difference is keymapping on a few keys.
M0110 seems to be faulty, are you sure it worked before?

EDIT: And try hid_listen to see debug output.
« Last Edit: Wed, 25 March 2020, 21:20:11 by hasu »

Offline Dobsonslab

  • Posts: 2
Re: Macintosh M0110 USB converter
« Reply #123 on: Fri, 14 August 2020, 10:56:24 »
I've got 3 m0110a boards that I'm restoring and planning to build one of these, I'm fairly handy with a soldering iron but can I check if there are any concerns over compatibility with the different versions of the m0110a that exist?

I've got one USA board with the Alps switches, and two Mitsumi boards one from Japan and one from Malaysia, and just wanted to check if there are any special differences I might have missed?

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #124 on: Fri, 14 August 2020, 20:06:16 »
I've got 3 m0110a boards that I'm restoring and planning to build one of these, I'm fairly handy with a soldering iron but can I check if there are any concerns over compatibility with the different versions of the m0110a that exist?

I've got one USA board with the Alps switches, and two Mitsumi boards one from Japan and one from Malaysia, and just wanted to check if there are any special differences I might have missed?


No difference in terms of protocol.

Offline rhubarbpi

  • Posts: 32
  • ALPS ORANGIQUE / SALMONIQUE
Re: Macintosh M0110 USB converter
« Reply #125 on: Sun, 16 August 2020, 22:05:15 »
Greetings -
So to change one of the keys to Control on an M0110A, when using the TMK Core library, you simply use the TMK Keymap Editor and load the file into the firmware with the updated mapping?

Trying to plan ahead as I use Control quite a lot and need to be able to use it, never updated the keymap before & M0110A arriving soon!
Thanks in advance for responses.

- Rhubarb Pi
*daily drivers*

Apple AEK - #{Alps Orange}
Apple M0116 - #{Alps Salmon}
Apple M0110A - #{Alps Tall Cream}
Apple AEKII - #{Alps Dampened Cream}
Apple IIgs - #{Alps Orange}

 - all powered by tinkerBoy Converters :D

Offline doomsday_device

  • Posts: 6
  • Location: Germany
Re: Macintosh M0110 USB converter
« Reply #126 on: Wed, 09 September 2020, 13:35:42 »
hey, first post here. really desperate to convert my m0110a. cant get it to work. using pro micro 16mhz 5v with atmel32u4, when i flash it with avrdudess (succeeds) windows 10 gives me driver failure. code 43 in the device-manager. when flashing adb or soarer hex it works without problems on same pro micro. i dont have a clue anymore, asked so much people. any ideas? didnt wired or soldered anything yet. tried both revisions and have tried atleast 3 different hex files from other peoples.
« Last Edit: Wed, 09 September 2020, 13:37:45 by doomsday_device »

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #127 on: Wed, 09 September 2020, 16:33:35 »
This is quote  from ADB-USB converter thread but it is still useful for this converter.

Quote
README FIRST
https://github.com/tmk/tmk_keyboard
https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb

and optionally,
https://github.com/tmk/tmk_keyboard/wiki
https://github.com/tmk/tmk_keyboard/labels/NOTE


NEED HELP: Your self-made converter doesn't work?

Don't ask help before placing pull-up resistor and trying solder on J1!

You are cheap and got Pro Micro from unreliable source, instead of Sparkfun? OK, but confirm it has 16MHz crystal. And probably you need to fill solder on jumper J1 to feed keyboard good power supply 5V if you are in trouble and J1 is not soldered yet. See this post and schematic.

In most cases your wiring is wrong. Check your wiring yourself again and again, one hundred times! And try swapping wires at your own risk, note that your wiring are already wrong at this point probably :D It won't break your keyboard unless you are extremely unlucky.

Now you need help? OK. If you are not sure about your wiring, post pics of your hardware and wriring this really save our time. Don't save your time by omitting this. Shots of controller side and ADB connector/keyboard side would be helpful. If you edit code post your code. Don't hesitate to show your dirty code! Also output from hid_listen command would be useful to debug hardware and firmware.

[rant]
Many people said they are sure their wiring is fine first but it became clear they failed to do that in the end many times in this thread :( And they often omit pull-up resistor for no reason, you must have it.
Don't take advantage of generosity of kind and helpful members(yes, including me, of course  ;))! Their time is more precious than your time, use your time to learn and look into your problem first.
[/rant]


Offline doomsday_device

  • Posts: 6
  • Location: Germany
Re: Macintosh M0110 USB converter
« Reply #128 on: Sat, 12 September 2020, 15:05:12 »
thanks for the reply! i did read all that. pinout doublechecked ten times, j1 is shorted. everything is soldered. still getting driver failure after flashing.
(Windows has stopped this device because it has reported problems. (Code 43)

i dont know why it should make a difference if soldered or not in the first place but i give you that. its not that the keyboard itself doesnt work, i cant tell for now as the firmware seems to be faulty. when flashing adb or soarer on same pro micro its recognized correctly in windows.

yellow is gnd, green is clock, white is data and black is vcc. these are both 1k resistors. cable is shortened cherry g80 cable with rj11 plug on keyboard side.
log from avrdude:
Code: [Select]
>>>: avrdude -u -c avr109 -p m32u4 -P COM11 -F -U flash:w:"D:\Downloads\m0110_usb_rev2_unimap.hex":a

Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
    Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
    Device code: 0x44

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% -0.00s

avrdude.exe: Device signature = 0x1e9587 (probably m32u4)
avrdude.exe: NOTE: "flash" memory has been specified, an erase cycle will be performed
             To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: reading input file "D:\Downloads\m0110_usb_rev2_unimap.hex"
avrdude.exe: input file D:\Downloads\m0110_usb_rev2_unimap.hex auto detected as Intel Hex
avrdude.exe: writing flash (27136 bytes):

Writing | ################################################## | 100% 1.45s

avrdude.exe: 27136 bytes of flash written
avrdude.exe: verifying flash memory against D:\Downloads\m0110_usb_rev2_unimap.hex:
avrdude.exe: load data flash data from input file D:\Downloads\m0110_usb_rev2_unimap.hex:
avrdude.exe: input file D:\Downloads\m0110_usb_rev2_unimap.hex auto detected as Intel Hex
avrdude.exe: input file D:\Downloads\m0110_usb_rev2_unimap.hex contains 27136 bytes
avrdude.exe: reading on-chip flash data:

Reading | ################################################## | 100% 0.18s

avrdude.exe: verifying ...
avrdude.exe: 27136 bytes of flash verified

avrdude.exe done.  Thank you.
« Last Edit: Sat, 12 September 2020, 15:36:13 by doomsday_device »

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #129 on: Sat, 12 September 2020, 20:05:40 »
use rev.1 firmware for ATmega32u4.
http://www.tmk-kbd.com/tmk_keyboard/editor/

Offline doomsday_device

  • Posts: 6
  • Location: Germany
Re: Macintosh M0110 USB converter
« Reply #130 on: Sun, 13 September 2020, 07:06:33 »
oh yes that was it. i dont know why i didnt tried rev 1 anymore. thanks!

Offline SARIEL42

  • Posts: 2
  • Location: Texas
  • I have no idea what I'm actually doing.
Re: Macintosh M0110 USB converter
« Reply #131 on: Wed, 10 March 2021, 17:41:23 »
Is there a way to do a reverse of this? I have a macintosh 512k, but not a keyboard or mouse for it, but I have plenty of modern keyboards and mouses, and I'd like to be able to make the computer usable, but I have had no luck in even beginning to find resources to make this work, I have no idea on where to even start, and it seems you know quite a bit on this topic, so does there happen to be a way to do basically a reverse of your project here, converting USB into m0110 to allow modern keyboards to be used on the mac 512k

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #132 on: Wed, 10 March 2021, 18:33:36 »
I found these project for keyboard after quick research:
https://github.com/trekawek/mac-plus-ps2
http://www.synack.net/~bbraun/mackbd/index.html

If you want to stick to USB instead of PS/2, check this.
https://github.com/felis/USB_Host_Shield_2.0

As for M0110 keyboard protocol you can find some resources in the first post and here.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/protocol/m0110.c#L572-L590

Offline SARIEL42

  • Posts: 2
  • Location: Texas
  • I have no idea what I'm actually doing.
Re: Macintosh M0110 USB converter
« Reply #133 on: Wed, 10 March 2021, 18:39:11 »
Alright then, thank you so much! I will look into these and try to make it work

Offline Nomad_00

  • Posts: 2
Re: Macintosh M0110 USB converter
« Reply #134 on: Mon, 25 April 2022, 16:24:56 »
Hello!, I have three questions about the soldering.  I am using a pro micro I have already bridged the J1

1. does the +5v cable go to the RAW pinout or the VCC?

2. do I need resistors if I am not using a long cord?

3. is the only thing I am flashing to the board the hex file?

thank you very much

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #135 on: Mon, 25 April 2022, 23:12:52 »

Offline emanon

  • Posts: 1
Re: Macintosh M0110 USB converter
« Reply #136 on: Mon, 04 July 2022, 08:27:14 »
works with m0110aj as well i would assume?

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #137 on: Mon, 04 July 2022, 17:47:19 »
What does m0110aj look like?
and what is difference from other M0110?

EDIT: Ah, M0110AJ is just M0110A with Japanese legends. It should work.
« Last Edit: Mon, 04 July 2022, 21:03:04 by hasu »

Offline Nomad_00

  • Posts: 2
Re: Macintosh M0110 USB converter
« Reply #138 on: Mon, 03 October 2022, 22:21:59 »
i got it to work! currently typing this out on my new (old) keyboard! having little trouble with ghost inputs, and a key will repeat a lot( likeeeeeeeeeeeeeeeeeeeeeeee this) or there will be slight delay with backspace. is this the keyboard its self or the tmk software? 

next on my list is to lube the keys and add foam to quiet the pinging sound.

thanks!

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #139 on: Sun, 29 January 2023, 21:52:16 »
YOUR HELP NEEDED for International(ISO) keyboard support

Can anyone who own M0110 with tiny ISO return key like pic below help me?



I like to know its 'Model ID' to add international-layout M0110 support.
Please let me know 'Model ID' of your M0110 and 'Model Number' printed on back-side label.

To get 'Model ID':
0. Download the latest firmware from Keymap Editor and flash it on converter. (Just updated firmware for this purpose.)
1. Run hid_listen
2. Plug converter into computer
3. Plug keyboard into converter

You will see 'model ID' on hid_lisen console as below. My US-layout M0110 shows '09' as model ID in this example.

Code: [Select]
Waiting for new device:........
Listening:

TMK:ca021a/LUFA:d6a7df

USB configured.

Loop start.
model: 09

Thanks
« Last Edit: Fri, 21 April 2023, 23:15:46 by hasu »

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #140 on: Tue, 29 August 2023, 22:38:48 »
bump

Can anyone who own international-layout M0110 help me?
Please check previous post.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #141 on: Sat, 27 January 2024, 09:27:01 »
Support for International layout


Keymap Editor support for International layout is available now.

See Issue #771 and the first post.