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

0 Members and 4 Guests are viewing this topic.

Offline nevin

  • Posts: 1646
  • Location: US
Re: TMK ADB to USB keyboard converter
« Reply #1150 on: Fri, 01 April 2022, 16:13:56 »
@jzw95 the TMK ADB to USB adapter does just that ADB -> USB (using old mac peripherals on new usb computers)

if you want to go the other direction USB -> ADB, the wombat is what you're looking for. (using new peripherals on old macs)
https://www.bigmessowires.com/usb-wombat/
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline Dandu

  • Posts: 43
Re: TMK ADB to USB keyboard converter
« Reply #1151 on: Tue, 05 April 2022, 12:02:51 »
Added code for Logitech device support.

Can you try attached firmware with these devices and take debug log?
- TrackMan: https://www.journaldulapin.com/2017/09/23/le-trackball-adb-de-logitech/
- MouseMan: https://www.journaldulapin.com/2020/11/03/adb-mouse-logitech/

Not supported yet but can you post debug log of Contour Mouse also?
- Contour Mouse: https://www.journaldulapin.com/2020/10/27/contour-mouse/

(Attachment Link)

Hi, i'm back !

So :

- I have tried the TrackMan : the ball act as a mouse wheel for macOS, but when i press the button, i have now three time the button 1 (with the precedent firmware, the two right button act as keyboard key).

- I have tried the %ouse%an (three button) and it seems OK. I have the three button. Actually, the second button (middle) act as button 2 (seems logic) but it's weird for user : it's the right clic (aka the menu).

- For the Contour Mouse, it works. Actually, it seems to be hardware : the lef clic is a left clic, the middle clic is a "forced clic" (first press lock clic, second press release clic). The third button seems to reduce mouse sensitivity.

And i have tried another time the NeXT mouse. It works... but not all the time (and without the right clic). Is this possible to add a flag at compilation to have the choice (right clic or not) ? Or a white list with "right clic" enabled mouse ?




Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK ADB to USB keyboard converter
« Reply #1152 on: Wed, 06 April 2022, 01:08:02 »
- I have tried the TrackMan : the ball act as a mouse wheel for macOS, but when i press the button, i have now three time the button 1 (with the precedent firmware, the two right button act as keyboard key).
I think I could fix code for Logitech TrackMan in new attached firmware.


Quote
- I have tried the %ouse%an (three button) and it seems OK. I have the three button. Actually, the second button (middle) act as button 2 (seems logic) but it's weird for user : it's the right clic (aka the menu).
Interesting. This MouseMan speaks different protocol from the TrackMan. It seems Logitch used two different protocol for MouseMan(TrackMan) in those days. This  MouseMan is completely compatible with Apple Extended Mouse protocol.


As for its buttons I'll look into later.
Second(right) button of Macally mouse works as right button(context menu) currently, right?
Can you try the MouseMan on Windows or Linux to see how the buttons work?
Can you check if button configuration on MouseKey affects with the converter?
 https://www.journaldulapin.com/2020/11/03/adb-mouse-logitech/



Quote
- For the Contour Mouse, it works. Actually, it seems to be hardware : the lef clic is a left clic, the middle clic is a "forced clic" (first press lock clic, second press release clic). The third button seems to reduce mouse sensitivity.
It appears to be right behaviour  when the mouse works without driver.
I added Coutour support in new attached firmware, with this their buttons should work as normal 3-button mouse.


Quote
And i have tried another time the NeXT mouse. It works... but not all the time (and without the right clic). Is this possible to add a flag at compilation to have the choice (right clic or not) ? Or a white list with "right clic" enabled mouse ?

Yes, it is exactly what I plan. I'll add compile option in config.h.

Added delay to wait for changing address for NeXT mouse.



Can you try attached firmware with TrackMan, Contour and NeXT?

* adb_usb_rev1.hex (67.61 kB - downloaded 79 times.)

Offline Dandu

  • Posts: 43
Re: TMK ADB to USB keyboard converter
« Reply #1153 on: Thu, 07 April 2022, 12:31:58 »
I think I could fix code for Logitech TrackMan in new attached firmware.

Yep, it works. The Trackman works like a charm.

Quote
Interesting. This MouseMan speaks different protocol from the TrackMan. It seems Logitch used two different protocol for MouseMan(TrackMan) in those days. This  MouseMan is completely compatible with Apple Extended Mouse protocol.

As for its buttons I'll look into later.
Second(right) button of Macally mouse works as right button(context menu) currently, right?
Can you try the MouseMan on Windows or Linux to see how the buttons work?
Can you check if button configuration on MouseKey affects with the converter?
 https://www.journaldulapin.com/2020/11/03/adb-mouse-logitech/

Logitech use the classic protocol with many mouse (i have a wireless mouse with the same things).
The Macally right button act as right clic under macOS, yes.

I will try under Windows next week (actually, i have only Mac machine at home, and with virtual machine, i cannot use the adapter directly).

For the MouseKey driver, i do not understand : it will work only with the mouse connected with ADB. I cannot use it with the converter. I can try with a Mac, i must boot a Mac with USB to do that, i mean.

Quote
It appears to be right behaviour  when the mouse works without driver.
I added Coutour support in new attached firmware, with this their buttons should work as normal 3-button mouse.

It works. I have the three button and not the weird function.

Quote
Yes, it is exactly what I plan. I'll add compile option in config.h.

Added delay to wait for changing address for NeXT mouse.

It works with the NeXT mouse. With this firmware, i have connected the mouse and it works (hot plug).


Thank you for your work.

Offline Dandu

  • Posts: 43
Re: TMK ADB to USB keyboard converter
« Reply #1154 on: Thu, 07 April 2022, 13:40:02 »
About Mouse, too :

I have tested all my one button mice, and i have for mouse who will not work.

- A black M2706 will not work (my two other beige are working). But the logs see a mouse.
- A trackball from Elecom. It's recognised on the log, but with a "fail" message. (https://www.journaldulapin.com/2021/03/26/trackball-adb/)
- A very weird mouse. https://www.journaldulapin.com/2017/04/12/optical-usb-adb/ It's an optical USB mouse from Kensington with a USB (female) to ADB male adapter. It's a passive adapter, like PS/2 to USB. The mouse will not work (and the LED is off).
- An OEM mouse (from a StarMax clone) : nothing appear. The mouse is broken

The three first mouse are working with my iMate. The last one is different : it seems there is a problem with mouse, it will not work every time, even with iMate.
« Last Edit: Fri, 08 April 2022, 04:53:13 by Dandu »

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK ADB to USB keyboard converter
« Reply #1155 on: Fri, 08 April 2022, 11:13:56 »

Quote
Interesting. This MouseMan speaks different protocol from the TrackMan. It seems Logitch used two different protocol for MouseMan(TrackMan) in those days. This  MouseMan is completely compatible with Apple Extended Mouse protocol.

As for its buttons I'll look into later.
Second(right) button of Macally mouse works as right button(context menu) currently, right?
Can you try the MouseMan on Windows or Linux to see how the buttons work?
Can you check if button configuration on MouseKey affects with the converter?
 https://www.journaldulapin.com/2020/11/03/adb-mouse-logitech/

Logitech use the classic protocol with many mouse (i have a wireless mouse with the same things).
The Macally right button act as right clic under macOS, yes.

I will try under Windows next week (actually, i have only Mac machine at home, and with virtual machine, i cannot use the adapter directly).

For the MouseKey driver, i do not understand : it will work only with the mouse connected with ADB. I cannot use it with the converter. I can try with a Mac, i must boot a Mac with USB to do that, i mean.

Right, I meant button configuration with Mousekey on old Mac and wanted to know whether the button configuration is stored on device or not. But this is not related probably, disregard this.

Does this wireless MouseMan register middle and right button correctly?
I want to check debug log for this too.
https://www.journaldulapin.com/2015/12/11/souris-logitech-sans-fil/




Quote
Quote
Yes, it is exactly what I plan. I'll add compile option in config.h.

Added delay to wait for changing address for NeXT mouse.

It works with the NeXT mouse. With this firmware, i have connected the mouse and it works (hot plug).

hmm, it looks better than before, but NeXT mouse still needs more delay.
It takes longer to process commands than other devices, perhaps.



Fixed button mapping for TrackMan and added delay for NeXT Mouse.
Can you try TrackMan, wireless MouseMan and NeXT with attached firmware?

* adb_usb_rev1.hex (67.76 kB - downloaded 76 times.) (TMK:d477af/LUFA:d6a7df)

Thanks
« Last Edit: Wed, 04 May 2022, 21:48:05 by hasu »

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK ADB to USB keyboard converter
« Reply #1156 on: Fri, 08 April 2022, 11:25:14 »
About Mouse, too :

I have tested all my one button mice, and i have for mouse who will not work.

- A black M2706 will not work (my two other beige are working). But the logs see a mouse.
- A trackball from Elecom. It's recognised on the log, but with a "fail" message. (https://www.journaldulapin.com/2021/03/26/trackball-adb/)
- A very weird mouse. https://www.journaldulapin.com/2017/04/12/optical-usb-adb/ It's an optical USB mouse from Kensington with a USB (female) to ADB male adapter. It's a passive adapter, like PS/2 to USB. The mouse will not work (and the LED is off).
- An OEM mouse (from a StarMax clone) : nothing appear. The mouse is broken

The three first mouse are working with my iMate. The last one is different : it seems there is a problem with mouse, it will not work every time, even with iMate.

Try new firmware.
Elecom one seems to fail just like NeXT. New firmware may work with it.

Optical mouse doesn't get enough power, perhaps?
Try powered hub and short USB cable.

Offline jzw95

  • Posts: 11
  • Location: Edinburgh, Scotland
Re: TMK ADB to USB keyboard converter
« Reply #1157 on: Fri, 08 April 2022, 15:51:15 »
@jzw95 the TMK ADB to USB adapter does just that ADB -> USB (using old mac peripherals on new usb computers)

if you want to go the other direction USB -> ADB, the wombat is what you're looking for. (using new peripherals on old macs)
https://www.bigmessowires.com/usb-wombat/

@nevin, thanks for the confirmation, this is what I suspected. I think I might still go for the TMK ADB to USB adapter, as currently I only need to use old ADB keyboards with a modern Mac. But good to know the limitations in the future as I can see wanting to do the reverse at some point too.  :)

Offline Dandu

  • Posts: 43
Re: TMK ADB to USB keyboard converter
« Reply #1158 on: Sat, 09 April 2022, 12:39:07 »

Try new firmware.
Elecom one seems to fail just like NeXT. New firmware may work with it.

Optical mouse doesn't get enough power, perhaps?
Try powered hub and short USB cable.

-> The optical mouse will not work. Sometimes, the LED is on, but not all the time. And i have nothing on the log. I test on a Thunderbolt dock with a short cable.

-> The Elecom trackball fail every time.

-> The NeXT Mouse seems to work.

-> The Logitech wireless mouse is working like the wired. The three button are working.

-> The Trackman trackball is working with this firmware, and the right button is on the right.


Offline Dandu

  • Posts: 43
Re: TMK ADB to USB keyboard converter
« Reply #1159 on: Sat, 09 April 2022, 12:45:08 »
And today, i have tried a thing : I have connected many two button ADB mouse on a Power Mac G3 under Mac OS X (the Blue G3 has a native ADB port).

And the result is interessant : the mouse with native right clic (NeXT and Pippin) don't make a right clic (i have only the left clic).
But the three mouse with the extended protocol (the two Logitech and the Kensington) are making a right clic. It seems that Mac OS X (Tiger, here) can handle the extended protocol. And it's like with your adapter : the right clic is on the "button 2", aka middle button on the Logitech mouse.

The code for the driver seems to be open source, on Tiger : https://opensource.apple.com/releases/ (AppleADBMouse)

Offline nevin

  • Posts: 1646
  • Location: US
Re: TMK ADB to USB keyboard converter
« Reply #1160 on: Sat, 09 April 2022, 13:56:16 »
yeah, all of the adb mice were from the Classic Mac OS era (up to OS 9).
might be able to run them under OSX, but would probably require an extension (version of extension may change depending on what version of OSX because there were a lot of code language changes through OSX's evolution).

you might be able to find old OSX extensions of those particular mice online (there are a couple sites for old 68k software)
i have a ton of old mac addict cd's from that era that had old software, etc. on them. i could probably search through them if i knew brand - model of the mice in question.
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK ADB to USB keyboard converter
« Reply #1161 on: Sat, 09 April 2022, 23:04:16 »

Try new firmware.
Elecom one seems to fail just like NeXT. New firmware may work with it.

Optical mouse doesn't get enough power, perhaps?
Try powered hub and short USB cable.

-> The optical mouse will not work. Sometimes, the LED is on, but not all the time. And i have nothing on the log. I test on a Thunderbolt dock with a short cable.


You still have 470(or 1k) ohm pull-up resistor on the converter, right?
Try it on other Windows or Linux computer to see if there is diferrence.

Seeing behaviour of the LED I would still suspect voltage of power line.
Check voltage between VCC and GND at ADB connector with Multimeter.

But converter firmware can still causes this problem.
We probably need to look into low level things. If you have oscilloscope or logic analzyer see singals on data line.

Concerns:
* hardware: power line(votage drop)
* hardware: data line drive capability
  I found that iMate connects four I/O ports of MCU to data line. I think they are intended to augment line drive(sink) capability(12mA * 4). TMK converter sink capability may be weak(20mA) in some situations.
* firmware: low level signal processing code
  current implementation may be too optimistic to support irregular or severe timing signals.




Quote
-> The Elecom trackball fail every time.

This doesn't seem to support second address change for some reason. Current converter implementation require 2-time address change to support hot-plug. The conveter can't work with this device probably.



Quote
-> The NeXT Mouse seems to work.
hmm, it still fails. It may require more time.


Quote
-> The Logitech wireless mouse is working like the wired. The three button are working.
You mean middle and right button work correctly?



Quote
-> The Trackman trackball is working with this firmware, and the right button is on the right.
So, middle and right button work correctly now?
« Last Edit: Sat, 09 April 2022, 23:05:50 by hasu »

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK ADB to USB keyboard converter
« Reply #1162 on: Sun, 10 April 2022, 01:00:42 »
And today, i have tried a thing : I have connected many two button ADB mouse on a Power Mac G3 under Mac OS X (the Blue G3 has a native ADB port).

And the result is interessant : the mouse with native right clic (NeXT and Pippin) don't make a right clic (i have only the left clic).
But the three mouse with the extended protocol (the two Logitech and the Kensington) are making a right clic. It seems that Mac OS X (Tiger, here) can handle the extended protocol. And it's like with your adapter : the right clic is on the "button 2", aka middle button on the Logitech mouse.

OSX just ignore second(right) button with 'Classic' mouses for some reason. Weird 2-buttons mouses could work on the old Mac due to this.

With 'Extended' mouses OSX seems to map second button to right click and third button to middle click by default according to source codes.
I guess this should work for most mouses but right and middle button swap can happen for some, perhaps.

The converter should/can emulate this behaviour at expense of NeXT mouse and Pippin right click.


Did the Logitech devices(MouseMan and MouseMan Cordless) register middle and right button correctly on PowerMac?

And how four buttons of Kensington thinking mouse are mapped? which one is middle click in perticular?


 

Offline Dandu

  • Posts: 43
Re: TMK ADB to USB keyboard converter
« Reply #1163 on: Sun, 10 April 2022, 04:47:39 »
You still have 470(or 1k) ohm pull-up resistor on the converter, right?
Try it on other Windows or Linux computer to see if there is diferrence.

Seeing behaviour of the LED I would still suspect voltage of power line.
Check voltage between VCC and GND at ADB connector with Multimeter.

But converter firmware can still causes this problem.
We probably need to look into low level things. If you have oscilloscope or logic analzyer see singals on data line.

Concerns:
* hardware: power line(votage drop)
* hardware: data line drive capability
  I found that iMate connects four I/O ports of MCU to data line. I think they are intended to augment line drive(sink) capability(12mA * 4). TMK converter sink capability may be weak(20mA) in some situations.
* firmware: low level signal processing code
  current implementation may be too optimistic to support irregular or severe timing signals.

I have not an analyzer, sorry. But yes, i have the resistor (4,7K actually).

Quote
This doesn't seem to support second address change for some reason. Current converter implementation require 2-time address change to support hot-plug. The conveter can't work with this device probably.

OK.

Quote
-> The Logitech wireless mouse is working like the wired. The three button are working.

So, middle and right button work correctly now?

Yep. To be exact :

left clic (on the mouse) is left clic (button 1). middle clic (on the mouse) is right clic (button 2). right clic (on the mouse) is button 3.


Offline Dandu

  • Posts: 43
Re: TMK ADB to USB keyboard converter
« Reply #1164 on: Sun, 10 April 2022, 04:51:11 »

OSX just ignore second(right) button with 'Classic' mouses for some reason. Weird 2-buttons mouses could work on the old Mac due to this.

With 'Extended' mouses OSX seems to map second button to right click and third button to middle click by default according to source codes.
I guess this should work for most mouses but right and middle button swap can happen for some, perhaps.

The converter should/can emulate this behaviour at expense of NeXT mouse and Pippin right click.


Did the Logitech devices(MouseMan and MouseMan Cordless) register middle and right button correctly on PowerMac?

And how four buttons of Kensington thinking mouse are mapped? which one is middle click in perticular?

I don't know how to check middle clic on old Mac OS X, but i suppose it works, because right clic is working (i have the contextual menu).

For the Kensington mouse, there is two row of mouse button. Upper left is button 1 (left), upper right is button (right), bottom left is button 3 and bottom right is button 4 (the button you have mapped to emulate a mouse wheel).

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK ADB to USB keyboard converter
« Reply #1165 on: Sun, 10 April 2022, 07:14:07 »
You still have 470(or 1k) ohm pull-up resistor on the converter, right?
Try it on other Windows or Linux computer to see if there is diferrence.

Seeing behaviour of the LED I would still suspect voltage of power line.
Check voltage between VCC and GND at ADB connector with Multimeter.

But converter firmware can still causes this problem.
We probably need to look into low level things. If you have oscilloscope or logic analzyer see singals on data line.

Concerns:
* hardware: power line(votage drop)
* hardware: data line drive capability
  I found that iMate connects four I/O ports of MCU to data line. I think they are intended to augment line drive(sink) capability(12mA * 4). TMK converter sink capability may be weak(20mA) in some situations.
* firmware: low level signal processing code
  current implementation may be too optimistic to support irregular or severe timing signals.

I have not an analyzer, sorry. But yes, i have the resistor (4,7K actually).

iMate uses 470 ohm pull-up register as said before. And my TMK ADB-USB converter uses 1K.
This is different from your converter. 1K or 470 ohm pull-up resistor is preferable.



Quote
Quote
-> The Logitech wireless mouse is working like the wired. The three button are working.

So, middle and right button work correctly now?

Yep. To be exact :

left clic (on the mouse) is left clic (button 1). middle clic (on the mouse) is right clic (button 2). right clic (on the mouse) is button 3.

I see. This is not useful for users. Now I will fix button maping for Logitech Mouseman in new firmware.




OSX just ignore second(right) button with 'Classic' mouses for some reason. Weird 2-buttons mouses could work on the old Mac due to this.

With 'Extended' mouses OSX seems to map second button to right click and third button to middle click by default according to source codes.
I guess this should work for most mouses but right and middle button swap can happen for some, perhaps.

The converter should/can emulate this behaviour at expense of NeXT mouse and Pippin right click.


Did the Logitech devices(MouseMan and MouseMan Cordless) register middle and right button correctly on PowerMac?

And how four buttons of Kensington thinking mouse are mapped? which one is middle click in perticular?

I don't know how to check middle clic on old Mac OS X, but i suppose it works, because right clic is working (i have the contextual menu).

For the Kensington mouse, there is two row of mouse button. Upper left is button 1 (left), upper right is button (right), bottom left is button 3 and bottom right is button 4 (the button you have mapped to emulate a mouse wheel).

Kinsington mouse buttons seem to work correctly.




Please test Logitech MouseMan(Wired), MouseMan Cordless and TrackMan with attached firmware.
Middle button should work as middle button, and right button should work as right button now.


* adb_usb_rev1.hex (67.88 kB - downloaded 68 times.)

Offline Dandu

  • Posts: 43
Re: TMK ADB to USB keyboard converter
« Reply #1166 on: Sun, 10 April 2022, 11:22:20 »
So with the last firmware :

The right button is a right clic with the three Logitech mouse, and the middle clic is a button 3 clic (middle clic, i mean). It seems OK.

I have replaced the 4,7K ohm resistor with a 470 ohm resistor, and the NeXT mouse will not work every time with that (i will try tomorrow with a 1K ohm). When i "hot" plug the mouse (i connect USB, and afer that, i insert ADB), it will not work. When i cold plug (connect ADB, and then connect USB), it will work, but not all the time.

Offline nevin

  • Posts: 1646
  • Location: US
Re: TMK ADB to USB keyboard converter
« Reply #1167 on: Sun, 10 April 2022, 12:12:20 »
also, if we are starting to look at possible hardware issues. first thing i would check in the mice that are dead/unresponsive is the capacitors. they are usually the first thing to go in old electronics. there have been a lot of old model-m keyboards that have been brought back to life by replacing the bad capacitors.

here's some ways to test
https://smtinsight.com/how-to-test-a-capacitor-with-a-multimeter/
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline jzw95

  • Posts: 11
  • Location: Edinburgh, Scotland
Re: TMK ADB to USB keyboard converter
« Reply #1168 on: Sun, 10 April 2022, 14:59:59 »
Regarding the 1k ohm resistor when building the converter: what power rating does it need to support? I gather that the version of USB being used supports up to 2.5W (500mA * 5V), but I don't think the pull-up resistor needs to support that much. But maybe I'm misunderstanding things and it does? I want to make sure I don't buy a resistor with insufficient power rating.

Also, I see that in the Wiring instructions for the converter, it states:

Quote
This is not needed but you can connect PSW to PD1 optionally.

Does connecting PSW to PD1 enable any extra functionality or make any difference?

Thanks!

Offline nevin

  • Posts: 1646
  • Location: US
Re: TMK ADB to USB keyboard converter
« Reply #1169 on: Sun, 10 April 2022, 17:21:06 »
resistor... common 1/4 watt are fine and what you'll find most everywhere.

Quote
Does connecting PSW to PD1 enable any extra functionality or make any difference?
not sure. @hasu?
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK ADB to USB keyboard converter
« Reply #1170 on: Sun, 10 April 2022, 18:27:22 »
resistor... common 1/4 watt are fine and what you'll find most everywhere.

Quote
Does connecting PSW to PD1 enable any extra functionality or make any difference?
not sure. @hasu?

Yes 1/4 watt is enough.
We can use simple application Ohm's law here.

Current flow of pull-up resistor is:
5V/1K ohm = 5mA
5V/470 ohm = 0.010638297872340425A

Power dissipation:
5V * 5mA = 25mW for 1K
0.010638297872340425*5 = 0.05319148936170213W = 53mW for 470

So I think 1/10, 1/8 and 1/6W even work.
I'm not an expert and this calculation may be too naive for actual world.



As for PSW  it works for nothing with the current converter firmware actually. No difference even if you connect the pin.
The pin is drived to low when pressing Power key and it was used to power-up computer in classic Mac era.

Power key can be recognized with only DATA pin as long as keyboard gets powered.
Also note that you can wake-up computer from USB sleep by any key(including Power key) without PSW pin.

In the result you don't have to connect PSW pin. I don't have any idea/plan on use of the pin at this time.


EDIT: I updated the first post for pull-up and PSW.
Check this also for details. https://github.com/tmk/tmk_keyboard/wiki/Apple-Desktop-Bus#pull-up-resistor
« Last Edit: Sun, 10 April 2022, 19:17:19 by hasu »

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK ADB to USB keyboard converter
« Reply #1171 on: Sun, 10 April 2022, 20:46:42 »
So with the last firmware :

The right button is a right clic with the three Logitech mouse, and the middle clic is a button 3 clic (middle clic, i mean). It seems OK.

I have replaced the 4,7K ohm resistor with a 470 ohm resistor, and the NeXT mouse will not work every time with that (i will try tomorrow with a 1K ohm). When i "hot" plug the mouse (i connect USB, and afer that, i insert ADB), it will not work. When i cold plug (connect ADB, and then connect USB), it will work, but not all the time.

Great! Thanks for the test.

I added specific driver code to converter firmware for the two MouseMan, they are not completely compatible with Apple Extended Mouse protocol for some reason.
Without Logitech driver users would get swapped middle and right button on old OSX,  this was not useful. (This is what you observed on Tiger and apple source code indicates.)



I'll clean the code and make new release of firmware soon.
Let me know if you find incorrect button mapping on other 3-button mouses.




Multi-button pointing devices below are supported now.
https://github.com/tmk/tmk_keyboard/issues/725

Confirmed device/protocols:
- Kensington Turbo Mouse 5   
- Kensington Thinking Mouse   
- Macally 2-button Mouse   
- Logitech TrackMan/MouseMan(Prorietary)   
- Logitech TrackMan/MouseMan(Extended)   
- Contour Design Countour Mouse   

Not confirmed yet. We need to work on especially button mapping.
- Microspeed MacTrac   
- Mouse Systems A3 Mouse/Trackball   
- CH Products Trackball Pro/DT225   


2-button mouse should work as it works on OSX now.
Left button should work as leftt click while right button depneds on specific device.
Some will work as click-lock(drag), other duble-click or triple-click. Even right button may do nothing like NeXT Mouse.
https://github.com/tmk/tmk_keyboard/issues/724
« Last Edit: Sun, 10 April 2022, 20:48:50 by hasu »

Offline nevin

  • Posts: 1646
  • Location: US
Re: TMK ADB to USB keyboard converter
« Reply #1172 on: Mon, 11 April 2022, 05:11:04 »
I was just saying 1/4w are probably the most common / easiest to find.

Thanks for the explanation on PSW to PD1. I didn't know that's what that was supposed to do but i do know what you're talking about.
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline jzw95

  • Posts: 11
  • Location: Edinburgh, Scotland
Re: TMK ADB to USB keyboard converter
« Reply #1173 on: Mon, 11 April 2022, 08:08:53 »
Thanks @nevin & @hasu for the details and confirmation regarding the resistor. I was hoping I could get away with 1/4W.  ;D

Interesting, also, about the PSW pin. I suppose it's only useful if doing a converter the other way (allowing USB keyboards to be used with old ADB Macs – the early Apple USB keyboards had a power button). I'm still debating whether I connect it just to be a "completionist", but we'll see…

Thanks all, this is a great project.

Offline nevin

  • Posts: 1646
  • Location: US
Re: TMK ADB to USB keyboard converter
« Reply #1174 on: Mon, 11 April 2022, 08:22:05 »
the old PPC iMacs, and a bunch of the towers from that time that were usb also worked that way with a power button on the keyboard. (graphite, blue & white, etc.) it more depended on the keyboard you were using than the tower.

the power button was removed on the apple pro keyboard and has been missing since then. (year: 2000-ish)

284814-0
from: https://en.wikipedia.org/wiki/Apple_keyboards#Apple_USB_Keyboard_(M2452)
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK ADB to USB keyboard converter
« Reply #1175 on: Tue, 12 April 2022, 20:23:23 »
[FIRMWARE UPDATE]
Updated converter firmware and you can get it from Keymap Editor or github repo.

http://www.tmk-kbd.com/tmk_keyboard/editor/
https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb/binary


* Change default setting for mouse
- Disable mouse scroll wheel emulation by default
- Disable mouse acceleration by default
- Disable 16-bit USB HID mouse report by default
You can still re-enable these features by editing in config.h or Makefile.


* Multi-button pointing devices below are supported now
https://github.com/tmk/tmk_keyboard/issues/725

Confirmed:
- Kensington Turbo Mouse 5   
- Kensington Thinking Mouse   
- Macally 2-button Mouse   
- Logitech TrackMan/MouseMan(Prorietary)   
- Logitech TrackMan/MouseMan(Extended)   
- Contour Design Countour Mouse   

Not confirmed yet:
- Microspeed MacTrac   
- Mouse Systems A3 Mouse/Trackball   
- CH Products Trackball Pro/DT225   


* 2-button mouse should work as it works on Mac OS9/OSX now
Left button should work as leftt click while right button depneds on specific device.
Some will work as click-lock(drag), other duble-click or triple-click. Even right button may do nothing like NeXT Mouse.
https://github.com/tmk/tmk_keyboard/issues/724



Offline nevin

  • Posts: 1646
  • Location: US
Re: TMK ADB to USB keyboard converter
« Reply #1176 on: Tue, 12 April 2022, 23:14:01 »
thank you both for all your work on this.
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline Dandu

  • Posts: 43
Re: TMK ADB to USB keyboard converter
« Reply #1177 on: Wed, 13 April 2022, 11:28:24 »
Thank you Hasu !

Offline Dandu

  • Posts: 43
Re: TMK ADB to USB keyboard converter
« Reply #1178 on: Wed, 13 April 2022, 11:46:19 »
I have tested a second batch of peripherals : keyboard

• First, Keypad. I have four keypad and none of them will work. I have light (like num. key LED), but nothing on the logs. I suppose that there is a trick or a specific things for that.


• I have tried many keyboard without problem, and five with different problems.

-> The Pioneer KB2 (https://www.journaldulapin.com/2019/03/07/un-clavier-de-pioneer-mpc-pour-mac/) from a Pioneer clone. I have a fail into the logs, and that's all.
-> A Macally MK105X, used with many clone from Motorola, Power Computing, etc. Same thing.

-> An Apple Keyboard II, japanese layout. I'm not sure if i have a problem or if it's a feature : many key are not working on my Mac. The adapter receive a code, but i have nothing on my Mac Is this a problem with the layout ? There is a ¥ key, the enter key at the right of space, etc. And on this keyboard, the left alt key is "altRight". But i have a french Mac, with european french layout used.

-> The NeXT ADB Keyboard. All the key are working except the 5 media key. There is key for sound (nothing appear on log), a power key (nothing on log) and two brightness key. The brightness "up" do nothing, but the "down" send PageDown.

-> An AlphaSmart 2000. It's a word processor with ADB, who can act like a keyboard. https://www.journaldulapin.com/2018/03/07/alphasmart-adb/ Actually, the AlphaSmart detect the Mac but the logs don't see it. When the word processor is connected, i can use it as a Keyboard, and press a key to send the text i have written to the Mac. When i have write about it in 2018, it has work with your adapter (but it was an old firmware).

And i have two questions. Why is there many keyboard who send "leftShift" for the two shift key, and other keyboard who send left and right (different). Is there a logic, a specific thing ?
And i have tested the Adjustable Keyboard. The "mic" key send a thing, but what ? When i press the key, it cut the audio.

Offline nevin

  • Posts: 1646
  • Location: US
Re: TMK ADB to USB keyboard converter
« Reply #1179 on: Wed, 13 April 2022, 13:26:02 »
media keys... it's a known thing. same with apple adjustable keyboard. (send different codes/etc. then what's part of the matrix? is this correct hasu?)

left/right.... at least a lot of apple boards did not differentiate electronically between left & right... shift, command, option, etc. (they were physically two switches in the same spot in the key matrix)
« Last Edit: Wed, 13 April 2022, 13:27:44 by nevin »
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline nevin

  • Posts: 1646
  • Location: US
Re: TMK ADB to USB keyboard converter
« Reply #1180 on: Wed, 13 April 2022, 13:32:23 »
also, can we see a pile of all your peripherals?
it has to be almost a mountain.

to be honest... little jealous about the next keyboard.
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK ADB to USB keyboard converter
« Reply #1181 on: Wed, 13 April 2022, 19:00:29 »
I have tested a second batch of peripherals : keyboard

• First, Keypad. I have four keypad and none of them will work. I have light (like num. key LED), but nothing on the logs. I suppose that there is a trick or a specific things for that.
You  see 'R' , 'S', 's', or other charactors on hid_listen when hot-plug the keypads *several times*? Or really nothing? They work with iMate, right?

I think keypad  consists of usual 'keyboard' and 'mouse' in terms of ADB protocol, I guess no 'trick' is required.

First try 1k ohm pull-up and then 470 ohm if 1k doesn't work.
Also try on Windows or Linux.

Let me know more info about the keypads like product name or FCC ID. It would be helpful if you can find manual or other documents in the net.


Quote
• I have tried many keyboard without problem, and five with different problems.

-> The Pioneer KB2 (https://www.journaldulapin.com/2019/03/07/un-clavier-de-pioneer-mpc-pour-mac/) from a Pioneer clone. I have a fail into the logs, and that's all.
-> A Macally MK105X, used with many clone from Motorola, Power Computing, etc. Same thing.
I'll look into this problem later.


Quote
-> An Apple Keyboard II, japanese layout. I'm not sure if i have a problem or if it's a feature : many key are not working on my Mac. The adapter receive a code, but i have nothing on my Mac Is this a problem with the layout ? There is a ¥ key, the enter key at the right of space, etc. And on this keyboard, the left alt key is "altRight". But i have a french Mac, with european french layout used.
Japanese specific keys will be recognzied if you select Japanese layout on your OS, or you can remap the keys on Keymap Editor.
How do the keys work with iMate?



Quote
-> The NeXT ADB Keyboard. All the key are working except the 5 media key. There is key for sound (nothing appear on log), a power key (nothing on log) and two brightness key. The brightness "up" do nothing, but the "down" send PageDown.
Log is needed for the keys and startup.
Media keys on Apple Adjustable Keyboard are supported but NeXT may require other code.



Quote
-> An AlphaSmart 2000. It's a word processor with ADB, who can act like a keyboard. https://www.journaldulapin.com/2018/03/07/alphasmart-adb/ Actually, the AlphaSmart detect the Mac but the logs don't see it. When the word processor is connected, i can use it as a Keyboard, and press a key to send the text i have written to the Mac. When i have write about it in 2018, it has work with your adapter (but it was an old firmware).
Try and see if this firmware from Jan, 2018 works if the firmware worked before.
https://github.com/tmk/tmk_keyboard/tree/14e9a84c9c3b571cc932fcaaedbdb9354dbc2697/converter/adb_usb/binary



Quote
And i have two questions. Why is there many keyboard who send "leftShift" for the two shift key, and other keyboard who send left and right (different). Is there a logic, a specific thing ?
And i have tested the Adjustable Keyboard. The "mic" key send a thing, but what ? When i press the key, it cut the audio.
You mean Left shift key both left and right shift at same time? That is weird and interesting. The converter doesn't anything like that for shift keys.
I guess keyboards do that. What are name of the keyboards exactly?

Extended keyboard(M0115/M3501) and compatibles can send correct left and right shift respectively.  While standard keyboard(M0116) sends only Left shift.See the first post.

Mic key sends 'Play/Pause' on Adjustable Keyboard.


Offline nevin

  • Posts: 1646
  • Location: US
Re: TMK ADB to USB keyboard converter
« Reply #1182 on: Wed, 13 April 2022, 22:34:46 »
Quote
Mic key sends 'Play/Pause' on Adjustable Keyboard.

apologies, been a LONG time since i updated what's running on the converter.
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline Dandu

  • Posts: 43
Re: TMK ADB to USB keyboard converter
« Reply #1183 on: Mon, 18 April 2022, 10:42:29 »
also, can we see a pile of all your peripherals?
it has to be almost a mountain.

to be honest... little jealous about the next keyboard.

I have many photos on my website : https://www.journaldulapin.com/tag/adb/
 
I have collected a lot if things since ~10 years.

Offline Dandu

  • Posts: 43
Re: TMK ADB to USB keyboard converter
« Reply #1184 on: Mon, 18 April 2022, 11:28:34 »
You  see 'R' , 'S', 's', or other charactors on hid_listen when hot-plug the keypads *several times*? Or really nothing? They work with iMate, right?

I think keypad  consists of usual 'keyboard' and 'mouse' in terms of ADB protocol, I guess no 'trick' is required.

First try 1k ohm pull-up and then 470 ohm if 1k doesn't work.
Also try on Windows or Linux.

Let me know more info about the keypads like product name or FCC ID. It would be helpful if you can find manual or other documents in the net.

I have tried with the 470 ohm resistor.

I have nothing on the logs. The first one turn on (there is LED), the second is working, but only the trackball side, the last is turning on, and that's all.
And yep, they are working with iMate.

First one : NT-MAC2ST by Sanwa Supply. A basic keypad, with an female ADB to chain.
Second : Scorpius 19ADB, FCCID : F2QKPT19ADB. This one contain a trackball and ADB female.
Three : Model 9602, FCCID : FTR9602. This one is a keypad and a calculator, with a little display. And a cool things : it's possible to make a operation and paste the result to the Mac.

Quote
Japanese specific keys will be recognzied if you select Japanese layout on your OS, or you can remap the keys on Keymap Editor.
How do the keys work with iMate?

I have tried with the layout (with macOS) and i have nothing (event with the iMate). The keyboard send the code, but i have nothing on screen (and nothing on my HID software).

For the "RightAlt", it's very weird : with your adapter, the left option key (it's the only option key on this keyboard) send "RightAlt". And with the iMate, it sends "LeftAlt".

Actually, i join the logs with the 4 keys who are "not working".

Quote
Log is needed for the keys and startup.
Media keys on Apple Adjustable Keyboard are supported but NeXT may require other code.

The power key are not on the log (nothing appear).

The Down Brightness send 79FF F9FF
The Up Brightness send 74FF F4FF (but i must press very strong, i think i must clean the keyboard)
The Up Volume send 73FF F3FF (Home), like the precedent (i must press very strong).

Actually, it will be a hardware problem, i will try to clean the keyboard.
 
Quote
Try and see if this firmware from Jan, 2018 works if the firmware worked before.
https://github.com/tmk/tmk_keyboard/tree/14e9a84c9c3b571cc932fcaaedbdb9354dbc2697/converter/adb_usb/binary

I have tried with the old firmware, it works. I have used the AlphaSmart as a keyboard, and i can send text for the word processor to the Mac.

Quote
You mean Left shift key both left and right shift at same time? That is weird and interesting. The converter doesn't anything like that for shift keys.
I guess keyboards do that. What are name of the keyboards exactly?

Extended keyboard(M0115/M3501) and compatibles can send correct left and right shift respectively.  While standard keyboard(M0116) sends only Left shift.See the first post.

Mic key sends 'Play/Pause' on Adjustable Keyboard.

No, i mean that the keyboard send leftshift for the lef shift, and rightshift for the right key. 
OK, its the problem in the first post : i suppose the NeXT keyboard is extended and send the correct key.

Offline nevin

  • Posts: 1646
  • Location: US
Re: TMK ADB to USB keyboard converter
« Reply #1185 on: Mon, 18 April 2022, 13:09:57 »
on the apple adjustable keyboard
- if you have to press the media keys hard to get them to register, the little tact switches are shot & need replaced.
what happens is the tiny dome that's in the switch gets squashed and no longer makes contact like it's supposed to.
see attached pic form the deskthority wiki
285181-0

« Last Edit: Mon, 18 April 2022, 13:17:15 by nevin »
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK ADB to USB keyboard converter
« Reply #1186 on: Mon, 18 April 2022, 19:57:54 »
You  see 'R' , 'S', 's', or other charactors on hid_listen when hot-plug the keypads *several times*? Or really nothing? They work with iMate, right?

I think keypad  consists of usual 'keyboard' and 'mouse' in terms of ADB protocol, I guess no 'trick' is required.

First try 1k ohm pull-up and then 470 ohm if 1k doesn't work.
Also try on Windows or Linux.

Let me know more info about the keypads like product name or FCC ID. It would be helpful if you can find manual or other documents in the net.

I have tried with the 470 ohm resistor.

I have nothing on the logs. The first one turn on (there is LED), the second is working, but only the trackball side, the last is turning on, and that's all.
And yep, they are working with iMate.

First one : NT-MAC2ST by Sanwa Supply. A basic keypad, with an female ADB to chain.
Second : Scorpius 19ADB, FCCID : F2QKPT19ADB. This one contain a trackball and ADB female.
Three : Model 9602, FCCID : FTR9602. This one is a keypad and a calculator, with a little display. And a cool things : it's possible to make a operation and paste the result to the Mac.

I couldn't find info much about those keypads in the net. I think you said you have four keypads, is there any info of fourth one?

I've never found documentation or code that indicates keypads require special handling, but I may miss something.

Can you try old firmware as AlphaSmart to see difference?





Quote
Quote
Japanese specific keys will be recognzied if you select Japanese layout on your OS, or you can remap the keys on Keymap Editor.
How do the keys work with iMate?

I have tried with the layout (with macOS) and i have nothing (event with the iMate). The keyboard send the code, but i have nothing on screen (and nothing on my HID software).

For the "RightAlt", it's very weird : with your adapter, the left option key (it's the only option key on this keyboard) send "RightAlt". And with the iMate, it sends "LeftAlt".

Actually, i join the logs with the 4 keys who are "not working".

I found that those Japanese keys are recognized by converter firmware but not completely supported in current implementation. I'll update firmware to support the Japanese keys. It seems that anyone including me didn't test with Japanese keyboard so far.

Can you share model name and pic of your keyboard to check its key layout?

As for the Left option key,
That keyboard is an Extended keyboard(the log indicates) and iMate doesn't support Extended mode(only Classic mode), the difference comes from there. I think the keyboard sends the key like that in Extended mode for some reason.

hmm,
The keyboard expects to be handled as a Classic keyboard, though it supports Extended mode?
OSX seems to handle third parties in Classic mode. I will try to emulate the OSX way.

https://github.com/apple-oss-distributions/AppleADBKeyboard/blob/AppleADBKeyboard-239.1/AppleADBKeyboard.cpp#L464-L480



Quote
Quote
Log is needed for the keys and startup.
Media keys on Apple Adjustable Keyboard are supported but NeXT may require other code.

The power key are not on the log (nothing appear).

The Down Brightness send 79FF F9FF
The Up Brightness send 74FF F4FF (but i must press very strong, i think i must clean the keyboard)
The Up Volume send 73FF F3FF (Home), like the precedent (i must press very strong).

Actually, it will be a hardware problem, i will try to clean the keyboard.

NeXT ADB keyboard was designed for NeXT computer and not for Apple Mac, so not compatible completely for Apple ADB. Those scan codes are PageDown, PageUp and Home respectively, but somewhat reasonable for position of the keys.

The converter works as expected there. You can remap the keys if you want.

Let me know if Power key sends nothing after cleaning.
EDIT: NeXT Power key doesn't register scan code. https://geekhack.org/index.php?topic=14290.msg2998949#msg2998949

In that case it will need firmware chage to see PSW pin directly on ADB signal. But your converter hardware(ADBUSB-0x1) doesn't have connection for PSW unfortunately, you will need to solder.

On Apple ADB keyboards Power key sends scan code '7F' and it doesn't require PSW.



Quote

Quote
Try and see if this firmware from Jan, 2018 works if the firmware worked before.
https://github.com/tmk/tmk_keyboard/tree/14e9a84c9c3b571cc932fcaaedbdb9354dbc2697/converter/adb_usb/binary

I have tried with the old firmware, it works. I have used the AlphaSmart as a keyboard, and i can send text for the word processor to the Mac.

Interesting. I'll look into difference between current implementation and old one.
« Last Edit: Mon, 18 April 2022, 21:19:38 by hasu »

Offline Dandu

  • Posts: 43
Re: TMK ADB to USB keyboard converter
« Reply #1187 on: Tue, 19 April 2022, 12:01:35 »
I couldn't find info much about those keypads in the net. I think you said you have four keypads, is there any info of fourth one?

I've never found documentation or code that indicates keypads require special handling, but I may miss something.

Can you try old firmware as AlphaSmart to see difference?

The fourth one is a KeyPad for Pippin, i will try to test it this week.
I have tried with the old firmware, and i have nothing (but they turn on).

I have tested on my Mac (G3) with an ADB parser soft, and i don't see a specific things.

Quote
I found that those Japanese keys are recognized by converter firmware but not completely supported in current implementation. I'll update firmware to support the Japanese keys. It seems that anyone including me didn't test with Japanese keyboard so far.

Can you share model name and pic of your keyboard to check its key layout?

As for the Left option key,
That keyboard is an Extended keyboard(the log indicates) and iMate doesn't support Extended mode(only Classic mode), the difference comes from there. I think the keyboard sends the key like that in Extended mode for some reason.

hmm,
The keyboard expects to be handled as a Classic keyboard, though it supports Extended mode?
OSX seems to handle third parties in Classic mode. I will try to emulate the OSX way.

https://github.com/apple-oss-distributions/AppleADBKeyboard/blob/AppleADBKeyboard-239.1/AppleADBKeyboard.cpp#L464-L480

It's a Apple Keyboard II, M0487 (FCCID : BCGM0487)
I join a photo.

Quote
NeXT ADB keyboard was designed for NeXT computer and not for Apple Mac, so not compatible completely for Apple ADB. Those scan codes are PageDown, PageUp and Home respectively, but somewhat reasonable for position of the keys.

The converter works as expected there. You can remap the keys if you want.

Let me know if Power key sends nothing after cleaning.
EDIT: NeXT Power key doesn't register scan code. https://geekhack.org/index.php?topic=14290.msg2998949#msg2998949

In that case it will need firmware chage to see PSW pin directly on ADB signal. But your converter hardware(ADBUSB-0x1) doesn't have connection for PSW unfortunately, you will need to solder.

On Apple ADB keyboards Power key sends scan code '7F' and it doesn't require PSW.

OK, i will try to clean up the inside, first.

Quote

Interesting. I'll look into difference between current implementation and old one.

It's a very weird keyboard, by the way. But it works with a real Mac, as a keyboard.

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK ADB to USB keyboard converter
« Reply #1188 on: Tue, 19 April 2022, 22:25:37 »
I couldn't find info much about those keypads in the net. I think you said you have four keypads, is there any info of fourth one?

I've never found documentation or code that indicates keypads require special handling, but I may miss something.

Can you try old firmware as AlphaSmart to see difference?

The fourth one is a KeyPad for Pippin, i will try to test it this week.
I have tried with the old firmware, and i have nothing (but they turn on).

I have tested on my Mac (G3) with an ADB parser soft, and i don't see a specific things.

I'll have to get one of keypads to check in hand if we can't find any clue.
It is not so difficult to find cheap ADB keypad.


Quote
Quote
I found that those Japanese keys are recognized by converter firmware but not completely supported in current implementation. I'll update firmware to support the Japanese keys. It seems that anyone including me didn't test with Japanese keyboard so far.

Can you share model name and pic of your keyboard to check its key layout?

As for the Left option key,
That keyboard is an Extended keyboard(the log indicates) and iMate doesn't support Extended mode(only Classic mode), the difference comes from there. I think the keyboard sends the key like that in Extended mode for some reason.

hmm,
The keyboard expects to be handled as a Classic keyboard, though it supports Extended mode?
OSX seems to handle third parties in Classic mode. I will try to emulate the OSX way.

https://github.com/apple-oss-distributions/AppleADBKeyboard/blob/AppleADBKeyboard-239.1/AppleADBKeyboard.cpp#L464-L480

It's a Apple Keyboard II, M0487 (FCCID : BCGM0487)
I join a photo.

Can you check if these scan codes are correct for M0487?  Especially Japanese keys( JPY, RO, EIS, KAN).
Also let me know scan code for ](left to Return) and , (on keypad).


Quote

                   ,--------.
                   |  Power |
                   `--------'
,-----------------------------------------------------------.  ,---------------.
|Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  ^|JPY|Del|  |Clr|  =|  /|  *|
|-----------------------------------------------------------|  |---------------|
|Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  @|  [|     |  |  7|  8|  9|  +|
|------------------------------------------------------`    |  |---------------|
|Ctrl  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  :|  ]|Retn|  |  4|  5|  6|  -|
|-----------------------------------------------------------|  |---------------|
|Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /| RO| Shift|  |  1|  2|  3|   |
|-----------------------------------------------------------|  |-----------|Ent|
|Cap| Opt | Cmd  |EIS|    Space         |KAN|Lef|Rig|Dow|Up |  |  0|  ,|  .|   |
`-----------------------------------------------------------'  `---------------'
           
                   ,--------.       
                   |   7F7F |       
                   `--------'       
,-----------------------------------------------------------.  ,---------------.
| 35| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 5D| 33|  | 47| 51| 4B| 43|
|-----------------------------------------------------------|  |---------------|
|  30 | 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E|     |  | 59| 5B| 5C| 45|
|------------------------------------------------------`    |  |---------------|
|  36  | 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27|   | 24 |  | 56| 57| 58| 4E|
|-----------------------------------------------------------|  |---------------|
|   38   | 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 6A| 7B   |  | 53| 54| 55|   |
|-----------------------------------------------------------|  |-----------| 4C|
| 39|  3A |  37  | 66|      31      | 68| 2A| 3B| 3C| 3D| 3E|  | 52|   | 41|   |
`-----------------------------------------------------------'  `---------------'








Quote
Quote
NeXT ADB keyboard was designed for NeXT computer and not for Apple Mac, so not compatible completely for Apple ADB. Those scan codes are PageDown, PageUp and Home respectively, but somewhat reasonable for position of the keys.

The converter works as expected there. You can remap the keys if you want.

Let me know if Power key sends nothing after cleaning.
EDIT: NeXT Power key doesn't register scan code. https://geekhack.org/index.php?topic=14290.msg2998949#msg2998949

In that case it will need firmware chage to see PSW pin directly on ADB signal. But your converter hardware(ADBUSB-0x1) doesn't have connection for PSW unfortunately, you will need to solder.

On Apple ADB keyboards Power key sends scan code '7F' and it doesn't require PSW.

OK, i will try to clean up the inside, first.

I found that the user already reported that NeXT Power key doesn't send scan code.
So you don't have to clean up for this anymore.

It is clear that firmware fix is required to check PSW now. I'll do that later.

Offline jzw95

  • Posts: 11
  • Location: Edinburgh, Scotland
Re: TMK ADB to USB keyboard converter
« Reply #1189 on: Mon, 25 April 2022, 11:07:09 »
I have a SparkFun Pro Micro which I've wired up as required for the ADB to USB converter (including the pull-up resistor). However, I can't figure out how to load the TMK firmware to test it out. I know the Pro Micro is working, because the Arduino IDE can see it and upload code to it which runs (e.g. I can make the RX and TX lights flash). I can get the Pro Micro into DFU mode by double-tapping the reset button, and have confirmed this is working by using the Arduino Serial Monitor. However, when I put the Pro Micro in DFU mode and try to erase the memory contents so I can upload a TMK .hex file using dfu-programmer, I get the following error (immediately):

Code: [Select]
1005 ~ » dfu-programmer atmega32u4 erase --force
dfu-programmer: no device present.

It appears that dfu-programmer doesn't know where to find the device, because it's clearly present as seen by the Arduino software, and by the presence of /dev/cu.usbmodem2101 and /dev/tty.usbmodem2101 (and it appears in System Profiler as being attached to the USB bus). Does anyone know how I can instruct dfu-programmer to find the Pro Micro? Or some other way I can erase the memory and flash the TMK firmware? I'm using MacOS 12.3.1. Any help would be greatly appreciated!

Offline nevin

  • Posts: 1646
  • Location: US
Re: TMK ADB to USB keyboard converter
« Reply #1190 on: Mon, 25 April 2022, 11:20:53 »
promicros typically have a caterina bootloader. you have to be quick to catch it (8 seconds)
- after you have your hex file ready
- open your flasher of choice, QMK toolbox, or other.
- select your file to flash
- reset the board twice quickly
- watch for the port to open up
- then hit flash in the utility.

here's a screenshot of the port opening up in qmk toolbox.
285463-0

some other controllers that use 32u4 use regular DFU and once in bootloader will stay there until they receive instructions. promicros are not like this.
« Last Edit: Mon, 25 April 2022, 11:24:10 by nevin »
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline Dandu

  • Posts: 43
Re: TMK ADB to USB keyboard converter
« Reply #1191 on: Mon, 25 April 2022, 12:15:47 »
Sorry, i'm late to respond, but the week was complicated in France.

I'll have to get one of keypads to check in hand if we can't find any clue.
It is not so difficult to find cheap ADB keypad.

Yep, i have find many keypad in Japan, it's common. I have not seen any information about a specific protocol, but's its weird to have 4 keypad with the same problem.

Quote
Can you check if these scan codes are correct for M0487?  Especially Japanese keys( JPY, RO, EIS, KAN).
Also let me know scan code for ](left to Return) and , (on keypad).

Quote

                   ,--------.
                   |  Power |
                   `--------'
,-----------------------------------------------------------.  ,---------------.
|Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  ^|JPY|Del|  |Clr|  =|  /|  *|
|-----------------------------------------------------------|  |---------------|
|Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  @|  [|     |  |  7|  8|  9|  +|
|------------------------------------------------------`    |  |---------------|
|Ctrl  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  :|  ]|Retn|  |  4|  5|  6|  -|
|-----------------------------------------------------------|  |---------------|
|Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /| RO| Shift|  |  1|  2|  3|   |
|-----------------------------------------------------------|  |-----------|Ent|
|Cap| Opt | Cmd  |EIS|    Space         |KAN|Lef|Rig|Dow|Up |  |  0|  ,|  .|   |
`-----------------------------------------------------------'  `---------------'
           
                   ,--------.       
                   |   7F7F |       
                   `--------'       
,-----------------------------------------------------------.  ,---------------.
| 35| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 5D| 33|  | 47| 51| 4B| 43|
|-----------------------------------------------------------|  |---------------|
|  30 | 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E|     |  | 59| 5B| 5C| 45|
|------------------------------------------------------`    |  |---------------|
|  36  | 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27|   | 24 |  | 56| 57| 58| 4E|
|-----------------------------------------------------------|  |---------------|
|   38   | 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 6A| 7B   |  | 53| 54| 55|   |
|-----------------------------------------------------------|  |-----------| 4C|
| 39|  3A |  37  | 66|      31      | 68| 2A| 3B| 3C| 3D| 3E|  | 52|   | 41|   |
`-----------------------------------------------------------'  `---------------'

So :
• On the right, the + and the - are inverted on your graph, but the value are good (- is top, + bottom)
• T is 11 and Y is 10
• I have a key right to : (and before Return) : ] (scan code 2A)
• The key with a kanji (i mean) between / and shift is scan code 5E (not 6A)
• At bottom left, the option key is 7C, not 3A
• The enter key between the kanji key (68) and the left key (3B) is scan code 6A (not 2A)
• On the keypad : i have 0 (code 52), a ' key (code 5F), a . key (code 41).


Quote

I found that the user already reported that NeXT Power key doesn't send scan code.
So you don't have to clean up for this anymore.

It is clear that firmware fix is required to check PSW now. I'll do that later.

 I have undertand for the Power key, but i have a problem with the other key too when i press it.

And i have received many new mouse and a joystick, too ;)

Offline hasu

  • Thread Starter
  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK ADB to USB keyboard converter
« Reply #1192 on: Mon, 25 April 2022, 23:49:43 »
Sorry, i'm late to respond, but the week was complicated in France.

I'll have to get one of keypads to check in hand if we can't find any clue.
It is not so difficult to find cheap ADB keypad.

Yep, i have find many keypad in Japan, it's common. I have not seen any information about a specific protocol, but's its weird to have 4 keypad with the same problem.

I got this keypad similar to your Sanwa NT-MAC2ST and confirmed the issue.
https://imgur.com/a/AQqM7Yv

I found that the keypad is 'dumb' and can't reply any command except for reading keys. Fixed firmware for 'dumb' keyboards/mouses like this keypad.
https://github.com/tmk/tmk_keyboard/issues/733

Test your keypads and AlphaSmart with new firmware. I think some of them woluld work.


Quote
So :
• On the right, the + and the - are inverted on your graph, but the value are good (- is top, + bottom)
• T is 11 and Y is 10
• I have a key right to : (and before Return) : ] (scan code 2A)
• The key with a kanji (i mean) between / and shift is scan code 5E (not 6A)
• At bottom left, the option key is 7C, not 3A
• The enter key between the kanji key (68) and the left key (3B) is scan code 6A (not 2A)
• On the keypad : i have 0 (code 52), a ' key (code 5F), a . key (code 41).

Thank you for the correcting. Updated scan code table here.
https://github.com/tmk/tmk_keyboard/wiki/Apple-Desktop-Bus#apple-m0487-jis


I updated firmware for the Japanese keys and they are configured as below for test.

Please confirm the keys register A-F respectively.

JPY(5D)  -  A
RO(5E)  - B
EIS(66) - C
KAN(68) - D
Ent(6A) - E
KP,(5F) - F

I'll update Keymap Editor later so that you can remap the Japanese keys.



Quote
Quote
I found that the user already reported that NeXT Power key doesn't send scan code.
So you don't have to clean up for this anymore.

It is clear that firmware fix is required to check PSW now. I'll do that later.

 I have undertand for the Power key, but i have a problem with the other key too when i press it.

And i have received many new mouse and a joystick, too ;)

Added  PSW pin support and NeXT power keys should work now.
You need to wire as red line in pic to test this function.

285477-0

* adb_usb_rev1.hex (67.43 kB - downloaded 74 times.)

Offline jzw95

  • Posts: 11
  • Location: Edinburgh, Scotland
Re: TMK ADB to USB keyboard converter
« Reply #1193 on: Tue, 26 April 2022, 06:29:39 »
@nevin, thanks very much for the details and help. The problem I have is that I never get the message:

Code: [Select]
*** Caterina device connected
Found port: /dev/cu.usbmodem4101

The Pro Micro sits in the bootloader for 8 seconds, but nothing changes on the screen in QMK Toolbox. This is why I think that somehow dfu-programmer (and QMK Toolbox) aren't 'looking for' or 'seeing' the device.

As a side note, System Profiler differentiates between bootloader and normal mode. When the Pro Micro is in bootloader mode, it shows up as:

Code: [Select]
Pro Micro 5V  :

  Product ID: 0x9205
  Vendor ID: 0x1b4f
  Version: 0.01
  Speed: Up to 12 Mb/s
  Manufacturer: SparkFun Electronics
  Location ID: 0x02100000 / 1
  Current Available (mA): 500
  Current Required (mA): 100
  Extra Operating Current (mA): 0

But when it's running normally (when I plug it in or after the 8 seconds bootloader timeout), it shows up as:

Code: [Select]
SparkFun Pro Micro:

  Product ID: 0x9206
  Vendor ID: 0x1b4f
  Version: 1.00
  Speed: Up to 12 Mb/s
  Manufacturer: SparkFun
  Location ID: 0x02100000 / 1
  Current Available (mA): 500
  Current Required (mA): 500
  Extra Operating Current (mA): 0

Any ideas as to how I can get dfu-programmer or QMK Toolbox to notice when the Pro Micro is in bootloader mode and upload the hex file?

Thanks again!

Offline nevin

  • Posts: 1646
  • Location: US
Re: TMK ADB to USB keyboard converter
« Reply #1194 on: Tue, 26 April 2022, 07:15:57 »
- download & install latest version of qmk toolbox (you will probably have to go into security & privacy settings to allow the installation. i used 0.2.0 not the latest beta)
https://github.com/qmk/qmk_toolbox/releases
- screenshot i previously posed was from an older version. the new dialog looks a little different, but you are looking for the yellow notice, "caterina device connected...... [dev/cu.usbmodem143201]" (it no longer says "found port")
- here's a screenshot of current 0.2.0 version (i'm still running catalina)
285484-0
- are you getting these yellow messages at all when resetting the board?

- and if all else fails, restart. you know how these macs can get temperamental.
« Last Edit: Tue, 26 April 2022, 07:49:30 by nevin »
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline jzw95

  • Posts: 11
  • Location: Edinburgh, Scotland
Re: TMK ADB to USB keyboard converter
« Reply #1195 on: Tue, 26 April 2022, 09:33:00 »
Thanks for the follow-up. I am running the latest version of QMK Toolbox (0.2.0), but I never get any yellow text. In fact, the text never changes from what is displayed upon launching the app, regardless of how many times I resent the Pro Micro:

285496-0

I hadn't thought to restart my Mac, but I've just done that and sadly it didn't change anything.  :(

I'm starting to think I need to run avrdude manually, since it presumably works as that is how the Arduino software uploads code from the IDE. I'd just prefer to use dfu-programmer or QMK Toolbox if possible.

Offline nevin

  • Posts: 1646
  • Location: US
Re: TMK ADB to USB keyboard converter
« Reply #1196 on: Tue, 26 April 2022, 11:27:07 »
have you gone through the full process to setup your build environment? you could be missing a tool.
https://github.com/tmk/tmk_keyboard/wiki#build-on-mac
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline Dandu

  • Posts: 43
Re: TMK ADB to USB keyboard converter
« Reply #1197 on: Tue, 26 April 2022, 13:42:15 »

I got this keypad similar to your Sanwa NT-MAC2ST and confirmed the issue.
https://imgur.com/a/AQqM7Yv

I found that the keypad is 'dumb' and can't reply any command except for reading keys. Fixed firmware for 'dumb' keyboards/mouses like this keypad.
https://github.com/tmk/tmk_keyboard/issues/733

Test your keypads and AlphaSmart with new firmware. I think some of them woluld work.

• The first keypad is working great.
• The second keypad is OK too (the one with a trackball), there is just a weird things :
• The last one is this combo "calculator/keypad" (https://www.journaldulapin.com/2020/01/08/un-pave-numerique-qui-fait-office-de-calculatrice-en-adb/). And it will not work. When i plug the keypad, it turn on (seems OK) and there is timer. And whith the adpeter, after a few second, the timer is freezing. And nothing happen. I suppose the keypad need more energy, but even with battery, i have the same thing.

The AlphaSmart is working great. I can send text from the word processor to my mac. The only weird thing is the Caps Lock key : the key send only "B9FF" on the log.

Quote
Thank you for the correcting. Updated scan code table here.
https://github.com/tmk/tmk_keyboard/wiki/Apple-Desktop-Bus#apple-m0487-jis

I updated firmware for the Japanese keys and they are configured as below for test.

Please confirm the keys register A-F respectively.

JPY(5D)  -  A
RO(5E)  - B
EIS(66) - C
KAN(68) - D
Ent(6A) - E
KP,(5F) - F

I'll update Keymap Editor later so that you can remap the Japanese keys.

I have compared, its seems OK for me, the layout is OK and the scan code too.

Quote
Added  PSW pin support and NeXT power keys should work now.
You need to wire as red line in pic to test this function.

I will try that this week (and my last keypad).


Offline Dandu

  • Posts: 43
Re: TMK ADB to USB keyboard converter
« Reply #1198 on: Tue, 26 April 2022, 14:02:44 »
And with the new firmware, i have a good news.

The infamous trackpad "GlidePoint" is working. There is a weird things on the logs, by the way : the line "M:found: reg3:6C01" is repeating, with incrementation.

I have try too with the optical ADB/Mouse, and the mouse is not working... but i have the same things on the logs.
And i have tried on a "real" Mac : the mouse seems to go to adress 10 (and not 3). Is this normal ? (i join a capture)

And the last one is my new mouse, an Elecom branded mouse, with the same switch than the Elecom trackball. And the same problem : a "fail" in the logs.

I have tried an optical weird ADB mouse (no problem), a mouse with two button (no problem) and a Minolta trackpad (no problem). The two mouses use the same way for the second button : a press to activate, a second press to release. The trackpad sens the same button for the two buttons.


Offline jzw95

  • Posts: 11
  • Location: Edinburgh, Scotland
Re: TMK ADB to USB keyboard converter
« Reply #1199 on: Tue, 26 April 2022, 16:02:40 »
@nevin, yes, I successfully ran all three brew commands and to install the necessary tools. I've just confirmed this as well:

Code: [Select]
1011 ~ » brew tap                                                                                              21:59:17
homebrew/cask
homebrew/core
homebrew/services
josh-/qlscpt
osx-cross/avr
shivammathur/php
1012 ~ » brew info avr-gcc                                                                                     21:59:21
osx-cross/avr/avr-gcc@9: stable 9.3.0, HEAD
GNU compiler collection for AVR 8-bit and 32-bit Microcontrollers
https://www.gnu.org/software/gcc/gcc.html
/opt/homebrew/Cellar/avr-gcc@9/9.3.0_3 (1,749 files, 224.4MB) *
  Built from source on 2022-04-23 at 18:42:18
From: https://github.com/osx-cross/homebrew-avr/blob/HEAD/Formula/avr-gcc@9.rb
==> Dependencies
Build: autoconf ✔, automake ✔
Required: avr-binutils ✔, gmp ✔, isl ✔, libmpc ✔, mpfr ✔
==> Options
--with-ATMega168pbSupport
Add ATMega168pb Support to avr-gcc
--HEAD
Install HEAD version
1013 ~ » brew info dfu-programmer                                                                              21:59:32
dfu-programmer: stable 0.7.2 (bottled), HEAD
Device firmware update based USB programmer for Atmel chips
https://dfu-programmer.sourceforge.io/
/opt/homebrew/Cellar/dfu-programmer/0.7.2 (9 files, 162.3KB) *
  Poured from bottle on 2022-04-23 at 20:03:55
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/dfu-programmer.rb
License: GPL-2.0
==> Dependencies
Required: libusb-compat ✔
==> Options
--HEAD
Install HEAD version
==> Analytics
install: 940 (30 days), 2,870 (90 days), 12,039 (365 days)
install-on-request: 158 (30 days), 471 (90 days), 1,953 (365 days)
build-error: 0 (30 days)

I'm using an M1-based Mac, could this be causing the issue?