Author Topic: Something wonky with KMAC Happy controller?  (Read 3919 times)

0 Members and 1 Guest are viewing this topic.

Offline Photoelectric

  • * Administrator
  • Thread Starter
  • Posts: 6766
Something wonky with KMAC Happy controller?
« on: Thu, 16 February 2017, 14:54:17 »
I could use some advice about a certain KMAC Happy that used to work well, but suddenly now behaves strangely.

Specifically, it seems like something went wrong with the controller?  Not sure what else could have happened. 

Basically when plugged in and using it to type something, it starts auto-typing in all caps, and not any single character but strings of characters repeated over and over.  Pressing various keys sometimes makes it react to those keys and type those letters (sometimes it doesn't), and the pattern of letters being typed can change.  For example something like "ZXCBVNZXCBVNZXCBVN"... ad infinitum.  It only starts typing once I press a key--it does not start out auto-typing after being plugged in.

I thought something went bad in the firmware and have re-flashed it just now, but that did not help at all.

Moreover, once I switch over from the KMAC Happy and swap the USB cable from it to my LZ-GH, my keyboard types in all caps as well and my mouse behaves incorrectly (scroll wheel becomes not functional and things get auto-selected) until I press SHIFT twice.  This pressing Shift thing was just a lucky guess, something I had tried after remembering the days of programming bpiphany's Filco controller and using Shift for programming stuffs, but it has nothing to do with the KMAC Happy firmware, as far as I understand it.  The FLIP programming key for KMAC Happy is Caps Lock. 

I'm not sure what to do next--I've never seen this happen with any custom keyboard PCB yet.

(P.S.: it's just PCB with switches in it now, I took it out of the case to make sure nothing was getting accidentally shorted.  All the soldering still looks neat and shiny.)
« Last Edit: Thu, 16 February 2017, 15:42:25 by Photoelectric »
- Keyboards: LZ-GH (Jailhouse Blues)M65-a, MIRA SE, E8-V1, MOON TKL, CA66
- Keyboard Case Painting Tips -
- Join Mechanical Keyboards photography group on Flickr -

Offline Tactile

  • Posts: 1434
  • Location: Portland, OR
Re: Something wonky with KMAC Happy controller?
« Reply #1 on: Thu, 16 February 2017, 16:19:15 »
When it is typing a string of letters are the letters all from one row or column or all over the place?
REΛLFORCE

Offline metalliqaz

  • * Maker
  • Posts: 4951
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: Something wonky with KMAC Happy controller?
« Reply #2 on: Thu, 16 February 2017, 16:27:14 »
Which firmware are you using?

You've described two issues, but I believe there is only one problem.  Your issue with the KMAC Happy "corrupting" a later keyboard is not a problem.  Basically, the KMAC Happy is pressing shift uncontrollably, and when you disconnect it the PC "remembers" it as pressed, and you have to reset the state of that key with your functional keyboard before everything goes back to normal.  When you fix the first issue, this issue should go away no problem.

I've seen behavior like this before, because of all my work adding firmware support for new, unknown boards.  When I've made a new version of EasyAVR for a board and I get the polarity of the strobe/sense wrong, then I observe basically the same behavior.  The cause is that the pins are essentially floating when the controller tries to read them, so it just gets random results.  Pressing a key can exert enough of a pull by inductive coupling to cause the output to appear to change, but nothing is really hooked up.

It appears that something has caused your KMAC happy's Row 5 to become disconnected from the pin that reads it.  All your crazy keys (and shift) are on that row.  Look at that connection specifically.  It is possible that the controller or row encoder have been damaged, or it could be a bad soldering joint.  Who knows.

Hope this helps, keep us updated!

Offline Photoelectric

  • * Administrator
  • Thread Starter
  • Posts: 6766
Re: Something wonky with KMAC Happy controller?
« Reply #3 on: Thu, 16 February 2017, 16:29:00 »
It's a little strange, but there's what I'm observing.

It always starts out typing ZXCVBNZXCVBNZXCVBN...... etc.

As soon as I press a key that it recognizes, it switches to typing NNNNNNN... continuously.

It does not react to anything in the number row after letter 6.  It does not react to anything in the row below after Y.  Mostly The rows below it also mostly reacts to stuff on the left half only but not everything.

When I say reacts, I mean that it breaks up the flow of N's and inserts the symbol from corresponding key like "E" or "R" then immediately carries on with the "N"s. 

Pressing left winkey makes the auto-typing stop.  But as soon as I press another key, it continues.  The number row up to 6 does not actually type any numbers.
- Keyboards: LZ-GH (Jailhouse Blues)M65-a, MIRA SE, E8-V1, MOON TKL, CA66
- Keyboard Case Painting Tips -
- Join Mechanical Keyboards photography group on Flickr -

Offline Photoelectric

  • * Administrator
  • Thread Starter
  • Posts: 6766
Re: Something wonky with KMAC Happy controller?
« Reply #4 on: Thu, 16 February 2017, 16:33:20 »
Which firmware are you using?

You've described two issues, but I believe there is only one problem.  Your issue with the KMAC Happy "corrupting" a later keyboard is not a problem.  Basically, the KMAC Happy is pressing shift uncontrollably, and when you disconnect it the PC "remembers" it as pressed, and you have to reset the state of that key with your functional keyboard before everything goes back to normal.  When you fix the first issue, this issue should go away no problem.

I've seen behavior like this before, because of all my work adding firmware support for new, unknown boards.  When I've made a new version of EasyAVR for a board and I get the polarity of the strobe/sense wrong, then I observe basically the same behavior.  The cause is that the pins are essentially floating when the controller tries to read them, so it just gets random results.  Pressing a key can exert enough of a pull by inductive coupling to cause the output to appear to change, but nothing is really hooked up.

It appears that something has caused your KMAC happy's Row 5 to become disconnected from the pin that reads it.  All your crazy keys (and shift) are on that row.  Look at that connection specifically.  It is possible that the controller or row encoder have been damaged, or it could be a bad soldering joint.  Who knows.

Hope this helps, keep us updated!

Can't say I understood all of that 100%, but I'll look into it.  I'm using stock KMAC KeyMap.hex from "happy_deploy(20130530)" set of Happy firmware.
https://geekhack.org/index.php?topic=49647.0
 It worked fine before, I just don't know what happened.  But I'll look at the left shift key and will go over the board with a multimeter.

P.S.: just tested the Left Shift with a multimeter, and there's only continuity when I actuate the switch, not otherwise, so at least that's okay.  I'm not sure where to test to see continuity between that row and the controller?  Or something else?
« Last Edit: Thu, 16 February 2017, 16:38:36 by Photoelectric »
- Keyboards: LZ-GH (Jailhouse Blues)M65-a, MIRA SE, E8-V1, MOON TKL, CA66
- Keyboard Case Painting Tips -
- Join Mechanical Keyboards photography group on Flickr -

Offline Photoelectric

  • * Administrator
  • Thread Starter
  • Posts: 6766
Re: Something wonky with KMAC Happy controller?
« Reply #5 on: Thu, 16 February 2017, 16:52:06 »
P.P.S.: there's continuity between actuated Left Shift and the right-side 2nd pin from the top on the "U1" controller (shown with a blue arrow on the photo below)

160690-0
- Keyboards: LZ-GH (Jailhouse Blues)M65-a, MIRA SE, E8-V1, MOON TKL, CA66
- Keyboard Case Painting Tips -
- Join Mechanical Keyboards photography group on Flickr -

Offline metalliqaz

  • * Maker
  • Posts: 4951
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: Something wonky with KMAC Happy controller?
« Reply #6 on: Thu, 16 February 2017, 16:58:37 »
P.P.S.: there's continuity between actuated Left Shift and the right-side 2nd pin from the top on the "U1" controller (shown with a blue arrow on the photo below)

(Attachment Link)

Okay that should be fine.  Is there anything weird with the N or M keys?

Offline Photoelectric

  • * Administrator
  • Thread Starter
  • Posts: 6766
Re: Something wonky with KMAC Happy controller?
« Reply #7 on: Thu, 16 February 2017, 17:10:28 »
No, there's only continuity when either of those is actuated.  N has continuity with the very bottom right-side pin on that controller.  M has continuity with the 2nd from the bottom left-side pin on that narrow controller.

Here's the full PCB from the rear:

160694-0

(Ignore the non-uniform soldering on the left-side Shift--it's a good joint, I've tested it, and it's been like that for a long time).

I'm curious what may have happened that this started happening all of a sudden.  I was really hoping it was corrupted firmware.
« Last Edit: Thu, 16 February 2017, 17:51:15 by Photoelectric »
- Keyboards: LZ-GH (Jailhouse Blues)M65-a, MIRA SE, E8-V1, MOON TKL, CA66
- Keyboard Case Painting Tips -
- Join Mechanical Keyboards photography group on Flickr -

Offline metalliqaz

  • * Maker
  • Posts: 4951
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: Something wonky with KMAC Happy controller?
« Reply #8 on: Thu, 16 February 2017, 18:02:01 »
What is that wire coming through the D111 hole?

You've reflashed the firmware, probably a hardware issue now

Offline Photoelectric

  • * Administrator
  • Thread Starter
  • Posts: 6766
Re: Something wonky with KMAC Happy controller?
« Reply #9 on: Thu, 16 February 2017, 18:02:26 »
Ok, here's more troubleshooting.  I've flashed a hex that I think was not good, after which LED lights were all on but no typing of any sort happened.  I then re-flashed stock firmware, and the repeated typing happened. 

This is what I started seeing as soon as I opened wordpad and put in a cursor:



Everything was appearing automatically, sometimes with break of a second or two before it would keep auto-typing--it wasn't a continuous flow of symbols.  I was lifting the PCB with my hands and turning it slightly, which seemed to have some vague effect on the timing and some of the pattern.  I finally pressed F and you can see where I marked it with a thin red line that after that F the patterns switched to "N"s.  Some of my keypresses actually registered between the "N"s, but most didn't.  Activating Caps Lock actually disabled shift and switched to small letters.

« Last Edit: Thu, 16 February 2017, 18:04:25 by Photoelectric »
- Keyboards: LZ-GH (Jailhouse Blues)M65-a, MIRA SE, E8-V1, MOON TKL, CA66
- Keyboard Case Painting Tips -
- Join Mechanical Keyboards photography group on Flickr -

Offline Photoelectric

  • * Administrator
  • Thread Starter
  • Posts: 6766
Re: Something wonky with KMAC Happy controller?
« Reply #10 on: Thu, 16 February 2017, 18:03:05 »
What is that wire coming through the D111 hole?

You've reflashed the firmware, probably a hardware issue now

It's a (insulated) jumper cable for an LED in MX Lock switch, because it only allows for an off-center LED.  MX Lock has been working fine in that keyboard for some years now.
« Last Edit: Thu, 16 February 2017, 18:08:00 by Photoelectric »
- Keyboards: LZ-GH (Jailhouse Blues)M65-a, MIRA SE, E8-V1, MOON TKL, CA66
- Keyboard Case Painting Tips -
- Join Mechanical Keyboards photography group on Flickr -

Offline metalliqaz

  • * Maker
  • Posts: 4951
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: Something wonky with KMAC Happy controller?
« Reply #11 on: Thu, 16 February 2017, 18:50:01 »
Check all your diodes on that row.

Offline Photoelectric

  • * Administrator
  • Thread Starter
  • Posts: 6766
Re: Something wonky with KMAC Happy controller?
« Reply #12 on: Thu, 16 February 2017, 19:35:41 »
Check all your diodes on that row.

All seem even, measuring voltage drop of 0.592-0.595 across the whole row.  All the switch diodes on this PCB are even, between 0.592 and 0.595.

I've had a PCB with a bad diode where a switch associated with it did not properly register, and that one had a notably higher voltage drop (so replacing that diode fixed everything).
« Last Edit: Thu, 16 February 2017, 19:47:18 by Photoelectric »
- Keyboards: LZ-GH (Jailhouse Blues)M65-a, MIRA SE, E8-V1, MOON TKL, CA66
- Keyboard Case Painting Tips -
- Join Mechanical Keyboards photography group on Flickr -

Offline Photoelectric

  • * Administrator
  • Thread Starter
  • Posts: 6766
Re: Something wonky with KMAC Happy controller?
« Reply #13 on: Sun, 19 February 2017, 22:29:46 »
I've spent more time with a multimeter.  No idea if this is helpful at all and whether it's normal, but I've noticed that all the switches to the right of the yellow line have continuity with the narrow chip (one of the "legs" on it) when actuated, and all the switches to the left of that line don't.  Measuring at the bottom pin of every switch and any leg of the chip.

160957-0

Checked that all the switches are only active when actuated (no stuck switches).

Also checked the USB port.  All 5 of the pins have proper connections.  4 of the 5 have continuity with the main ATMEL controller (all the but top right, facing the bottom of the PCB).

That's the encoder/decoder chip:  http://www.mouser.com/ProductDetail/NXP-Semiconductors/74HC237D653/?qs=P62ublwmbi8EPY%252bXx4R91g%3D%3D
(Nexperia 74HC237D)

Also more test-typing.

Basically it keeps starting out as typing ZXCVBN repeated over and over until I press a key that it recognizes, then it types that key and switches to NNNNNNN.  Pressing caps lock shifts to small letters.  Only most of the left half of the switches are recognized, such as S, D, F, space, tab.  Left half of the number row is recognized but only typing shift-symbols, not the digits (either with Caps Lock on or off).  I can pause the flow of auto-typing by pressing left-side winkey.  So say if press "F" and it types "FN" then I pause.  If I don't pause, it will type "FNNNNN...".  So "N" or "n" (depending on state of caps lock) follows every successfully registered key entry.  Sometimes pressing keys at random reverts to typing ZXCVBNZXCVBN...
« Last Edit: Sun, 19 February 2017, 22:54:44 by Photoelectric »
- Keyboards: LZ-GH (Jailhouse Blues)M65-a, MIRA SE, E8-V1, MOON TKL, CA66
- Keyboard Case Painting Tips -
- Join Mechanical Keyboards photography group on Flickr -

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: Something wonky with KMAC Happy controller?
« Reply #14 on: Fri, 24 February 2017, 13:24:30 »
Anyone actually got the schematic on this thing? Feels like I'm completely in the dark trying to figure this out =P

Offline dorkvader

  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: Something wonky with KMAC Happy controller?
« Reply #15 on: Sat, 02 September 2017, 14:34:27 »
I've been looking into this for photoelectric. The matrix is electrically identical to the physical one, a good part about having 60% layout I think. I traced it out and then found out that the matrix is shown in the KMAC happy layout editor program. Anyway the rows are connected to ground through a 1k pulldown resistor (on the left of the board), and the bottom row was not. There must be a break in the trace that connects the lock switch to the rest of the matrix. This is why pressing a key on that row caused half of it to stay pressed and other oddball problems with the bottom row.

Looking at the macro photo, the trace between the SMD diode and where an in-switch diode would go was cut for some reason. It's possible that this was making enough of a connection before that it worked but after a while it wasn't enough, causing the sudden problem. I didn't desolder the switch to check, but I think that's where the connection point is, so cutting the trace was a bad idea. I'm not sure why it was cut in the first place. Photoelectric received this used and there was some damage to the PCB where a previous owner desoldered it.

Adding a jumper where that trace would normally run has resolved the issue. Also there was something up with the firmware that was on it, so i recreated the layout and flashed the firmware again. So if anyone else is having this issue, then that's what caused it here. Picture below. click for full resolution. The pulldown resistor is r9 in the picture.

P1000498 by dork_vader_exe, on Flickr
« Last Edit: Sat, 02 September 2017, 14:43:40 by dorkvader »