Making the Costar CST104 Suck Less

rootwyrm

05 Oct 2016, 23:42

You've seen these boards. You've probably talked trash about them too. Know how I know? Because the CST104 is the original mechanical Das (the non-total-garbage one), the Thermaltake Meka G1, and the Steelseries 7G to name just three. It's actually a lot more than those, but they all have two common attributes.
One, the controller's a separate PCB. Two, they all use the same matrix.

This makes them essentially a readymade PCB for a non-crappy controller. The problem with the CST104 is, simply put, the controller is junk. Sure, it's a serviceable Holtek unit - but every single board using it has some stupid quirk or another. Thermaltake's firmware has bad debounce. Steelseries has glitchy something or other. So on and so forth.

So, we've got a pre-made PCB with plate. We've got (presumably) switches that you're gonna replace because uuuuugh they only came in MX Black and MX Red. We've got a well mapped 8x18 matrix. So, I grabbed one of my (don't ask how many) Teensies, TMK, a lot of ibuprofen, and set to work putting together a prototype I call:
Fuck no I'm not soldering this shit till I'm sure it works.

GitHub fork of TMK for Costar CST104 - no, my workflow for this is not well integrated.
resized_20161005_152320.jpg
resized_20161005_152320.jpg (3.19 MiB) Viewed 3083 times
Fun Fact: masking tape is non-conductive!
resized_20161005_155904.jpg
resized_20161005_155904.jpg (2.74 MiB) Viewed 3083 times
resized_20161005_155848.jpg
resized_20161005_155848.jpg (2.55 MiB) Viewed 3083 times
Last edited by rootwyrm on 06 Oct 2016, 14:39, edited 1 time in total.

rootwyrm

05 Oct 2016, 23:44

RESERVED FOR PINOUT DIAGRAMS (gimme a sec damnit.)
PCB side pinout
PCB side pinout
pcb_pinout.png (11.28 KiB) Viewed 3153 times
Teensy wiring
Teensy wiring
teensy_wiring.png (13.49 KiB) Viewed 3081 times
Last edited by rootwyrm on 06 Oct 2016, 15:24, edited 2 times in total.

rootwyrm

05 Oct 2016, 23:44

RESERVED FOR MATRIX STUFF (gimme a sec damnit.)
key_matrix_colored.png
key_matrix_colored.png (29.62 KiB) Viewed 3080 times
KLE - annotated layout
Last edited by rootwyrm on 06 Oct 2016, 15:55, edited 2 times in total.

rootwyrm

06 Oct 2016, 00:35

Miscellaneous Notes on working with the CST104 PCB

Attention: this is for ANSI layouts, but is convertible to ISO
The CST104 uses a common PCB for both ANSI and ISO layouts. This configuration is my preference - ANSI. ISO requires implementing two additional keys already in the matrix.

WARNING! Bad solder joints!
Invariably you will find at least one bad solder joint on the narrow pitch connector, usually toward the middle. You will need to repair this, especially if you are using a mating connector. The PCB side connector is surface-mount soldered so there is a risk of damage if this is uncorrected.

Quirk: LED wiring
The CST104 is slightly odd in that it uses LEDs with a common cathode (+) and individual anode (-). They're also 3.3V, not 5V. They appear to be fed a constant 3.3V from the Holtek, and pull the anode high.

Quirk: the diode to nowhere.
The RWIN key leads to a diode. This diode appears to go to ground. ¯\_(ツ)_/¯

Annoyance: who doesn't like glue?
Most of the shells have some amount of glue between the two halves, usually at the front near the latches. It's generally pretty weak stuff on the plus side.
Last edited by rootwyrm on 07 Oct 2016, 23:13, edited 2 times in total.

rootwyrm

07 Oct 2016, 20:57

So, a first pass at things has resulted in an interesting failure mode. One that doesn't seem to be explained anywhere else I've found.

TMK builds just fine after a little hammering. However, upon connection, it repeats one key and has one key held. The held key is usually R_CTRL, so you'd think it's a fault in Column 1 wiring. However, the repeating key turns up literally anywhere. I've had P, I've had SLSH, I've had COMM, and I've had M. If you refer to the above diagram, exactly none of those have a column OR row in common.
Because the original controller is 100% intact, it is a (somewhat) trivial matter to reconnect it and verify electrical on the PCB. Either the keyboard works or not. Well, the keyboard works. So it's not an electrical fault. And all of the wires have been verified twice now, so it's not a wiring fault to the Teensy either.

I've also ruled out a bad load on the Teensy and a bad Teensy. So I'm really at a loss as to what's gone horribly wrong here. :/

User avatar
Spaceman1200

08 Oct 2016, 19:16

figures i just scrapped a Das board with a fubar'd controller not long ago. excellent work on your end sir.

rootwyrm

09 Oct 2016, 21:26

Well, that presumes I can get the code working. TMK clearly has some issues that frankly, I am stumped on.

Every single time, even with a cleansheet, it has one stuck key. Every. Single. Time. Then the Teensy crashes. That's with DEBOUNCE at 5.
Turn off debounce, and nothing works at all. No output whatsoever.
Set DEBOUNCE to 2, and RCTL is always stuck on. Swap ROWS and COLUMNS (so 8,18 to 18,8) and same behavior. Should not be the same behavior. In fact, that should be impossible. All I can get out of the debug is:

Code: Select all

Listening:
bounce!: 01
bounce!: 02
bounce!: 02
bounce!: 01
bounce!: 01
bounce!: 02
bounce!: 01
bounce!: 02
...
done.
Keyboard start.
... and so on. So it never actually gets underway. I added some debug, and frustratingly, it seems like it's never making it into matrix_init() properly. I'm at a total loss as to why it's failing to enter there. Magic just doesn't work period.

I've now tried two Teensies, and no change. Moving the jumpers from the Teensy to the original Costar controller, keyboard behaves fine. Meaning the issue has to be in TMK.

Edit: and here's what I get out of matrix_debug enabling, finally...

Code: Select all

r/c ABCDEFGHIJKLMNOPQR
00: 1001011000000000
01: 1001011000000000
02: 1001011000000000
03: 1001011000000000
04: 1001011000000000
05: 1001011000000000
06: 1001011000000000
07: 1001011000000000
08: 1001011000000000
09: 1001011000000000
0A: 1001011000000000
0B: 1001011000000000
0C: 1001011000000000
0D: 1001011000000000
0E: 1001011000000000
0F: 1001011000000000
10: 1001011000000000
11: 1001011000000000
edit: and yes, I know about 1UL.. it's seeing rows hot when they aren't. That's the problem I'm seeing here. Not hitting all rows would behave 'better.'

rootwyrm

12 Nov 2016, 02:53

After quite some time wasted trying to find the heisenbug in the compiler, I finally threw in the towel for the moment on the controller. I'll get back to it when I have a keyboard I'm comfortable on that, as an added bonus, actually works. Something that can't be said for this Rosewill RK9000v2. (Garbage bones beget garbage boards.)

The top cover's already done. The Thermaltake cover is just ugly. So I hit it with Rustoleum's plasti-dip clone in graphite. I'll post pictures later. They go here. Don't let me forget. It came out pretty good.

So today I spent about an hour desoldering. It took about an hour because Costar's work is... highly inconsistent. Some joints were ~5 seconds at 230C, while others on the same switch were 30 seconds at 230C with lots of slop. Which is where the PCB fun then comes in.
The CST104 PCBs are single-sided and VERY flex happy. You don't lift it off the switches, you peel it. All of the diodes reside on the top of course, using through holes. But it'll take another hour just to clean up the poor quality soldering from the factory. And you really do need to clean that up. It's a huge mess.
All of the strength in these boards is from the very thick plate. So if you ruin the PCB? Screw it - hand wire it. I didn't ruin the PCB (though you'll need to be extra careful of pad lift.) So next up is soldering it up, verifying the PCB's in good shape, and then I can go back to flipping through compilers to see why they're generating bad output for the 1286 any time there's more than 16 pins.

User avatar
Wodan
ISO Advocate

12 Nov 2016, 08:42

Inconsistend desoldering times are usually caused by differenced in the thermal mass neas a soldering joint. Pins only connected by a thin PCB trace desolder nice and fast but if they are part of a larger ground plane, desoldering can take forever. This is of course amplified by thick, multi layer pcb. Most of the desoldering I do is Cherry G80s which are flimsy single sided pcb and a pleasure to desolder. For MX Clears, I have a few GMK made keyboard for desoldering and they use thick, double sided pcb and desoldering takes much longer.

I also desolder at much higher temperatures, more like 330C-350C

rootwyrm

12 Nov 2016, 21:59

Wodan wrote: Inconsistend desoldering times are usually caused by differenced in the thermal mass neas a soldering joint. Pins only connected by a thin PCB trace desolder nice and fast but if they are part of a larger ground plane, desoldering can take forever. This is of course amplified by thick, multi layer pcb. Most of the desoldering I do is Cherry G80s which are flimsy single sided pcb and a pleasure to desolder. For MX Clears, I have a few GMK made keyboard for desoldering and they use thick, double sided pcb and desoldering takes much longer.

I also desolder at much higher temperatures, more like 330C-350C
I prefer to keep temperatures low, but no, this is just flat out inconsistency. Frankly, I think there's two different types of solder, given this is the flimsiest of the flimsy single-layer PCBs ever and no thermal mass difference. Seriously, it's even worse than G80's. By a wide margin.
Moves like a sheet of paper. Which is exactly why you want to desolder this one at the lowest temperatures you can. Pad lift or trace scorching is GOING to happen if you run even a bit too hot. There's a reason I call Costar cheap, and it's because they very much are. Especially compared to Ducky, much less group buy PCBs.
Pretty moot for me till Memotronics replaces my ZD-985 though. Yep - vacuum pump just up and croaked. KWALITY!

Also because I'm done with the straight swap so I can go back to the Teensy issues. Note that the narrow pitch connector that Costar used? Is cheap as crap and will be out of spec after probably 5 or 6 insertions. Requiring you to slightly overtorque after applying some percussion to solidify the contact on the X or Y axis.

But so far, I do say this is one sexy board. Especially considering the whole build cost less than $50 with all new switches, caps, and LEDs. Yes, those are narrow angle white LEDs for all three. Much better than the wide-angle blinding reds that Thermaltake used. Also, that's not potato or fuzz.. that's how the graphite plastidip is supposed to look. It has a bit of texture to it.
photo1.jpg
photo1.jpg (2.74 MiB) Viewed 2882 times
photo2.jpg
photo2.jpg (3.05 MiB) Viewed 2882 times
photo0.jpg
photo0.jpg (2.23 MiB) Viewed 2882 times

Post Reply

Return to “Workshop”