## Friday, November 9, 2018

### Datalux Keyboard Teardown

Ok. This was an impulse buy. But when it arrived it was missing two keycaps, so I got a refund. That means I'm off the hook from the impulse buy right?

Anyways I saw this pretty thing on ebay: the Datalux MURUC
It was so clean, and look at that funky shape!!! This one was 85 bucks, but I wasn't going to shoot for anything above \$15. Anyways, it is widely considered a bad, mushy mechanical keyboard. But like I said, impulse.
So here is the one that I got, and then was refunded for.

As you can see, mine was not as beautiful. It came with a bunch of missing keys. It also smelled like veritable trash heap (as opposed to stack). So.. I decided that it was not worth it to fix up; so I tore down. Here are my electromechanical archaeological findings:

The keyboard uses these surface mount MEI white linear switches. I have never heard of this brand! They are pretty smooth, but also very stiff (maybe like 70 to 80 grams). Also only expect key travel of 3 millimeters or so.
The single sided PCB appears, next to the space bar, to have a date code of 30th week of 1990, which I believe. Another interesting thing, is that I only see ghosting rollover diodes near the space bar and nowhere else. I don't have a picture of the traces and the soldermask on the bottom so you will have to believe me. Also notice the oscillator is Earth-grounded. Look at that linear resistor package too!
Additionally, the main integrated circuit is a Signetics  jobby with date 1980. I could not find any specific information on this part number, but I did find an interesting microprocessor data manual from 1983. I can't seem to find any chips with the MC designation, as most have the SC label.
I am in the process of cleaning the remaining keycaps in case I need them for a project.

### Flashing SimonK firmware on a Red Brick 200A ESCs

So I got this ESC here. They are, as most Chinese ESCs are, suspiciously priced. I do not recommend them for the lack of testing I have done. Ive been designing a linear actuator for a thrust vector control system and needed to make a mockup with some cheap parts. This ESC was particularly intriguing as it has an Atmega8 processor, meaning that I can reflash it with SimonK firmware, and also modify that firmware so that I can run the motor in both directions (tends to be important for linear actuators....). Most of this process I learned from this video by Robert Cowan (a cool dude, check his work out), but I had numerous more issues that were not covered in his video; so here I document that for you.

Note that the MOSFETs used for switching are all paralleled. If you used transistors from the same silicon batch, they should share the current normally. After all, most single package semiconductors like this are just a bunch of small devices in parallel on the substrate. However, in this case, they have decided to use a bunch of different transistors, and I wouldn't be surprised if this led to a failure later on under higher load conditions. Maybe they got a deal on a rando box o FETs. Also youre not seeing that the heatsink was held in place by heat shrink. So once you remove the covering... it just falls off.

Sigh. I should just fab some of these...

This reprogramming process only works for certain ESCs with ATMEGA8 chipsets. So keep this in mind if you are going to do this yourself. This list here includes a lot of the different ESCs that are supported, as well as their flavour of firmware binaries.

First you are going to need a USBASP dongle so that you flash the chip. This is basically a bad version of an atmel ICE or similar programmer. They're super cheap so sometimes they arrive in odd nonfunctioning states. The things we deal with. It might be worth it to pick up a couple.

Then you will need to open up the ESC and find the appropriate programming pins, and wire up a harness for programming.

This figure is taken directly from the data sheet for the atmega8 chip. You need Vcc, GND, MOSI, MISO, SCK, and RST(pin 29) to connect ot the programmer. Your ESC may have these conveniently laid out. Mine sort of did? Whoever designed this board ported them out to pads of 0402 size, and then had nothing populated on them. My best guess is that they had some special programming pogo-contact tool that allowed the factory (in god knows where shenzhen) for quick programming

I have also listed the pinout of the connector on the USBASP above on the engineering paper. Note that the box I drew denotes looking into the gated connector (so you should be seeing male pins). I cut up some female header jumper wires and soldered them to the programming "pads." Note that VCC was much easier to tag onto the linear regulator. I think I also omitted RST in this picture, but added it on later.

Youll need to get the USPASP driver running, so head off to zadig, download the software and run it. This basically finds drivers needed for whatever peripherals it senses on the USB bus (i know...). So plug in the dongle and do that.

The head over to lazyzero and get the kkmulticopter flash tool. You will actually want both version 0.77 and 0.8. The latter will be run for programming your chip, but won't work without a file from the former. Make sure that you have downloaded the proper java run time environment. This proved to be very difficult. I recommend downloading the whole offline file and running it.

Otherwise you might get this error:
No JVM could be found on your system.
Please define EXE4J_JAVA_HOME
Even now, if you run the 64bit distribution of kkmulticopter it probably won't work. In my case, running this produced an error file that said it didn't have some of the required files. I went over to my 0.77 version folder and brought kkMulticopterFlashTool.properties over.. and it seemed to work.

Oh yeah you might also need to add the file path of Java RTE to your environmental variables, as well as EXE4J_JAVA_HOME as a variable name, with its path as its descriptor. (I am on windows 10 by the way).

Now it should finally run and stop giving you errors? Hopefully?

Open the tool, go to the simonk firmware section, hit download and pick your binary. In this case I am using birdie70A. I changed the lines 188 to high, and 189 to low so that I can run the motor in both directions.
Just kidding I have this error. I am still working on a fix for this. Some places say this is caused by the clock frequency being too high and having a "slow SCK" issue. Some people say that this is bogus and it has flashed correctly anyways... I'm going to keep working this one out.

Almost there!!!

## Saturday, November 3, 2018

### New Keymap for IBM4704 6113442 Pingmaster

So here I am again procrastinating on my orbital dynamics by working on firmware for antiquited technology.

Here is, imho the best keymap for this keyboard. I have extended the right keys. This means that the backspace now takes up the right most three units, the enter is two keys, and shift is two keys. The Hasu map had some weird function keys there that would get very annoying when you pressed the wrong button.

Go into the keymap_alps102key.c file and use this:

KEYMAP_ALPS102(
ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,BSPC,BSPC,     PSCR,SLCK,PAUS,    F1,  F2,  F3,  F4,  \
TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSLS,     BSLS,       INS, HOME,PGUP,      F5,  F6,  F7,  F8,  \
CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,GRV, ENT,      ENT,     DEL, END, PGDN,       F9,  F10, F11, F12, \
LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT,RSFT,    RSFT,     NO,  UP,  NO,              F13, F14, F15, F16, \
LCTL, LGUI,LALT,          SPC,                     RALT,RGUI,               FN0,               LEFT,DOWN,RGHT,    F17, F18, F19, F20  \
),

Now obviously do as you wish, but I like this setup the most. I might change the function keys on the right later. I really don't use function keys much.

I then edited the Makefile.unimap.alps.rev1 file by deleting the unimap line. We want everything else because we still want the 32u4 etc.

Then remake with make -f Makefile.unimap.alps.rev1 KEYMAP=alps102key
Then ground the RST pin and reflash as per my last entry, and there you go.