Author Topic: Converting my Wang!  (Read 1551 times)

0 Members and 1 Guest are viewing this topic.

Offline Firebolt1914

  • POM Overlord
  • Thread Starter
  • Posts: 703
Converting my Wang!
« on: Wed, 16 December 2015, 16:05:46 »
I posted this to deskthority with the goal of getting as much help as possible to convert this Wang hall effect keyboard.

I will take more pictures and post them here. Since I am on mobile I will simply just post the DT post I made.

http://deskthority.net/workshop-f7/converting-my-wang-t12379.html

Offline FLFisherman

  • * Elevated Elder
  • Posts: 2243
  • Location: FL
  • I'd rather be fishing.
Re: Converting my Wang!
« Reply #1 on: Wed, 16 December 2015, 16:08:56 »
Can't wait to get some good pictures of your Wang.






What is it?

Offline XMIT

  • formerly jsoltren
  • Posts: 421
  • Location: Austin, TX area
Re: Converting my Wang!
« Reply #2 on: Mon, 21 December 2015, 07:56:26 »
I've been helping Firebolt1914 with this as I too have my own Wang Hall effect keyboard.

Offline PunksDead

  • hspernks
  • Posts: 783
  • Location: USA
  • keyboard poser
Re: Converting my Wang!
« Reply #3 on: Mon, 21 December 2015, 08:22:53 »


TRIGGERED!
don't come to my funeral, there wont be one

Offline XMIT

  • formerly jsoltren
  • Posts: 421
  • Location: Austin, TX area
Re: Converting my Wang!
« Reply #4 on: Wed, 20 January 2016, 21:19:35 »
tl;dr: I recommend to implement a replacement controller to achieve NKRO. My plan is to remove the 74148 encoders, and strobe the matrix directly.

Today, I had a chance to have a good look at the high quality photos I took of the PCB. I mapped the matrix of the PCB to pins on the 74148 encoders on the top edge of the PCB. I edited the photos to make it easy to flip between the back and the front of the board. I also mirrored the back of the board to make it easier to trace. See photos below - high resolution!

125124-0
125126-1

In total, there are 25 "rows" that need to be strobed. This is few enough pins that a Teensy 2.0 could cover the matrix. A Pro Micro, however, does *not* have enough pins and would need a multiplexer of some sort.

Why not just use one of the 74148s as a multiplexer? Simple: they are priority encoders, meaning that switches can block other switches.

This is where I could use some help from a controller firmware writer like hasu, HaaTa, etc. Not that I can't figure this out myself but it would go a lot faster with help. Anyway: we're going to need a different kind of strobing here. Let me try to explain below.

With a normal keyboard matrix, we have rows and columns. We send a pulse out on a row, and try to sense it on a column. Switches, being conductive, allow the pulse to physically (electrically) pass through the switch.

This is not how the Hall sensor works.

The Hall sensor has two (identical) outputs which are typically held high. When a key is pressed, the output spikes low. It takes 50ms to drop to low, and 50ms to rise back to high. (Note that, at the hardware level, there is absolutely no way to see how long a key is held. A key press generates a press and release event.)

So, instead, the Hall matrix strobe loop needs to look something like this:

Code: [Select]
for every row i:
  for every column j:
    check to see if row i is low
    check to see if column j is low
    if row i is low and row j is low:
      // Key [i,j] is pressed.
      emit key press event for key at location [i,j]
      remember that the key at location [i,j] is pressed
    else:
      // Key [i,j] is released
      if we note that key [i,j] was just pressed
        emit key release event for key at location [i,j]

This is where I grumble about never having learned the Arduino API. The only microcontroller I've programmed was the 8051 and that was ages ago. It will take some time to get a strobe going.

The good news is that these switches are bounce free. The total time the switch is in the low state is about 100ms. We should be able to scan the matrix at about 100 Hz (10x faster than the switching time) to 1000 Hz (100x faster). Keys will always appear to be pressed for about 50ms regardless of how quickly we scan. There is no way to make this shorter; it is a limitation of the Hall sensor mechanism.

An interesting point: the Shift keys (R7 and R10 in my diagram) have their own dedicated wires on the keyboard's cable. They do not require external pull up resistors since there are some on the board.

So, who wants to help me write a simple sensor loop? I might wire up a 4x4 matrix using a Pro Micro just to test this idea.

Who got the other Wang board that Engicoder posted?