Help converting Zenith Data Systems to USB with Soarer's Converter?

PancakeMSTR

24 Jul 2019, 07:34

Hi,
I'm trying to convert a Zenith data systems to USB using Soarer's converter. Here is a gallery of images showing how I wired up the keyboard to my microcontroller: https://imgur.com/a/7GMw7yj

Steps I've taken:
  • Flashed 'Soarer_at2usb_v1.12_atmega32u4.hex' to my pro micro (probably) clone
.
  • Wired the pro micro to the keyboard according to images posted in gallery.
  • Plugged it into my windows 10 computer: nothing happens except the num lock LED lights up.
  • Tried HID Listen: which gives the following output:

    Code: Select all

    Waiting for device:.......
    Listening:
    wEE
    
    remaining: 0000
    
    
    Keyboard ID: 0000
    Code Set: 1
    Mode: PC/XT
    But I get no output through HID listen (or otherwise) when I press keys.
Help me please? I really want to convert this board :(

User avatar
kokokoy

24 Jul 2019, 13:17

Have a read on this

viewtopic.php?f=2&t=12972&start=90

You might need a pull up resistor with that or have to use hasu’s with a teensy.

User avatar
fohat
Elder Messenger

24 Jul 2019, 14:20

I always use pull-up resistors as a matter of course when wiring up a Teensy, and some keyboards (Leading Edge 2014 is another) there is a 5th connection "reset" that must be wired in.

User avatar
Muirium
µ

24 Jul 2019, 16:08

Koko’s Right. These Zenith XT boards need a frequent reset signal (for reasons no one knows). Soarer’s doesn’t send it. But TMK can, as far as I remember. Check that thread.

PancakeMSTR

24 Jul 2019, 17:54

Here's what I've gathered:
  • I could try Soarer's Converter, with the reset line wired in (white wire? where?) and pull up resistors (1k between data and clock and VCC and ground?), but it seems flaky with this keyboard.
  • Seems that TMK is my best bet, and it looks like someone has already used TMK to make a [Zenith Z-150 converter]. I'm not sure how to modify the keymap or how to build a custom hex file from the work in this repository, and I would really appreciate it if someone could help me out with that, e.g. provide me an overview of the basic steps.

    In the meantime, here's my interpretation:
    • Navigate to xt_usb (tmk_z150-master\tmk_z150-master\converter\xt_usb)
    • Run Make
    • Adjust keymap as desired (What File? Where? How? This is the step I could really use help with).
  • Looks like I still need to wire up the reset pin for TMK, which is presumably the white wire (?). Based on this page on the [TMK xt to USB converter], it appears the reset line needs to go into PB7, which doesn't exist on the pro micro. So I guess I need to use a Teensy 2.0?
Have I missed anything? Does anyone have any comments? All information is appreciated. Thanks for the help!

User avatar
Muirium
µ

24 Jul 2019, 18:38

Play with this:

http://www.tmk-kbd.com/tmk_keyboard/editor/unimap

You can make a hex file with this graphical editor directly. Hasu made TMK much friendlier for most of us when he developed Unimap. Even I can use it now!

PancakeMSTR

24 Jul 2019, 18:52

Muirium wrote:
24 Jul 2019, 18:38
Play with this:

http://www.tmk-kbd.com/tmk_keyboard/editor/unimap

You can make a hex file with this graphical editor directly. Hasu made TMK much friendlier for most of us when he developed Unimap. Even I can use it now!
I will, but I'd nonetheless really like to understand how to modify they keymap from source. I've looked through as much documentation as I can and nothing really tells me how to create your own layout/keymap, just details on what scan codes you can use and what they mean and etc.


I'm just....really confused. I can't seem to get a clear picture of how this all works. I'd love to understand it better.


Like, just to start with a concrete example, how would I modify the source so that when I press the space bar it outputs the letter 'a'?

Slom

24 Jul 2019, 20:14

PancakeMSTR wrote:
24 Jul 2019, 18:52
Muirium wrote:
24 Jul 2019, 18:38
Play with this:

http://www.tmk-kbd.com/tmk_keyboard/editor/unimap

You can make a hex file with this graphical editor directly. Hasu made TMK much friendlier for most of us when he developed Unimap. Even I can use it now!
I will, but I'd nonetheless really like to understand how to modify they keymap from source. I've looked through as much documentation as I can and nothing really tells me how to create your own layout/keymap, just details on what scan codes you can use and what they mean and etc.


I'm just....really confused. I can't seem to get a clear picture of how this all works. I'd love to understand it better.


Like, just to start with a concrete example, how would I modify the source so that when I press the space bar it outputs the letter 'a'?
this is just a guess, but does the following work?

go to tmk_z150/converter/xt_usb/keymap_plain.c
and change SPC into A

PancakeMSTR

24 Jul 2019, 20:42

Slom wrote:
24 Jul 2019, 20:14
Spoiler:
PancakeMSTR wrote:
24 Jul 2019, 18:52
Muirium wrote:
24 Jul 2019, 18:38
Play with this:

http://www.tmk-kbd.com/tmk_keyboard/editor/unimap

You can make a hex file with this graphical editor directly. Hasu made TMK much friendlier for most of us when he developed Unimap. Even I can use it now!
I will, but I'd nonetheless really like to understand how to modify they keymap from source. I've looked through as much documentation as I can and nothing really tells me how to create your own layout/keymap, just details on what scan codes you can use and what they mean and etc.


I'm just....really confused. I can't seem to get a clear picture of how this all works. I'd love to understand it better.


Like, just to start with a concrete example, how would I modify the source so that when I press the space bar it outputs the letter 'a'?
this is just a guess, but does the following work?

go to tmk_z150/converter/xt_usb/keymap_plain.c
and change SPC into A
I'll give it a try once I get everything working. I'm going to do my best to play around with it. There is a lot of code in both TMK and QMK, I wish I could find some more localized and complete documentation on it, something that goes through what's going on from start to finish.

User avatar
Muirium
µ

24 Jul 2019, 21:26

That’s always my feeling when facing open source projects instead of merely demo code: What is all this? Actually, I don’t care. Just show me the bit I want!

Then I just go and do it in Unimap.

User avatar
snacksthecat
✶✶✶✶

24 Jul 2019, 21:32

Muirium wrote:
24 Jul 2019, 18:38
Play with this:

http://www.tmk-kbd.com/tmk_keyboard/editor/unimap

You can make a hex file with this graphical editor directly. Hasu made TMK much friendlier for most of us when he developed Unimap. Even I can use it now!
Yep, the main rub is that TMK is designed to be uber flexible. So you're not really configuring it, you're actually writing the source code yourself. The sample files Hasu provides do a lot to make the code as succinct as possible, but it can definitely still be confusing to the uninitiated. I suppose the purpose of unimap is to make the syntax understandable and bridge that complexity gap. I unfortunately have not taken the time to learn it.

PancakeMSTR

25 Jul 2019, 04:49

Ok,
Made progress, but definitely not at the finish line yet.

First off, I wired up the Zenith to the Teensy. I needed to use a Teensy because this keyboard needs the reset wire connected, which goes at PB7, which the pro micro doesn't have.

After that, I tried a couple things.
repository/TMK fork, and ran Make in 'Z:\Keyboard_Firmware\Zenith\tmk_z150-master\tmk_z150-master\converter\xt_usb'[/list]
  • This produced the hex file 'xt_usb_lufa.hex', which I loaded onto the teensy with the teensy loader.
  • With this firmware, the keyboard outputs utter gibberish. In fact such utter gibberish that it "locks up" or something and makes it so that even my normal keyboard wigs out, like I'll start pressing normal buttons and it will open drop down menus or new windows or select all the text on the screen, stuff like that. No idea why that happens and the only way I can fix it as far as I can tell is restarting the computer. Really annoying.

    Here's an example of HID listen with the TMK firmware loaded (this is me typing 'qwertyuiop'):

    Code: Select all

    Waiting for device:....
    Listening:
    break AA
    make: 10
    break 90
    make: 11
    break 91
    make: 12
    break 92
    make: 13
    break 93
    make: 14
    break 94
    make: 15
    break 95
    make: 16
    break 96
    make: 17
    break 97
    make: 18
    break 98
    make: 19
    break 99
    
    Device disconnected.
    Waiting for new device:...
On a whim, I decided to try QMK. I ran make converter/xt_usb:default, and loaded the produced hex file to the teensy.
  • This ALMOST works perfectly. All the keys act exactly as they should. I even was able to make my own own layout by modifying the keymap.c file (at qmk_firmware\keyboards\converter\xt_usb\keymaps\default), where I successfully made the CTRL key act as caps lock and the left alt key act as CTRL.
  • UNFORTUNATELY, the qmk firmware is unstable. Randomly, keys "lock up," repeating strokes until I've mashed on the keyboard enough to somehow get it to stop (or unplugged it), I think I MIGHT be getting dropped strokes occasionally but it's hard to tell, and invariably, eventually, it does that thing where it completely screws up the keyboard input rendering my computer unusable until I've restarted it (see above).
The way I see it (though I'd like to hear from deskthority on this), there are three options:
  • Easiest, pull-up resistors? Could those be causing the problem?
  • Not so easy, but maybe possible, modify the TMK files that guy worked on for the Zenith to work. It's not at all obvious how to do this, and I could really use some guidance.
  • Probably impossible: Add the TMK implementation of the Zenith to QMK. That is, whatever this guy did to get the Zenith working in TMK, do the same thing in QMK to get it working. I have truly no idea how to do this, although all the stuff he worked on is indicated on his github repo. It would be great if someone more knowledgeable than me could work out how to get that into QMK?

User avatar
kokokoy

25 Jul 2019, 07:55

I might have missed but did you try hasu's xt_usb - https://github.com/tmk/tmk_keyboard/tre ... ter/xt_usb as this one is reported to be working.

PancakeMSTR

25 Jul 2019, 16:14

kokokoy wrote:
25 Jul 2019, 07:55
I might have missed but did you try hasu's xt_usb - https://github.com/tmk/tmk_keyboard/tre ... ter/xt_usb as this one is reported to be working.
No I haven't I'll try that tonight.

PancakeMSTR

26 Jul 2019, 17:19

kokokoy wrote:
25 Jul 2019, 07:55
I might have missed but did you try hasu's xt_usb - https://github.com/tmk/tmk_keyboard/tre ... ter/xt_usb as this one is reported to be working.
Well I tried this, and it seems to be working perfectly. I'm typing this message out on the Zenith. I'll use the keyboard for a bit and update if I encounter any problems, but in the meantime, thank you for pointing me in the right direction!

User avatar
kokokoy

27 Jul 2019, 03:38

No worries and good to hear its working now.

listofoptions

29 Jul 2019, 08:44

ah, so glad to hear you got this working! i was gonna pipe in and say that there's a big ol bug in the form of a debug statement in the middle of an interrupt routine that causes the QMK converter to bug out. if you remove that statement it works just fine. no idea why its there, or why someone thought, geese lets just stop a time sensitive operation to dump to the nearest serial port!

PancakeMSTR

29 Jul 2019, 17:35

listofoptions wrote:
29 Jul 2019, 08:44
ah, so glad to hear you got this working! i was gonna pipe in and say that there's a big ol bug in the form of a debug statement in the middle of an interrupt routine that causes the QMK converter to bug out. if you remove that statement it works just fine. no idea why its there, or why someone thought, geese lets just stop a time sensitive operation to dump to the nearest serial port!
That's interesting. Could point out specifically where in the QMK code that statement is? I'd like to try it out.

listofoptions

29 Jul 2019, 21:03

PancakeMSTR wrote:
29 Jul 2019, 17:35
listofoptions wrote:
29 Jul 2019, 08:44
ah, so glad to hear you got this working! i was gonna pipe in and say that there's a big ol bug in the form of a debug statement in the middle of an interrupt routine that causes the QMK converter to bug out. if you remove that statement it works just fine. no idea why its there, or why someone thought, geese lets just stop a time sensitive operation to dump to the nearest serial port!
That's interesting. Could point out specifically where in the QMK code that statement is? I'd like to try it out.
sure, right here, as far as i can tell this branch is really pointless https://github.com/qmk/qmk_firmware/blo ... upt.c#L141

PancakeMSTR

30 Jul 2019, 16:57

Huh I'll have to play around with that. You mean the else statement with the print right?

listofoptions

30 Jul 2019, 21:35

yes, should be safe to remove that, and recompile. I've also re-written a good portion of that code as well, as the macros IMHO don't allow for a more maintainable code-base, but that's just a personal code-smell kind of thing. let me know if it still doesn't work right, i might have accidentally made the code more performant as well (lots of inlining)

PancakeMSTR

05 Aug 2019, 23:47

listofoptions wrote:
30 Jul 2019, 21:35
yes, should be safe to remove that, and recompile. I've also re-written a good portion of that code as well, as the macros IMHO don't allow for a more maintainable code-base, but that's just a personal code-smell kind of thing. let me know if it still doesn't work right, i might have accidentally made the code more performant as well (lots of inlining)
Did you only work on the code for the xt_usb converter? Or like did you work on "QMK," in a "global" sense?

Haven't had a chance to test this but I'll get back to you when I do still.

listofoptions

06 Aug 2019, 01:24

PancakeMSTR wrote:
05 Aug 2019, 23:47
listofoptions wrote:
30 Jul 2019, 21:35
yes, should be safe to remove that, and recompile. I've also re-written a good portion of that code as well, as the macros IMHO don't allow for a more maintainable code-base, but that's just a personal code-smell kind of thing. let me know if it still doesn't work right, i might have accidentally made the code more performant as well (lots of inlining)
Did you only work on the code for the xt_usb converter? Or like did you work on "QMK," in a "global" sense?

Haven't had a chance to test this but I'll get back to you when I do still.
I only really tweaked the files involved in XT to USB conversion, no reason to touch the other QMK files. the real issue is that converter code is buried so deeply due to the way TMK (the codebase QMK is based on) works; but that's more of a personal code-smell kind of thing, it obviously works.

PancakeMSTR

11 Aug 2019, 07:48

listofoptions wrote:
06 Aug 2019, 01:24
PancakeMSTR wrote:
05 Aug 2019, 23:47
listofoptions wrote:
30 Jul 2019, 21:35
yes, should be safe to remove that, and recompile. I've also re-written a good portion of that code as well, as the macros IMHO don't allow for a more maintainable code-base, but that's just a personal code-smell kind of thing. let me know if it still doesn't work right, i might have accidentally made the code more performant as well (lots of inlining)
Did you only work on the code for the xt_usb converter? Or like did you work on "QMK," in a "global" sense?

Haven't had a chance to test this but I'll get back to you when I do still.
I only really tweaked the files involved in XT to USB conversion, no reason to touch the other QMK files. the real issue is that converter code is buried so deeply due to the way TMK (the codebase QMK is based on) works; but that's more of a personal code-smell kind of thing, it obviously works.
Hey so I gave you change a try and I thought it was working so well that I ported the Zenith over to QMK. And then I tried using the keyboard for a little while, and it exhibited the same nasty symptoms, where it would be working perfectly and then suddenly go completely haywire and destroy all of my input devices until I restarted the computer. Any ideas? I'm happy to be a guinea pig for you.

Post Reply

Return to “Workshop”