Author Topic: How to change the Microcontroller in a Aivia Osmium!  (Read 9358 times)

0 Members and 1 Guest are viewing this topic.

Offline cl0rm

  • Thread Starter
  • Posts: 26
How to change the Microcontroller in a Aivia Osmium!
« on: Sun, 04 March 2018, 11:22:04 »
Hello,

Yesterday my beloved Aivia Osmium keyboard (German layout) died out of nothing, after I turned on my computer. I love it, and don't want to use any other board for daily tasks like typing and gaming :). It still looks like new after 5 years but I think the firmware has busted itself (common issue, there is a thread on GH about that issue, Gigabyte does not give us the binary file to flash it with an eeprom flasher). The top 5 Macro keys do still work (including programming in the ugly Aivia Ghost driver), as well as the volume wheel. But the rest of the board doesn't.
Neither keys register, nor the backlight does work.

So I started by disassembling and cleaning it and then looked up all the ICs on the board.
It seems like it has a 4 Port USB Hub IC, which splits the signal into an external USB port, the Macro chip, which still works fine, and the Keyboard controller IC, a Cypress CY764215 with 28 Pins. To this IC there is connected a EEPROM Chip with 8 Pins, which probably once contained the firmware.

My plan is now to restore the keyboard by replacing the IC with a teensy. According to it's Datasheet (http://www.cypress.com/file/134346/download page 8 ), it seems to have 22 IO Pins +2 power Pins + 4 USB Pins. I have messured the supply voltage of the IC, and it seems to be around 3.8 Volts, but I have found points for grabbing of 5 Volts so I could connect a teensy to the internal USB hub instead of the original chip.

But now the question is how to reverse engineer the matrix and LEDs (only for all keys, not individual) and connect it? It's a 64KRO board, and has 1 LED and 1 diode per Chip.
How are 22 Pins (or less, as the LEDs and the LED brightness wheel have to be connected as well, and probably also that EEPROM chip) enough for a full 64KRO matrix?
I tried to do this: https://deskthority.net/workshop-f7/reversing-a-keyboard-matrix-t7.html but my crappy multimeter can only check the resistance (10Ohm and 1kOhm scale)
Both scales seem to spit out garbage, and I cannot think of a matrix with less then 20 Pins for the IC (more than 100 keys, matrix needs to be !ideally! 10x10, or even more).

The mod should look a bit like this one when done: https://geekhack.org/index.php?topic=76517.0

Greetings,
and sorry for my (probably) horrible English,

cl0rm

PS: The keyboard has no corrosion, as it might look like that on the picture. It's a weird residue (similar to glue), which seems common for this board. I will definitely remove it later on, but it is not conductive and has not corroded the solder (yet)
« Last Edit: Sun, 04 March 2018, 11:48:17 by cl0rm »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #1 on: Sun, 04 March 2018, 11:46:29 »
Damn, seems someone else asked about this in that other thread years ago and I missed it :(

Anyway welcome to GH!

You're right 100 keys is 10x10 at best, luckily from a quick read (I don't know this keyboard) it doesn't sound like it's a 'Christmas tree' so I guess all the LEDs are either off or the same brightness?  If so there is probably a transistor attached to one of the pins to control them.  You can do that with the Teensy.

As long as your multimeter shows something different when the probes are touching or not you can use it to map the matrix - when two points are connected it's the same as when the probes touch.  It's a long job, but if you love your board it's worth it (my Ducky is still going strong :) )

Do the LEDs for caps, num and scroll lock still work or are they going on the Teensy too?
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #2 on: Sun, 04 March 2018, 12:04:37 »
No, the inducators don't work anymore, but those are the least problem. I can just remove them or maybe connect them to the the teensy as well.

The board only has blue LEDs, which seemed to be PWM controlled as you could hear a slight humming sound (VERY little, but audible), when they weren't on maximum brightness.

The big problem with the multimeter is how to differentiate between a direct connection or not. When set to the more sensitive mode (1kOHM), there are differences between some connections and other, should I only count those as a direct like which show close to 0 Ohm?
Even a diode/LED will increase the resistance a lot and the meter shows only half of the scale.

Also, where is that LED transistor? could it be the one at the right of the EEPROM, labeled U2?
And do you know which elements those rectangular ones are, labeled as E...?
I once found a table where all these abreviations for circuit boards where written down, but I can't find it anymore

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #3 on: Sun, 04 March 2018, 12:58:30 »
Yes only the direct connections will show 0ohm so only record those for the switch matrix.  One side of the switch will connect to other switches the other to a (hopefully nearby) diode, though I'm not seeing any which is worrying, are they all together somewhere?  That might actually be helpful...

Didn't see the pic before but U2 looks a good candidate fro the transistor - test continuity to the right pin of an LED on the top row as pictured or the top of one of those resistors to confirm.

Apparently E is a terminal - that's a new one to me!
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #4 on: Sun, 04 March 2018, 13:31:23 »
Well the right LED pins seem to be Ground, as they are common between all of them. The left LED pins have pretty much exactly 1 kOHM between eachother.
For the transistor, non of its terminals is connected with 0 Ohm to the left pin of an led. Only one of its lags is somehow (5-10 Ohm) connected with the right side of the leds, but i still cant find a common pin between the left side of them to light all of them up at once.

Every switch has a diode at the right of it, but on the other side of the board, which I cant access because the switches are mounted on a heavy steel plate. (I can see the diodes through a few holes in it) To take a closer look at it I would have to desolder every single switch.

Right now I am trying to messure the keyboard matrix, and having some success with the right leg of the switches, where groups of 3-4 switches are shorted/connected

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #5 on: Sun, 04 March 2018, 14:32:34 »
Sounds like a 500ohm resistor on each LED, which would make a 1kohm between two of them. Can you see the anode and cathode?  That would confirm if the right or left pin is ground.



As you mention 4 key groups does the matrix match Costar?  They make PCBs for lots of makers...

You have a problem if the diodes are on the other side of the board though as you need to solder the Teensy to the other side of the diodes.  I'm guessing your soldering skills aren't up to soldering to the old controller's pins, which would be another option.
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #6 on: Mon, 05 March 2018, 02:28:43 »
Ok, I have analysed the right PINs of the matrix yesterday, and there are definitely more than 4 keys per group. There should be around 15 groups, making around 7 keys per group.

I am not that bad in SMD soldering, I just need to buy smaller wires.
The big issue is how to trace them? The don't seem to be 0 Ohm :(

I will check out the polarity of the LEDs in the afternoon. Which side is usually connected to ground? The negative?

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #7 on: Mon, 05 March 2018, 05:47:31 »
Do the connected keys you've found match the rows in the link?  I like the sound of groups of 7 directly connected...

There is no reason the directly connected pins wouldn't show 0 Ohms to the controller - could be to an IO pin or ground, but definitely connected somewhere. 

For LEDs the anode (small side of the internal bits) should be connected to power, the other side to ground.

The comment on your soldering wasn't meant as an insult, that you'd consider soldering wires to those little SMD pads is impressive.  Yours should land up much cleaner than my spider web :))
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #8 on: Mon, 05 March 2018, 11:57:01 »
I desoldered the controller (And destroyed 2 pads by doing so, because desoldering SMD ICs is **** without a hot air station), and after that I just found out I desoldered the WORKING macro controller... :-[ (I should have guessed that before, because it uses the rom chip to store its profiles). But luckily it works again after soldering it back in, except for the green color of the profile LEDs, but that's not a big deal. So now I know that the actual controller is an even smaller QFN-Packaged Chip by NCS (https://www.nxp.com/docs/en/data-sheet/MC9S08JM16.pdf).

But luckily it has test points all around it, over 20! so I should easily be able to solder to those :)

I also finished reverse engineering the right side of the matrix, and I have it in it's final form (there where still many groups connected, now one group has a maximum of 14 switches).
I still have to figure out the left pins via the test pads, so right now only the rows are corrected, the columns are still messed up.

As for the LEDs: The cathodes (+) are common (0 Ohm)



Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #9 on: Mon, 05 March 2018, 12:28:46 »
Oops!  Impressive work getting it off with only two breakages though and who needs green anyway...  At least that explains why the switches didn't seem to be connected to the controller!

If you're really lucky there will only be 22 test points all connected to the switch matrix, but looks like there are more than that?  Hopefully some are connected to another chip, I can't make it out in the pic.

Good progress, you might need the dodgy firmware I can never remember the name of to work out the other half with the diodes but your rows look quite similar to the Filco Majestouch so probably easier to start with that and correct it.
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #10 on: Mon, 05 March 2018, 16:22:28 »
Ok, I have found out the missing traces of the matrix, and sorted them by two ways. They were some of the T... points next to the controller.
So I should be able to connect the whole matrix to a teensy now. (I will post a table tomorrow)

So now there are only a few connections missing:

- LED connections (very important)
- indicator LEDs (I will directly connect the non-grounded pin to the teensy
- USB connections of the bad chip (should be easy to find with the datasheet, I want to cut the traces and maybe reuse the internal port for the teensy if there are solder pads)
- Brightness wheel (does the teensy with a known firmware like soarer's support brightness control with a hardware wheel? Or only with hotkeys) -Not that important


I also need to order a teensy now, which one should I get? Is there even a choice? should not be too pricey, but should support a good firmware which allows a custom matrix.
The Teensy 2.0 seems to be the most popular one.

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #11 on: Mon, 05 March 2018, 17:14:51 »
The LEDSs should already be connected to the transistor so you just need to connect a PWM pin and power to the right places on it.

Assuming the brightness wheel is a rotary encoder it's not supported in any firmware as far as I know, but in theory you could add it to tmk or qmk.  You would need to find out what part number it is as they don't all send the same signals.

Most importantly you need 22 pins for the matrix, 3 for the indicator LEDs and another for the backlighting LEDs so there really isn't a choice - only the Teensy 2.0++ has enough.  Not as common as the standard 2.0 as few people are brave enough to handwire a matrix that big but it works in all four popular firmwares (Soarers, tmk, qmk and my personal favourite EasyAVR)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #12 on: Tue, 06 March 2018, 13:52:26 »
Now I have completed the pin soldering :)
It was very complicated/difficult to get the cables soldered, and does not look nice at all, but it should work.

I have also found the pins for the LEDs.

One sad thing though, the other microcontroller stopped working (I have probably destroyed a trace when desoldering the Usb port for internal connections), so desided to leave all integrated electronics disabled, including the hub. That leaves me with a usb3.0 passthrough, which is still enough for my needs.

But is it possible to add the extra macro keys to the teensy? they are arranged in a 6x1 matrix (five plus the profile switch), but the 1x side seems to be grounded through some resistors. the resistance to ground seems to be around 100Ohm. I will try to desolder the IC (again, this time finally :D) and see if that changes the resistance (or removes it), but would it be possible still with it?

Edit: The resistance is still there :(

The Teensy is on the way, should be there next week
« Last Edit: Tue, 06 March 2018, 15:40:02 by cl0rm »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #13 on: Tue, 06 March 2018, 15:43:34 »
Probably the macro controller was connected to the main controller so taking that off killed it.

Your wiring looks a little bit crazy having lots of connections near the chip but some on switches (and at least one on a zero Ohm resistor being used as a bridge?) but if that's what it need fair enough!

The good news is there's plenty of space in the matrix for six extra keys - depending which way the diodes go on the main board and the macro keys you can put them in the bottom row or the last column on your spreadsheet where there are lots of UNASSIGNED keys. Will need 7 wires, you can join the 1 side to a switch pin to bypass the resistance to wherever it was going.
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #14 on: Tue, 06 March 2018, 16:04:18 »
How are they getting detected by windows then (or only as a somehow programmable macro key in the firmware itself)? In general i am not sure how to enter the matrix into soarers firmwareconfig, and how to wire it up the controller (polarity is important because there are diodes in the matrix for NKRO).

Also the LEDs: I dont think the transistor can amplify a PWM signal right now as the pin I found is the base of it. Emitter or collector did not work. Is the teensy able to directly connect to the Lighting PIN with a PWM output? Or does it need a LED driver circuit (mosfet?) to not overload itself. So with other words, are the pins of the teensy able to handle enough current for the leds, or only a control signal which helps another chip to deliver enough power

how is the Synatax?
(mux)strobe n KEY
But how to enter the special german / ISO layout keys for example ÖÄÜ or the key right to the l_shift button which only exists in ISO layouts_

PS: I left the original controller in the board, why not, it isn't even getting it's supply voltage so it should not disturb the teensy
PS2: The wires will get much cleaner if cut them down to the right size when having the controller board  :thumb: But not as nice as your ducky. for that I would have to remove the backplate, which would be extremely difficult, so I am already VERY happy that there was a way to avoid this
« Last Edit: Tue, 06 March 2018, 16:33:18 by cl0rm »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #15 on: Tue, 06 March 2018, 16:43:01 »
Oh Soarer's... It's been a while!

From memory you have to put the pins you've soldered the rows and columns to across the top and down the side depending on the diode directions, then keycodes go in the middle.  If you add the pins to your spreadsheet you can copy/paste that bit into a text editor which is handy.  Then by tweaking the strobe high/low it can be made to work.

As to German keys they don't exist - keyboards send scancodes which the OS interprets according to your settings.  In firmware you have to use the US label that's in the same position.  There are two NONUS keys (again - going from memory) which are the key next to enter and left shift.  If you use EasyAVR you get a GUI to do mapping so you can click a key on screen then tap a key on a working keyboard to assign that code.  Though the crazy matrix will make setting it up messy, as would tmk/qmk.

Flashing a Teensy is easy, there is a little program to do it.  It's one of the best things about Teensys over cheaper alternatives.

My Ducky has wires connected from all over the board and there is a lot of hot glue to make it look good.  Half the wires are red on a red PCB so it looks much cleaner than it is :))
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline buckyballs

  • Posts: 62
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #16 on: Wed, 07 March 2018, 06:28:23 »
This looks so amazing, but I'm kind of surprised that someone actually loves an Aivia Osmium enough to want to go through so much work.

At one time I was seeing these guys go for $4 on Ebay ppax. (Bricked keyboards, that is.)

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #17 on: Wed, 07 March 2018, 06:35:55 »
Happily some people know that reuse > recycle > landfill, it's also very rewarding knowing you fixed the board.

Plus at the end of the day you have a fully programmable board for the price of a Teensy - that's not a bad deal (assuming you enjoy tinkering and learning so don't factor in your time...)
« Last Edit: Wed, 07 March 2018, 08:42:57 by suicidal_orange »
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #18 on: Wed, 07 March 2018, 08:15:22 »
Yes, I really love that board... Especially it's included wrist rest and the awesome build quality. Very hard plastic, a steel backplate, a very thick PCB... The build quality is stunning considering that this was marketed as a lower end board. That was when mechanical keyboards for gamers were not nearly as popular as they are now. This thing cannot be twisted or bend in any way, it seems even more rigid than a model M to me. The keycaps of course are not as good as IBMs, but they have only minimal wear after years of really heavy usage (more than 6 hours typing and gaming per day). Only F, J (for touch typing) and the typical gaming keys such as shift, left side of the space bar and WASD are a bit shiny, but only a bit.

The teensy is on it's way, but sadly it will take some time to ship (should arrive in two weeks, the seller seems to be a bit slow)

As for the LEDs, I have messured the current, and all together they use around 150mA at 3.8 to 4 volts which should be too much for a teesy pin.
They have a transistor, but are only connected to the base pin. I would have expected them at the emitter pin. The Transistor does not seem to be grouded, which is weird, and if I connect the voltage to GND of one led and emitter, the controller seems to start up, (all leds including the not connected indicators go on for a short time, then they fade out, just as it was before I have done any modifications), so it can not be directly connected to them. It seems like the voltage regulator is included into the controller.

Does anyone know a simple, small LED driver circuit which can amplify the teensy PWM signal? I would have just taken a transistor, connected the emitter pin to the LEDs, base to the teensy, and collector to the supply voltage (Vusb, should be around 5 V). Would I have to put in a resistor to protect the LEDs from overvoltage?

It would look like the attached pircture:
« Last Edit: Wed, 07 March 2018, 08:51:46 by cl0rm »

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #19 on: Wed, 14 March 2018, 11:33:21 »
OK, today I have recieved the teensy2.0++ :)

Now I need to load the firmware onto it. (And I still need to solve the LED issue, I think I will ask a good friend who studies electrical engineering ;) )
I have already programmed a the matrix into the EasyAVR config file, but  I cannot get it working.
So far I have only connected one row and one column to the board.
The issue with EasyAVR is that the teensy is not getting recognised by the PC, and only has a dim red LED.
With soarers firmware the controller does get detected as a keyboard, but I don't how to program it.

@suicidal_orange have you done more to get it working with the ATmega1286?
Can you please upload the Ducky HEX file, so I can see if that will boot up the teensy correctly?

Ok, I have selected the prebuilt AT90USB1286_16MHz_FULLSIZE.hex file, and with this it seems to boot up fine..

Do I have to install python? Or set the target device to the 1286 somewhere
« Last Edit: Wed, 14 March 2018, 12:05:58 by cl0rm »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #20 on: Wed, 14 March 2018, 12:24:51 »
Once you've picked the AT90USB... as the base that's it, the firmware will work on the Teensy 2.0++

To test you can short any row pin to any column pin using a bit of wire and (assuming you didn't pick a gap in the matrix) it will output a letter.  If that works but pressing the keys doesn't you've got one (or both) of the diode and strobe settings not matching the board.  The words get messy so try any combo until it works :))

One thing that hasn't been mentioned is pin D6 has an LED on it, so it's best to avoid using it for the switches.  That's probably the LED that's glowing dimly as the pin powers up to select a row or column...
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #21 on: Wed, 14 March 2018, 12:33:26 »
But how to select the AT90USB? Is there a config file where I can select it? I did not see it in the Python file... There is only a boolean for the teensy bootloader, which I have set to TRUE.

Yet still my own firmware does not get detected by USB. I have assigned the following PINs:

ROW Pin F0,F1,F2,F3,F4,F5,F6,F7
COL Pin D0,D1,D2,D3,D4,D5,D6 (will change that),D7,E0,E1,C0,C1,C2,C3,C4,C5,C6,C7
LED: B3,B4,B5
Backlight: B6

Other predefined ones don't seem to get detected as well, like the "JD45 (teensy version)"

I do it the following way:
-Building the Hex from menu
-Go into the teensy loader tool and flash it
Do I have to flash more then my single hex file?
« Last Edit: Wed, 14 March 2018, 12:35:58 by cl0rm »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #22 on: Wed, 14 March 2018, 12:36:57 »
It's the first uncommented line in the python file :)
Code: [Select]
import easykeymap.templates.AT90USB1286_16MHz_FULLSIZE as firmware
Most boards use the ATMega32 so they won't work with your jumbo Teensy.
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #23 on: Wed, 14 March 2018, 12:53:46 »
OK, now my computer does not spit out an error message (USB not recognized) anymore, but it still does not work even though I changed the PIN. With the line set correctly, the controller is not detected at all anymore by the PC. Only when in flash mode.

The red LED is still glowing

Edit:

The import line looks like the following now:

import easykeymap.templates.AT90USB1286_16MHz_FULLSIZE as firmware
from easykeymap.ioports import *
from easykeymap.helper import make_matrix_config, make_led_config

« Last Edit: Wed, 14 March 2018, 12:56:15 by cl0rm »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #24 on: Wed, 14 March 2018, 12:55:28 »
Can you attach the config file?  I think I have a 2.0++ in my parts drawer...
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #25 on: Wed, 14 March 2018, 12:59:23 »
Yes, do you mean those?

The hex is my latest build.

It uses the same pins as stated before, except D6, which is now B7.

Thanks you already very very much for helping me to get this working! <3

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #26 on: Wed, 14 March 2018, 13:17:27 »
Hmm... built and flashed it, didn't work.  Now pressing the button doesn't make it register in Teensy loader either...

On the plus side my LED doesn't glow red so hopefully you didn't close the mapper after changing the config?  If you didn't you're still using the old version.

I'm investigating!
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #27 on: Wed, 14 March 2018, 13:43:02 »
OK, tried my Ducky config in the current version and that's now bricked too.  Not good...
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #28 on: Wed, 14 March 2018, 16:43:51 »
Mhh, that's very sad :(

I saved everything, so I definitively flashed the correct/newest file, but luckily for me bootloader mode does still work.

Maybe it's just a weird USB Port, some of my USB3 Ports did that with similar tasks (flashing phones). Because I think the loader connot override the bootloader itself.
I would try it on another computer, maybe linux, as the bootloader is most likely still intact
Or try to push the button while you plug the teensy into the USB. Maybe that will bypass a lockup.

I will definitively try out another firmware, it will just be a very long task to redo the matrix code, as it is most likely another syntax with different firmwares.
« Last Edit: Wed, 14 March 2018, 16:45:54 by cl0rm »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #29 on: Wed, 14 March 2018, 16:59:25 »
I'm in Linux, can't be doing with all the messing with drivers and remembering which USB port each thing should go in using Windows even if I didn't use Linux (which I do)  I'm using a USB2 port on the motherboard so it's as reliable as possible.

Didn't think of trying to plug it in while holding the button but good idea - it's different.  It's not in flashable mode and it's not an EasyAVR keyboard, but it does exist...

I've attached my Ducky config which definitely doesn't break the Teensy as I was using it on my main keyboard and your builds don't kill it so should be safe.  If that works it might help metaliqaz to fix the problem but I understand if you don't want to risk your Teensy.

Edit: Pressed the button having booted with the button pressed - teensy loader recognises it again.  Risk removed, please build the Ducky config and send me a copy so I can reincarnate my board :))
« Last Edit: Wed, 14 March 2018, 17:04:57 by suicidal_orange »
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #30 on: Wed, 14 March 2018, 17:15:08 »
Found the problem - FULSIZE only allows for 6 rows, COSTAR 8.  Both our configs have 8... 

Fixed my config file built and flashed with no problems.  Sorry for the scare, hope you haven't spent too long on another firmware!

To be clear you need to use
Code: [Select]
import easykeymap.templates.AT90USB1286_16MHz_COSTAR as firmware
« Last Edit: Wed, 14 March 2018, 20:06:15 by suicidal_orange »
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #31 on: Thu, 15 March 2018, 11:00:52 »
OK, now the controller gets detected...

I have already connected the row pins, and a few column pins to test, but it does not really work :(

Are strobe_cols and strobe_low the only configuration methods?

Because right now, The board only does something when I set strobe_cols to true, and strobe_low to false, and if I DON'T connect the GND wire for the LEDs.

Then I get random characters / keypresses when i touch the row pins, but not when using the actual switches. Maybe the resistance is to high?

Or are there more settings to try?
Should I maybe connect GND to +5V? But i think that could destroy the teensy, if the pins would get straight 5 volts.
GND and the row pins seem to be connected somehow

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #32 on: Thu, 15 March 2018, 11:14:49 »
Oh good - progress!

GND shouldn't be connected to the switches, if it is they won't work.  Connecting 5v to GND will cause your computer to turn off instantly, at least that's what mine did yesterday.  The teensy survived but not recommended :))

Strobe_cols and strobe_low are the only two options you need, dictated by the direction of the diodes and whether they're attached to the rows or columns.  There shouldn't be any resistance when the switch is pressed as diodes are like one way valves - hardly any resistance the way you want and huge resistance the other way, blocking the signal.  Whichever combination works is the right one, any combination should work when shorting the pins directly but only one when pressing the switches.
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #33 on: Thu, 15 March 2018, 11:36:34 »
OK, I have looked for the diodes, and strobe_cols should be set to true for this keyboard.

Now I somehow need to find the resistor(s) between the LED GND and the row pins, which will be difficult to do.


Edit:

Ok I got it working (without the LED GND pin connected)! Both values needed to be true.

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #34 on: Thu, 15 March 2018, 11:55:05 »
Is the old controller still soldered on?  If it's still attached while powered off it might connect GND and the switches.  I would wait for your electro engineer friend who should be able to say with confidence what to cut and connect for the LEDs, I still think they should be connected to 5v and a pin to control brightness rather than GND...

What about the indicator LEDs, have you got them working?

Also you need to think what to do with your newly programmable board - may as well make full use of it :)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #35 on: Fri, 16 March 2018, 17:13:32 »
Probably yes. :)

I think I really need to desolder the IC. But that will be very difficult without a hot air gun (reflow soldering) because in the middle it seems to have a huge solder pad which acts as a heatsink! My iron at least cant dissolder it. Maybe I should just chop it off with a chisel :D

Problem is if I try to desolder it I might connect those little pins with solder which I can never get of again, and shorting the matrix by doing that.

Edit: Woow, huge improvement, I got it working almost completely! After soldering in the rest of the col pins, almost every key works ("T" doesnt, but thats most likely a typo in the config file as the rest of that row/col works)... Let's hope I can get the LEDs working without desoldering the IC, but right now the keyboard would already be in a usable state, all the work has payed off!

I might have time to do the rest at this weekend, but if it does not want to work, I would already be happy to see it working as a normal keyboard, I love this board because of its shape, not because of the LEDs :D

The order of doing the rest will be the following:
1. Get the Macro keys to work as well (Should be very easy - does the "Costar" build allow 9 rows? That would be the easiest way)
2. Get the backlight working
3. Get the locklights working

2 and 3, but maybe even 1 require to solve the Ground issue

Edit: Tested it, every single key works, except "T" and "V". I will have to look into the matrix, because it seems to have a physical conection
« Last Edit: Fri, 16 March 2018, 18:18:12 by cl0rm »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #36 on: Fri, 16 March 2018, 19:23:57 »
You couldnjust take a sharp knife to the traces surrounding the chip to disconnect it, though doesn't sound like you need to now.

Similar with lock lights - you need to keep the resistor but you can cut the trace back to the controller if it causes issues.

Backlights... Yes, not going there!

8 rows is the limit but as discussed earlier there is space on a row or column (depending on diode orientation which you use) so you just need a second wire going to that pin and 4 jumper wires to the other side of each switch (which you'd still need even if they had their own row)

Good luck finding where T and V should be - only two keys wrong on a full size board is a good effort :thumb:
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #37 on: Sat, 17 March 2018, 05:04:01 »
T and V behave very weird. Physically they are connected to the right matrix pins, so my matrix is correct :( If I short the switch contacts (close the switch), nothing happens, but if I messure the connectivity between both with my multimeter (which of course uses a small current from its battery to do that), the keys get triggered instantly. But the resistance is exactly the same as with the other keys....

Maybe I will just solder a diode and a bridge wire to them to lower the resistance of them.

As for the Macro switches, they don't have diodes right now, can I connect them directly to the matrix? I would connect them to the first row where only the Windows key is right now. So no NKRO needed in that row...

Edit:  now I have desoldered a LOT of small SMD Resistors, with the hope of increasing the resistance to ground. But until now nothing worked. Its still good if the board is cleaner, I think.
But I have bad news regarding those Macro switches. One of their pins is directly soldered to ground. I discovered it by trying to desolder one switch, which was almost impossible because the ground copper transferred the heat to the PCB. Beeing directly connected to GND, it is also impossible to cut a trace as there is no trace. It is connected to the whole copper layer of the PCB. So unless EasyAVR supports single switches, it is not possible to use those switches, because I cannot connect them to the matrix
« Last Edit: Sat, 17 March 2018, 07:55:19 by cl0rm »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #38 on: Sat, 17 March 2018, 08:06:48 »
You could go extreme and cut the whole section of the PCB off, won't be much weight hanging on 6 switches plus their LEDs.  A dremmel would be the usual recommendation, just don't inhale the dust...  To connect them to the matrix you would need some diodes, they cost hardly anything.

I guess T and V only work if you touch the live probe to one side of the switch, so it thinks the current is coming from the other side?  If you get diodes for the macro switches you can use them as jumpers for these dodgy switches too.
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #39 on: Sat, 17 March 2018, 09:24:28 »
Sounds like a good Idea to use a power tool.

Big problem: These macro switches are only mounted on the board, not on the backplate. But I might be able to grind through the GND layer to isolate them..


Edit: GND is on both sides of the PCB. the only thing I could do is to desolder these switches, drill a hole in the pcb where the gounded pin will go, and then mount the switch with the remaining pin and hotglue. That way I could wire the (not anymore) grounded parts myself, and connect them to the matrix

Edit2: Drill mod sucessful! It took A LOT of force to get the switches out with my iron, but now I sucessfully drilled the holes.

Now I only need to get those diodes, and the mod should be complete!

I think I wont touch the LEDs because they are also connected to ground, and by connecting them the matrix would fail to read. This way I will at least have a working keyboard
« Last Edit: Sat, 17 March 2018, 10:41:06 by cl0rm »

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #40 on: Sun, 18 March 2018, 14:14:38 »
After desoldering a bunch of resistors, the LED transistor works! And it is VERY sensitive, backlight works, but when I connect it to the backlight pin, the board will not boot up with a working matrix. If I connect it while the board is plugged in, everything is working fine. When I ground the wire, even for the shortest amount of time, T and V start working :eek: and work until I restart the board. So T and V seem to have some EMI. But I cannot ground the board either, as it needs to be "a bit" grounded only. Now comes the huge question: How much resistance to GND, and how much resistance to the LED Pin.

The LEDs are not very bright, as they are only powered by the matrix strobe signal (like the dim red LED). Its ok, but with a test keycap on I could barely see it at all. Still, this is better than nothing, and more than enough to read the keycap letters when it's dark. And with a brightness that low, it will not overdrive the teensy, as they used about 150 mA when fully bright all together. But this is maybe 15% of the max brightness, and the current seems to be devided into 8 pins.

And now the funny part: Even my hand or my (isolated) multimeter wire WITHOUT ANYTHING ATTACHED (just the wire) is enough to switch the transistor. It seems to be so sensitive, that even the tiny amount of power which the cable is picking up as an antenna, is enough for powering up the transistor.

I guess I have to solder in a huge resistor... Lol. I could not even believe it myself! Free energy!


Edit: There seems to be some very strange interference! after some time of beeing connected to usb, the backlight flashes one time. After that point, T and V work without any flaws. Also, the backlight gets a bit brighter when touching the cable.

It seems like there is an inductor somewhere on the board, which charges and then suddenly discharges, and is sucking out power from the matrix while charging. I have to see if I can find it.

« Last Edit: Sun, 18 March 2018, 15:19:23 by cl0rm »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #41 on: Mon, 19 March 2018, 05:43:38 »
Glad to see you're having fun, sounds a bit crazy so I'm not going to attempt to offer advice but still watching with interest :))
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #42 on: Mon, 19 March 2018, 15:07:08 »
found the inductor, after I removed it, the backlight got MUCH brighter and the full matrix works. For the backlight, I have added a 8.8kOhm resistor. I have already reassembled the keyboard, and it works without any issues (so far).

I will upload pictures, a technical reference (as far as I can remember every step), and the final firmware files (binary and the description file which includes the matrix).

Only one question: Is it possible to activate the backlight at boot up (at a specific brightness)? Right now I have to enable it every time by hand.
And is there a way to get the BOOT key working? Right now it reboots the teensy to a boot mode, but not to the teensy loader mode, so I have to press the teensy button every time. (I have cut a hole in the case for that purpose, but the boot key would still be nice)
« Last Edit: Mon, 19 March 2018, 15:11:16 by cl0rm »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #43 on: Mon, 19 March 2018, 15:54:59 »
There is a section in the python config file for LED modes, it cycles through all the lines in order.  I think the top line is all 0s but you need a 1 first to make the backlight come on by default.  Not sure about brightness but you might need to use the built in config editor (see if there's anything in the readme.  If not assign it to a key and press it while in notepad, it's self explanatory from there)

I think the boot key is for the stock atmel bootloader as found on every PCB rather than the Teensy, whether it can be done would be a question for the creator so head over to the EasyAVR thread :thumb:

Looking forward to the write up too!
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #44 on: Tue, 20 March 2018, 02:46:11 »
Ok, so here are a few pictures of the completed board. I did take pictures from the drilled hole section as well, but somehow they did not save.

Attached is also the EasyAVR firmware and the files to create your own one, if someone wants to try this as well.

Basically, I did the following to get it working:

(1) remove most of the SMD resistors which are NOT 0 Ohm. (Not the capacitors (yellow/brown), otherwise the board wont work correctly)
(2) remove the inductor "X1" (at the other side of the main processor)
(3) soldered wires to the test points called Txx, which points exactly? Look it up in the Excel spreadsheet, note that T23 is on the back side of the board, while the others are on the front where the main IC sits.
(4) solder wires to the columns. Just use the pins from switches out of that row to do that.
(5) to get the Macro switches to work, remove them, and then drill holes into the PCB where the switches were grounded. 3-4mm drill just be fine. Then solder the switches back in, and connect all those pins together, and then to the pin T1 (at least in my matrix). To connect the rows, you can use the existing pads, but just first have to desolder the resitstors and caps at the right side of the switch.
(6) To get the backlight working, you need to remove a resistor at the right of a transistor which sits over the Numpad multiply key. solder a wire to the lower pad (which is closer to the backplate) and connect this to a resistor, for me 8.2kOhm worked well. Then connect this resistor to the teensy pin.
(7) Mod the shell like I did. (As it can be seen it the picture) and connect the red, green, black and white wires to the fat osmium wire we all love (everyone who sees the keyboard the first time instantly complains about that wire):D
 

Note that this mod requires a bit of experience in reverse engineering, good soldering skills as the test pads are tiny and very close together, and a LOT of trial and error. For the step (1) I just removed 3-4 resistors, and after that I connected the teensy again and looked if the matrix was working properly.
« Last Edit: Tue, 20 March 2018, 02:58:39 by cl0rm »

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #45 on: Tue, 20 March 2018, 13:15:32 »
One last question: Is it possible to turn off backlight when the PC goes sleep? The board did that with the original controller, as well as my other mechanical board. I could just turn off standby usb power, but that would disable other useful features like waking the PC up by pressing keyboard keys or charging phones while the PC is turned off.

But thank you so much for all of your support! That project was very interesting, I learned much about keyboards, and electronics in general, and saved a lot of money :)

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #46 on: Wed, 21 March 2018, 03:52:45 »
I think when you turn the computer off power to the USB gets cut briefly, so the keyboard restarts into your default backlight setting.  As (I assume) you've changed that to 'on' it glows...  Have you checked if all the ports have power?  If they're on different controllers they may behave differently, so check all blocks of ports and you might get lucky.

If not this seems like an easy feature request - 'if no USB init complete turn backlighting off' seems a sensible thing to do.  Unless people are using their board as a lamp or to show off artisans...
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #47 on: Wed, 21 March 2018, 12:26:35 »
I think I will make a request about that on GitHub.

My port should be all from the same Chip, as my mainboard has the highend X79 chip in it, which has support for more USB ports than the PC has.

I can only try to use the USB 3.0 port, I have one left at the rear of the computer.

But I don't think the controller restarts, as the light stays on without giving a short flicker, and stays at the same brightness, even if it's less than the boot-up brightness. I think the controller just does not mind if it gets a usb signal at all, I could probably plug it into a phone charger and it would still enable the light. So whenever it gets 5V, it fully boots up, unlike other keyboards which seem to check if there is some sort of "activity" signal on the Data pins. But the keys seem to be still powered on, as waking from standby does work with those, even when the backlight is automatically turned off.

After some research I have found that this "issue" seems to be the standard for EasyAVR and also QMK, but for QMK someone has coded a workaround

Offline codezero

  • Posts: 2
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #48 on: Fri, 03 April 2020, 07:50:08 »
Really impressive work.

I came across the same issue with my Osmium a couple days ago and was looking around for ways to resurrect it and found this thread.
@cl0rm Do you happen to have kept a map of keyboard to teensy connections?


Offline cl0rm

  • Thread Starter
  • Posts: 26
Re: How to change the Microcontroller in a Aivia Osmium!
« Reply #49 on: Fri, 03 April 2020, 08:36:25 »
Hello,

I think this issue is / was rather common with the Aivia Osmium keyboard... Good news is that after the fix the keyboard seems to be more reliable... My teensy mod still works after those two years, typing on it right now.
Yes I do still have all the documentation, the most important for you is probably the keyboard matrix layout, which I attached. (table "final matrix")

I also still have the EasyAVR firmware Image for a teensy 2.0++.