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

0 Members and 1 Guest are viewing this topic.

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: 1814
  • 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: 1814
  • 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: 2993
  • 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.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

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: 2993
  • 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
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

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: 2993
  • 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.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 2993
  • 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
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 2993
  • 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.
*/
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

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: 2993
  • 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.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

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: 2993
  • 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.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 2993
  • 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.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

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: 5700
  • Location: 3557'N, 8353'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
"I never understood wind. I know windmills very much, I have studied it better than anybody. I know it is very expensive. They are made in China and Germany mostly, very few made here, almost none, but they are manufactured, tremendous if you are into this tremendous fumes and gases are spewing into the atmosphere. You know we have a world, right? So the world is tiny compared to the universe. So tremendous, tremendous amount of fumes and everything. You talk about the carbon footprint, fumes are spewing into the air, right spewing, whether it is China or Germany, is going into the air. A windmill will kill many bald eagles. After a certain number, they make you turn the windmill off, that is true. By the way, they make you turn it off. And yet, if you killed one, they put you in jail. That is OK. But why is it OK for windmills to destroy the bird population?" - Donald Trump - Turning Point USA speech - 2019-12-22

Offline hasu

  • Thread Starter
  • Posts: 2993
  • 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 »
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline fohat.digs

  • * Elevated Elder
  • Posts: 5700
  • Location: 3557'N, 8353'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.
"I never understood wind. I know windmills very much, I have studied it better than anybody. I know it is very expensive. They are made in China and Germany mostly, very few made here, almost none, but they are manufactured, tremendous if you are into this tremendous fumes and gases are spewing into the atmosphere. You know we have a world, right? So the world is tiny compared to the universe. So tremendous, tremendous amount of fumes and everything. You talk about the carbon footprint, fumes are spewing into the air, right spewing, whether it is China or Germany, is going into the air. A windmill will kill many bald eagles. After a certain number, they make you turn the windmill off, that is true. By the way, they make you turn it off. And yet, if you killed one, they put you in jail. That is OK. But why is it OK for windmills to destroy the bird population?" - Donald Trump - Turning Point USA speech - 2019-12-22

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: 2993
  • 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.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 2993
  • 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.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

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: 2993
  • 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
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

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: Montana
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: 2993
  • 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.
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline Charger

  • Posts: 166
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: Montana
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: 2993
  • 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?
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

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: 2993
  • 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
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

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: 2993
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Macintosh M0110 USB converter
« Reply #95 on: Mon, 11 January 2016, 11:04:55 »
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

Offline hasu

  • Thread Starter
  • Posts: 2993
  • 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
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt

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: 2993
  • 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?
TMK products:HHKB Alt  ⌨ConvertersAlps64FC660C AltFC980C Alt