Universal Model M Controller

User avatar
phosphorglow

21 Mar 2016, 23:30

Oh!!! Yeah!

One big epiphany I had was about the whole 3.3V/5V 8MHz thing that had me stumped when I was still working on the first version, even past the point of me making the little subboard.

Turns out the PJRC stack had a PLL setting that needed changed for the 1286 at 8MHz in the usb header file:

Code: Select all

// #define PLL_CONFIG() (PLLCSR = 0x16)
#define PLL_CONFIG() (PLLCSR = 0x0E)
So, using an 8MHz crystal at 3.3V totally works. I would prefer the LUFA stack since that has BIOS support, but I'm still a novice with only about a year of looking at C code. :D

User avatar
phosphorglow

21 Mar 2016, 23:40

Here's how it's shaping up at the moment. Still have plenty of tweaking to do, but it's getting there.

I'm debating on having the option to put a battery connector on either side of the board. One could get creative in an SSK with a larger battery on the right side, but it's tricky. As it stands, the 1200mah battery is the perfect fit.

Stock LEDs are a little easier to deal with now, instead of three configs to choose from in the firmware. Now they're all the same. Extra provisions for layer indicator LEDs. And, in the future, another sub-board could be manufactured to attach to the main board with a USB-C connector... But that's an added level of complication to add to my current plate of goings-on. Later later later.
6.png
6.png (114.7 KiB) Viewed 9168 times
I'm still using Fritzing. Not Eagle, or KiCAD. I'd love to learn those, but Fritzing is pretty easy. Someone coming from Eagle or a more advanced PCB design program will probably consider it to be the KidPix equivalent of PhotoShop. It's a very WYSIWYG program... Like, if Apple made a PCB design program, it would be similar to this. If only it had snappable traces like Eagle... making sure all of the traces are nice and parallel and have good angles all takes place manually, which is frustrating for a perfectionist... :(

Otherwise, it's way awesome. Ok, done rambling for now. Phosphor out.

User avatar
phosphorglow

25 Mar 2016, 03:01

So, uh, fun update:

I got the Bluefuit module working with the LUFA stack instead of PJRC. All thanks to hasu's HHKB code which was an excellent reference, despite having no real actual clue as to what I'm doing.

Why so exciting? The PJRC stack doesn't seem to have working BIOS support. Plus, well... LUFA.

UnFocused

26 Apr 2016, 02:37

I've got one of these wonderful controllers in one of my Model M's and have successfully built a .hex file (using Linux) from the TMK source Phosphor Glow has on his website. I'm trying to turn the caps lock key into another control key to start.

I can't figure out how to get the controller into DFU bootloader mode (there's no button on mine). PG's site says to press left-shift, right-control and pause. I've done that both with the keyboard already plugged in (didn't think that would work) and held those keys down while I'm plugging the USB cable in. Neither of those seem to work and the keyboard works as it should.

Using (with or without sudo):

sudo dfu-programmer at90usb1286 get bootloader-version

...returns "dfu-programmer: no device present."

I'm sure there's something I'm missing here. Would someone please kindly enlighten me?

User avatar
phosphorglow

28 Apr 2016, 11:14

Hrmm! Did you get the controller from me recently...? Or someone else?

Anyhoo - if it was recent, I've changed a few things but haven't updated the page quite yet!

With the keyboard plugged in, hold Caps Lock, right shift, and pause.

(I've disabled bootmagic commands by default, but added in a custom function to still jump to the bootloader using a combination unlikely to be used on accident. :P)

UnFocused

28 Apr 2016, 15:10

phosphorglow wrote: Hrmm! Did you get the controller from me recently...? Or someone else?

Anyhoo - if it was recent, I've changed a few things but haven't updated the page quite yet!

With the keyboard plugged in, hold Caps Lock, right shift, and pause.
I received it directly from you about two or three weeks ago. Early April to be sure.

That key combo worked perfectly and dfu-programmer was able to see the keyboard!

I'll wait until you update the TMK source on your website before I go flashing anything to the keyboard.

I have a keyboard with you now for your overhaul service + controller. I'm guessing it's going to get the new version of the controller? I understand it's going to be a few weeks before you get them in and I'm happy to wait.

User avatar
phosphorglow

02 Jul 2016, 20:10

While I'm here on the forum...

Image_MG_6483 by phosphorglow, on Flickr

*Still* testing and working on it. In the background are a few 3D printed port covers... Still working on those too. Everything has been taking me much longer to finish up than I had planned/anticipated. Go figure.

About 24 hours of battery life. I'm not nearly happy enough with the Bluetooth side of things to call that part finished, but it does work. USB still works just peachy. On the right hand side of the PCB you can see the additional mounting option for later model 122's. Drops right in. Haven't done it yet, but the idea of a Bluetooth 122 amuses me greatly...

It's running a modified version of hasu's Bluetooth HHKB code, but with no power saving implemented yet.

I said from the beginning of this project that I was going to release the schematics/design files for it. I still will. Just not yet. Not until I'm completely happy with it, and not until I'm comfortable using kicad or diptrace. Trying to explain how I finagle things in Fritzing sounds like a daunting task.

Also... I really can't wait to build a reflow oven. Soldering everything by hand is... time consuming. I enjoy it, but there aren't enough hours in the day.

Blah blah blah. Ramble ramble. //phosphor out.

grasshopper

19 Aug 2016, 20:14

Hi phosphorglow,

As you appear to be back, can you answer a couple of questions that I asked earlier in the thread:

I notice that you offer the circuit boards for sale on their own. I'm interested in that option but I don't want the hassle of ordering all the other components separately. So would you also consider offering a kit that includes all the parts needed to make a working controller, and it would then be the purchaser's reponsibility to solder all the parts together.

Are you ever likely to offer similar controller boards for newer Model Ms (and the ones currently manufactured by Unicomp) where the circuit board is mounted behind the caps and num lock lights?

Thanks

User avatar
phosphorglow

24 Aug 2016, 22:00

Well, "back" is a stretch, as I have too many frying pans and barely any fire this year, but hey...

Anyhoo -

I *did* offer the bare boards previously. I'm probably done doing that. Putting together kits is another thing I don't really have time for.

Eventually if I get bored and have time, I'd consider doing the newer style controller. But, again, too many frying pans at the moment...

I'm about halfway through migrating the design into KiCAD. Once that's finished and I'm happy with the end result, I'll put all the files up (including the 3D designs for the various port covers) and whoever wants to run their own batch of boards can do so.

grasshopper

28 Aug 2016, 01:17

phosphorglow wrote:
I *did* offer the bare boards previously. I'm probably done doing that. Putting together kits is another thing I don't really have time for.
That's a shame. Are you still selling the fully assembled boards?

User avatar
phosphorglow

28 Aug 2016, 01:53

Awww... now I feel bad. Well... perhaps I might do that again just for the bare PCB, but a "kit" is, well... Actually, it's not that huge of a deal. I could just put up a shared Mouser order sheet and people could place their own separate order. Anyways, I'll toy with that a little more at some point.

And yes, I do still sell the fully assembled boards, but not at the moment. My first batch of PCBs for V2 has been diminished, but I'm almost done with my tweaks to order a larger batch.

Side note:
I freakin' love KiCad. It was (and still is) a huge learning curve, but I'm loving it.

Side-side-note:
USB-C port is now part of the design.

User avatar
phosphorglow

28 Aug 2016, 03:10

Colossus Universal Model M Controller Version 2
===============================================

Current operation/details are as such:

Fits all Model M's (with the exception of the later -and current- style mounted underneath the LED cluster). You can even use it in combination with the M13's stock controller to retain use of the TrackPoint.

Has provisions for all of the standard LED connector locations, and extra expandability for custom LEDs. Drops right in to the later style 122's with the cable/port cutout in the middle of the case, and the early 122's using a 3D printed bracket. Sub-boards are part of the design to allow for port options aside from USB-B (even though that's still my favorite) including Mini, Micro, and USB-C. And if one were so inclined, they could solder a non-detachable cable.

Bluetooth:

Borrowed heavily from hasu's BT-HHKB, with a slightly different hardware approach.

Slide the switch on, and Bluetooth connects automatically to the last paired device in about 3 seconds. While in use, you can plug it in and continue using while the battery charges. Slide the switch off and you can use it as a USB keyboard while the battery charges, or plug it into a wall adapter for a slightly faster charge rate. During fast charge you can press a key combination to enable Bluetooth. LED indicators near the port cover indicate when the battery is getting low (red), when the battery is fully charged (green), and the current status of Bluetooth connectivity (blue). These indicators can also be expanded to a more visible location.

The Bluetooth module is the RN-42, but the UART pins are available so you could technically use other modules if you modify the firmware.

At the moment (using a 1200mAh battery) I get ~30 hours of use when left on, but that's low because I haven't figured out the power saving code yet. With just the MCU running, it draws 9mA. With Bluetooth on and connected, the total draw is 40mA. So, once the power saving gets implemented I'm expecting closer to 100 hours before needing charged.

I'll figure it out through trial and error eventually, but I would love some pointers in how to implement the matrix_last_modified timer to switch off the MOSFET controlling the RN-42 and turn it back on when a key gets pressed, as well as modifying the scan rate to lower power consumption. The code base is already there, I just need to adapt it.

I've attempted to make the layout friendly to hand solder all of the components, or for reflow.

The basic design is super simple. The only complex part is packaging it to suit various iterations of M's on a single board, with various choices being up to the user, and I feel I've just about accomplished that. Porting the base design to other (matrix based) keyboards would be a definite option.

The time is coming for me to release the whole shebang into the wild and let the community build on what I think has grown into a pretty neat board.


A few sub-notes...
There are two main features I want to implement:
- A soft power switch instead of the slide switch. I want a single push button to turn the entire board on/off, which would also enable the MCU to control the main power. (Probably in Version 3... :P)
- Pressing a key combination to blink the battery charge status. Example: a series of fast green blinks to indicate, say, 90%, slower and less blinks for less than 80%, and maybe switch to blinking the red LED for under 50%. Or something to that effect.

User avatar
lot_lizard

29 Aug 2016, 01:47

You EE studs (to which you are the "Fonz") never cease to amaze.

You really have done such fantastic work here... It is above 80% of the average DT visitor's head, but it really is incredible what you are building into this design. This is the most "complete" functionality on paper (haven't tried yet myself) of any custom controller we have to-date. Couldn't be more impressed. Count me in for one (err... multiple)!!! Again... well done... super impressed it is ready, and glad you never felt the need to "jump the shark"
jump-the-shark.jpg
jump-the-shark.jpg (51.86 KiB) Viewed 10021 times

User avatar
phosphorglow

03 Sep 2016, 10:45

Thanks! ^_^

Now I can't stop staring at The Fonz. He looks so damn happy and so cool.

User avatar
phosphorglow

03 Sep 2016, 10:50

USB-C Sub-boards came in from OSHPark.

I think I have a new favorite USB connector. :X
2016-09-03 00.11.08.jpg
2016-09-03 00.11.08.jpg (46.71 KiB) Viewed 9929 times
Additional update:

I stumbled over hooks in TMK and managed to cobble together some code to tell the Bluetooth module to disconnect 5 minutes after the last keypress, and reconnect when a key gets pressed. Might not be the best implementation, but I'm now getting about 40 hours of being left on continuously. I'm happier, but still not entirely happy.

luke2016

06 Oct 2016, 03:46

A few comments with no intention of being critical of the great work being attempted.

A controller I would like to buy is like what Wulax did -- bluetooth controller with battery lasting for a month or so. There are a few problems currently
  1. He sold out his stock, and is no longer making more :(
  • They were made 5 years ago, and likely not supporting the later Bluetooth standards
  • The form factor doesn't fit some of the Model M keyboards as Phosphorglow found out
  • ...
The controller was based on BCM2042/BCM20422 chip. Unfortunately, the breakout board is very much unavailable now. An updated design would be replacing the BCM20422 with something like BCM20730, plus changes to the circuit board to accommodate various Model M's.

It seems that you have gone quite a way down the path of RN-42, with the intent of a hybrid board (USB and Bluetooth). I can see a hybrid board is more versatile, and can attract a broader (though still very limited) user base. If the battery life issue can't be solved, a BCM20730 based, Bluetooth only approach might be worth pondering. It can even be argued that a Bluetooth only board might be the way to go, since most newer devices are Bluetooth enabled, and a dangle is only a few bucks for the rest.

Nitephyre

12 Dec 2016, 07:48

I'm sitting here waiting (im)patiently for Mr Glow to start making controllers again... I haven't used my M in 4 months and I have withdrawals :o

User avatar
vivalarevolución
formerly prdlm2009

11 Jan 2017, 02:05

Nitephyre wrote: I'm sitting here waiting (im)patiently for Mr Glow to start making controllers again... I haven't used my M in 4 months and I have withdrawals :o
He occasionally posts an update on his website. Things are a little backed up at the moment. http://phosphorglow.net/

Leonvet

22 Jan 2017, 19:36

Hi phosphorglow,

It's my first post on deskthority but i'm a model m veteran annoying my co-workers with my trusty 101 key model for at least 15 years and for the last 4 years with a ssk.

My company switched from dell laptops to macbooks back in 2012 forcing me to use a ps/2 > usb adapter, which worked without any issues. Now my macbook was up for replacement and i just received a brand new macbook pro 13" with touchbar and 4 usb-c ports. Hooking up the ssk via my ps/2 > usb-a adapter and then an usb-a > usb-c adapter didn't prove to be such a great experience. Now i have to deal with a disconnecting keyboard every few minutes, max. one hour if i'm lucky. Lots of people complaining for years on the apple fora about disconnecting usb keyboards (even apple's own keyboards are problematic). As far as i can see it has something to do with wifi and bluetooth interference on usb 3 devices, i bet ibm never anticipated that being a problem with the model m keyboards.

Figuring the ps/2 conversion could be circumvented i set about buying everything to replace the model m controller with a teensy++ 2.0 and then i came across this amazing thread. Your solutions is so much more elegant than what my rusty soldering skills could muster.

Do you still sell the v1 or v2 version of your controller pcb, either assembled or the bare pcb? It would be a real life saver as i dread the day i would have to switch to a chicklet mac keyboard.

Appologies for the long post and regards,

Leon

User avatar
Ir0n

22 Jan 2017, 22:34

Have you looked into the Soarer's SDL to usb cables? Orihalcon sells them on ebay still I think. They have a controller built into the cable head..plus it lets you do neat macro stuff.

Edit: It seems he is out of stock.. :(

User avatar
XMIT
[ XMIT ]

22 Jan 2017, 23:25

The SDL-USB cables orihalcon sells are just simple protocol converters and not Soarer's Converters. All the other ones are. If it's not specifically advertised as such, it's not.

User avatar
Ir0n

22 Jan 2017, 23:39

Yeah he carries a soarer's version of SDL to USB just not at the moment..Lol
But I'm not sure if you're just warning him so he doesn't grab the wrong one if he does want to get one.
I really didn't think of that..

http://www.ebay.com/itm/271816109375

I'd PM him and ask him about it if you're interested.

Leonvet

23 Jan 2017, 07:08

Thanks for the sdl cable tip. After using the id innovations ps/2 usb adapter and a bluecube i think i'm up for a true usb controller instead of protocol conversion.

Too bad the pcbs are out of stock, i'll heat up my soldering iron and start experimenting with a teensy. I will keep an eye on this thread, can't beat a real pcb imho.

User avatar
alh84001
v.001

01 Apr 2017, 19:55

Slight necro, but does anyone know exact name or part/manufacturer number of connectors that can be used with model M ribbons?

User avatar
rsbseb
-Horned Rabbit-

02 Apr 2017, 02:27

alh84001 wrote: Slight necro, but does anyone know exact name or part/manufacturer number of connectors that can be used with model M ribbons?
I do not have a part number to offer but I think what you are looking for is referred to as a zif connector. You can search for and browse for them at Mouser, they have a huge selection available.

User avatar
alh84001
v.001

02 Apr 2017, 04:22

Thanks on the help. I actually searched for FFC/FFP, and then I tried deducing pitch from pictures online as I don't have model M near me right now :)

I think these would work for 16 and 8 pin membrane respectively:
https://www.arrow.com/en/products/6-520 ... nnectivity
https://www.arrow.com/en/products/5-520 ... nnectivity

User avatar
rsbseb
-Horned Rabbit-

03 Apr 2017, 04:21

alh84001 wrote: Thanks on the help. I actually searched for FFC/FFP, and then I tried deducing pitch from pictures online as I don't have model M near me right now :)

I think these would work for 16 and 8 pin membrane respectively:
https://www.arrow.com/en/products/6-520 ... nnectivity
https://www.arrow.com/en/products/5-520 ... nnectivity
The 2.54 pitch checks out on the membranes from my wheel writer.

User avatar
just_add_coffee

14 May 2017, 17:27

Bumpity bump.

User avatar
seebart
Offtopicthority Instigator

14 May 2017, 17:28

just_add_coffee wrote: Bumpity bump.
Necro bumping? Why not! :mrgreen:

User avatar
just_add_coffee

14 May 2017, 17:57

seebart wrote:
just_add_coffee wrote: Bumpity bump.
Necro bumping? Why not! :mrgreen:
And I've also messaged phosphorglow. I hope to ride that fine line between "enthusiastic" and "annoying jackhole." :D

Post Reply

Return to “Workshop”