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

0 Members and 1 Guest are viewing this topic.

Offline hasu

  • Thread Starter
  • Posts: 1560
  • 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 Keyboard M0110 and M0110A into USB. The retro keyboard can be revived conecting to mordern compter with this converter.




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



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)





Keypad M0120 is also supported, even itself without M0110.



Build Hardware
You need 4P4C cable and ATMega32U4 board like Teensy. 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.

Socket pinout:
This is Mac side socket but same on keyboard side.
   

Cable colors:
Code: [Select]
    1(Black or Yellow):   GND
    2(Red or Green):     CLOCK
    3(Green or Red):   DATA
    4(Yellow or Black):  +5V
NOTE: phone handset cable is crossover so one end has different color assign(inversed) than the other end.

Close-up pics of handset cable. You can see one end of plug has reverse color codes against the other. Click to enlarge.



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.



Build Frimware
Optionally edit Makefile and config.h for build options, pin configuration or MCU.

$ git clone git://github.com/tmk/tmk_keyboard.git
$ cd converter/m0110_usb
$ make
and program your Teensy with loader.

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



Keymap editor
You can use keymap editor to define your keymap instead of building fimware yourself.

http://www.tmk-kbd.com/tmk_keyboard/editor/m0110/m0110.html
http://www.tmk-kbd.com/tmk_keyboard/editor/m0110/m0110a.html




M0110 Protocol - technical resource
- https://github.com/tmk/tmk_keyboard/blob/master/protocol/m0110.c#L404-575
- https://github.com/tmk/tmk_keyboard/blob/master/protocol/m0110.c#L158-200

Technical Info for 128K/512K and Plus
    ftp://ftp.apple.asimov.net/pub/apple_II/documentation/macintosh/Mac%20Hardware%20Info%20-%20Mac%20128K.pdf
    ftp://ftp.apple.asimov.net/pub/apple_II/documentation/macintosh/Mac%20Hardware%20Info%20-%20Mac%20Plus.pdf
Protocol:
    Page 20 of Tech Info for 128K/512K
    http://www.mac.linux-m68k.org/devel/plushw.php
Connector:
    Page 20 of Tech Info for 128K/512K
    http://www.kbdbabel.org/conn/kbd_connector_macplus.png
Signaling:
    http://www.kbdbabel.org/signaling/kbd_signaling_mac.png
    http://typematic.blog.shinobi.jp/Entry/14/
Scan Codes:
    Page 22 of Tech Info for 128K/512K
    Page 07 of Tech Info for Plus
    http://m0115.web.fc2.com/m0110.jpg
    http://m0115.web.fc2.com/m0110a.jpg
« Last Edit: Sun, 12 July 2015, 14:32:06 by hasu »
⚠ My Engrish is broken.  TMK firmware  ⌨ HHKB Alt controller

Offline JMK

  • Posts: 30
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: 30
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: 1560
  • 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:
⚠ My Engrish is broken.  TMK firmware  ⌨ HHKB Alt controller

Offline JMK

  • Posts: 30
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: 30
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: 30
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: 1560
  • 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 »
⚠ My Engrish is broken.  TMK firmware  ⌨ HHKB Alt controller

Offline JMK

  • Posts: 30
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: 30
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: 1560
  • 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 »
⚠ My Engrish is broken.  TMK firmware  ⌨ HHKB Alt controller

Offline JMK

  • Posts: 30
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: 30
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: 1560
  • 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.
⚠ My Engrish is broken.  TMK firmware  ⌨ HHKB Alt controller

Offline JMK

  • Posts: 30
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: 1560
  • 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?
⚠ My Engrish is broken.  TMK firmware  ⌨ HHKB Alt controller

Offline JMK

  • Posts: 30
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: 30
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: 1560
  • 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.
⚠ My Engrish is broken.  TMK firmware  ⌨ HHKB Alt controller

Offline JMK

  • Posts: 30
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: 1560
  • 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 »
⚠ My Engrish is broken.  TMK firmware  ⌨ HHKB Alt controller

Offline JMK

  • Posts: 30
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: 1560
  • 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.
⚠ My Engrish is broken.  TMK firmware  ⌨ HHKB Alt controller

Offline JMK

  • Posts: 30
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: 1560
  • 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.
⚠ My Engrish is broken.  TMK firmware  ⌨ HHKB Alt controller

Offline JMK

  • Posts: 30
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: 30
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: 30
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: 1560
  • 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.
⚠ My Engrish is broken.  TMK firmware  ⌨ HHKB Alt controller

Offline JMK

  • Posts: 30
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: 1560
  • 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)
                                }
                        }
                }
+*/
        }
 }

⚠ My Engrish is broken.  TMK firmware  ⌨ HHKB Alt controller

Offline JMK

  • Posts: 30
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: 1560
  • 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 |   |
     *      `-----------------------------------------------'

⚠ My Engrish is broken.  TMK firmware  ⌨ HHKB Alt controller

Offline JMK

  • Posts: 30
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: 1560
  • 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.
⚠ My Engrish is broken.  TMK firmware  ⌨ HHKB Alt controller

Offline JMK

  • Posts: 30
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: 30
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: 1560
  • 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
⚠ My Engrish is broken.  TMK firmware  ⌨ HHKB Alt controller

Offline JMK

  • Posts: 30
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: 30
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: 30
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: 30
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: 30
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: 41
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: 1560
  • 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 :)
⚠ My Engrish is broken.  TMK firmware  ⌨ HHKB Alt controller

Offline snoopy

  • Red Baron
  • * Esteemed Elder
  • Posts: 2116
  • 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?