PSA: Soarer's "Simple Logic Analyzer" exists and it's awesome

User avatar
snacksthecat
✶✶✶✶

14 Jul 2019, 19:19

Side note before I get into the topic, I just hit 1000 posts!

Image

Now that that's out of the way, this post is about...

Soarer's simple logic analyzer

Many times on this forum I come across troubleshooting threads where many different things are suggested. But I never ever see someone suggest trying out Soarer's simple logic analyzer. I think maybe not many people know of it's existence (?). But it's a great tool for doing some basic diagnostic/analysis work on a keyboard.

Here's a link to the thread:
viewtopic.php?t=4567

What I like about this project is that it takes something that's usually cost prohibitive (a logic analyzer) and makes it accessible to the everyday hobbyist. Granted, it's totally bare bones in terms of functionality. But it's enough to allow someone to take a look into the keyboard's communication characteristics.

Building one is really simple. This isn't an in-depth guide, just an overview to give an idea of what's involved. Most of what follows is going to be a copy paste from a blog post I just made.

For a connector, I used a din-5 breakout board but you could just as easily chop a cable.

Image

You can of course substitute your connector of choice, or no connector at all if you’d like to hook it up directly.

You’ll need to know the pinout if you’re using a connector. You can find the pinouts for many keyboard connectors on kbdbabel.

You’ll be flashing the firmware to an ATMEGA32U4 (e.g. teensy or pro micro). I happened to have a spare teensy sitting around so that is what I’m using.

Image

The next thing to do is soldering the wires to the microcontroller. There are actually two versions of this firmware; Port B and Port D. I went with Port D so that I can easily switch between Soarer’s converter and the analyzer firmware. Check the original post linked above to find out which pins to solder to.

Then of course you connect the two together. Here’s what mine looked like.

Image

Once it’s built, you flash the appropriate firmware (Port B/D) to the device and you’re good to go.

How the firmware works is by reading the keyboard input and then outputting message to the console. You use hid_listen to read these messages. It looks like this.

Image

Then you copy the text from hid_listen and paste it into scla, which is the companion application to the firmware. The application will visualize this input and you’ll get something like this.

Image

And zoomed into a single key press.

Image

User avatar
vvp

15 Jul 2019, 10:10

Well, maybe people do not use it because there are more comfortable alternatives and even cheaper ones (definitely when you want to make it from $20 teensy). But you can go with ProMicro for $4 and a bit of soldering, firmware burning and rather awkward waveform extraction.

Or you can buy $6 Saleae logic analyser 24 MHz version and it will work out of the box and nicely cooperate with pulseview. No need to go through hid_listen. Pulseview gui will allow you to configure the analyser, start/stop capture and investigate waveforms in one package.

User avatar
Scarpia

15 Jul 2019, 11:17

Oooooh shots fired!

User avatar
Muirium
µ

15 Jul 2019, 13:22

I suspect it’s also because most all of us have no idea what to do with a logic analyser. How do you turn those square wave patterns into a keyboard converter?

With lots of knowledge and work. Which we’d rather replace with a single click download kindly supplied by someone else!

User avatar
purdobol

15 Jul 2019, 13:49

Muirium wrote:
15 Jul 2019, 13:22
I suspect it’s also because most all of us have no idea what to do with a logic analyser. How do you turn those square wave patterns into a keyboard converter?
You can extract binary scancodes from it. Data square wave, up is 1 down is 0.
Then convert them to the one supported by current operating systems.

User avatar
snacksthecat
✶✶✶✶

15 Jul 2019, 16:42

purdobol wrote:
15 Jul 2019, 13:49
Muirium wrote:
15 Jul 2019, 13:22
I suspect it’s also because most all of us have no idea what to do with a logic analyser. How do you turn those square wave patterns into a keyboard converter?
You can extract binary scancodes from it. Data square wave, up is 1 down is 0.
Then convert them to the one supported by current operating systems.
It can also be useful for knowing just, for example, "is this keyboard doing anything at all?"

or

"Can I guess the protocol by looking at the output?" (e.g. AT vs XT)

vvp is right, you can get a clone Saleae for cheap on ebay. But this is more of a tool for the impatient tinkerer who doesn't already own a logic analyzer and doesn't want to wait for one to come in the mail. It also does one trick that makes it somewhat novel; it sends the keyboard reset signal on pin B7. This is of course useful if the keyboard requires reset signal.

But yes, other better options exist. I just wanted to shed some light on what I thought was a good option for those who want a quick and dirty solution to keep them moving.

User avatar
TheInverseKey

15 Jul 2019, 17:28

While I think this is decent for some people it doesn't cover a lot.

There is a lot of boards out there that use other terminal protocols and then you have to fall back to a simple logic analyzer.

The other protocols beside AT/XT is where the community needs help and there is not enough people/time to invest into reverse engineering all the protocols.

EDIT:

Also a lot of terminal boards are weird how they sync with the terminal that they were built for.

User avatar
JP!

15 Jul 2019, 18:28

TheInverseKey wrote:
15 Jul 2019, 17:28
EDIT:

Also a lot of terminal boards are weird how they sync with the terminal that they were built for.
And that's when either documentation or a working terminal comes in handy otherwise you need someone with expertise in reverse engineering.

Post Reply

Return to “Workshop”