Page 1 of 1

TMK and Arduino Pro Micro question

Posted: 18 Jan 2016, 14:45
by SchraderMJ11
I am building my first keyboard and have run into a snag. I am basing my firmware build off of the GH60 with some changes. It's actually going to be a split keyboard so I'm using an Arduino Pro Micro on the right hand keyboard and a pin extender on the left.

Anyways, I successfully got the prototype working for the right hand keyboard, burned the firmware. Everything worked great so I ordered a laser printed case and started moving over. As I was disassembling the prototype I noticed some of the pads came off of the Arduino. When I put everything back together I soldered on the opposite side of the Arduino I was working with before so I had pads to work with.

I also moved some pins around, not sure if that detail matters since I updated the software and reuploaded the firmware. After plugging in to my computer I see lots of random characters on my screen, mostly consisting of [-;\. I am able to sneak in some other characters, and they work, but those are mostly on the other side of the keyboard. My gut feeling is that I've burned my Arduino and I need to replace it. But wanted to get some feedback before I order and wait longer.

I've gone over my wiring and my software a bunch of times and am pretty sure it's not a problem there. This problem also seems to get worse if I push on the wires soldered into the Arduino which is making me hope this is the problem.

You can see my software here:
https://github.com/matt-schrader/tmk_ke ... rix_hacker

This doesn't include my pin changes as I haven't pushed yet. My columns are now [A2, A1, A0, 15, 14, 16, 10]. And my rows are [5, 6, 7, 8 9].

In the files folder is the pinouts for the Pro Micro.

Any help anyone can provide would be really appreciated. I'm really excited to use this thing.

Posted: 18 Jan 2016, 15:21
by nicstreet
Hi Matt

When you say disassembling the prototype, I assume you are referring to everything? De-soldering switches\diodes etc? I would check all switches \ diodes \ connections, as I had slightly erratic behavior with mine which turned out to be a dodgy diode.

Without seeing the layout it looks like all of those characters could be located on the same physical column? which may help troubleshooting.

In the interim it may be worth ordering a replacement or two as they are cheap enough off Ebay.

Posted: 18 Jan 2016, 17:42
by SchraderMJ11
I do mean de-soldering everything. I did use different switches, but did reuse the diodes. That is an interesting thought though. I'll swap out the diodes and see if that helps. I'm curious how this would make keypresses fire at random times though without the switch being pushed down though. Current couldn't be going through to the column pin at that point right?

By the same token I don't know how burning some of the pinouts would cause this either, so all in all I'm just confused about this problem.

Anyways, thank you for the feed back. I'll give it a shot.

Posted: 18 Jan 2016, 18:03
by nicstreet
Indeed, I concur with with you. However after checking\fixing all my wiring I managed to track my issues down to 4 consecutive keys on a row, bridging the diodes allowed me to diagnose the faulty diode. Re-soldered a new diode in place and presto, all working.

It does differ slightly in that yours appear to be generated without any key presses? Do the random characters stop appearing or is it a constant stream?

Posted: 18 Jan 2016, 18:09
by SchraderMJ11
If I hold the keyboard perfectly still then keypresses do stop. And if I apply pressure to the Arduino then I see keypresses, and it seems to depend which wires I push I get different keys pressed. That's another clue to me that it's the chip. A really weird thing is that I was using the 2 and 3 pins. However I reprogrammed and am not using them anymore because those are the pinouts for the pin expander which I don't have completely wired yet. However, when I push those wires specifically I see \ keys. I think it's a fluke though.

Posted: 18 Jan 2016, 18:45
by nicstreet
Down n dirty, you could remove connection to pins one by one to see if behaviour changes. Given the precarious state of the Arduino this may be best done keyside. Trial and error should allow you to identify offending port(s).

Given it looks like only 12 pins are used if only a couple are damaged then you may be able to use other pins instead.

Posted: 19 Jan 2016, 03:12
by SchraderMJ11
All diodes checked out. I'm swapping my usb cable tomorrow once I get one. I have noticed the power LED on the Arduino going on and off from time to time. Not sure this is the entire problem but I think there is a definite problem there.

Posted: 19 Jan 2016, 03:17
by SchraderMJ11
I have changed my program to only listen to the first row, and the first column. Keys that aren't even close to that are being triggered even though the software isn't watching them. Any ideas about that?

Posted: 19 Jan 2016, 11:28
by nicstreet
mmm, sounds like the chip could be fritzed... I think all other avenues have been exhausted. Perhaps someone else can offer a differing opinion but I think all logical attempts to get this resolved have been attempted.

Posted: 19 Jan 2016, 14:50
by SchraderMJ11
My weakest area in this project is electronics. And I think I'm overly confusing myself over how the pins are setup and the direction of current through the diodes. The rows are setup as output, and the columns are setup as input. But I have the diodes wired to flow from column to row. This did work in my prototype though. Does this work because the column is input with pullup so we are able to pull a small amount of current from it to allow detecting the row?

Thanks again for all your help so far.

Posted: 19 Jan 2016, 14:52
by SchraderMJ11
Here is a photo of my board so far.

Image

Posted: 20 Jan 2016, 02:37
by SchraderMJ11
Really good news! I was zombie coding and there were spots that weren't bit shifting. For example I was doing this:

DDRF &= ~(1<<7 | 1<6 | 1<5);

You wouldn't have seen this issue because it was in code I hadn't pushed yet. Thanks again for your help and sorry I wasted your time!