Universal Model M Controller

User avatar
clickykeyboards

06 Feb 2015, 14:52

I think the USB A-male to USB B-male cable with large connectors (NOT mini or micro USB connectors) would be a more natural fit to the vintage nature of the model M keyboard as a peripheral like a printer or a scanner.

In contrast with a camera or portable device, there is more than enough room for the larger connector on the back of the model M keyboard and the need to use of slim connector doesn't seem warranted.

Adding a bluetooth radio to the replacement controller, would be a nice add-on idea or perhaps a separate design (but certainly not a requirement). One thing that most people forget is that wireless keyboards then need replaceable batteries and/or rechargable circuitry.

andrewjoy

06 Feb 2015, 15:12

i agree with this, full sized B is best. Micro is fine for phones, mini should be depreciated by now they are useless.

User avatar
Muirium
µ

06 Feb 2015, 16:07

Hmm. I use B on my metal Soarer Box, but you do know it's a much shorter lifetime connector than either Mini or Micro USB…

Stupid USB being different on both ends! Symmetrical cables are much more stylish.

User avatar
chzel

06 Feb 2015, 16:30

How many times have you reached the EOL of a USB connector? Actual fault of the connector, not damage. Type B is rated at 1500 cycles IIRC, which is 4,5 years of plugging/unplugging once EVERY DAY.
If this was about a 60%, fine, it is portable and people go to work with their small keyboard.
How many take their SSK with them?

User avatar
Muirium
µ

06 Feb 2015, 16:54

All right, but my OCD isn't listening!

Incidentally, I unplug keyboards very frequently, as I switch between machines at home most days. The laptop always needs a board removed so I can put it away. So these cycles do all add up, if not so dramatically as I fear when doing them…

User avatar
0100010

06 Feb 2015, 17:04

For me, I would probably only want bluetooth if it also supported a mouse - like an M13 or M5. But that's probably niche enough to be done on it's own, compared to Model M's in general.

User avatar
Muirium
µ

06 Feb 2015, 17:13

I'm guessing niche indeed. A nice idea for a project though.

Meanwhile I've got a Bluetooth mouse and trackpad I like plenty already. The Bluetooth SSK is what I need to fit between them! Wireless perhipherals team up so elegantly that I'm crying out for a top notch board to complete the set. And I've SSKs ready to convert.

User avatar
phosphorglow

07 Feb 2015, 06:59

Time for some thinking out loud again...

The stock bootloader on the 1286 is Atmel DFU. Fine and dandy, except it seems in order to do any flashing you need to invoke the HWB and Reset pins, right? Well that's not very convenient. Currently there's a resistor between ground and the HWB pin in this layout, and I don't know how that affects the DFU.

I'd like to put LUFA HID on it, but I've never flashed the bootloader on an MCU, so I've spent most of this evening reading and suddenly it's bedtime. But before that, here's my very simple understanding:

- Compile LUFA with the 1286 specific parameters and build the hex.

- Use avrdude to set the fuses for appropriate flash size.

- Use avrdude to transfer the LUFA bootloader through an ISP to the 1286.

And that's where I'm stuck, I don't have an ISP but I can apparently make one using the ArduinoISP firmware on a Teensy. Cool. No problem!

Now how the heck do I connect the ISP to the 1286? I'm assuming I need the MISO, MOSI, and SCLOCK ports, but I really have no clue at the moment. Any insight will be greatly appreciated upon waking. ^_^

Edit:
Or have I just completely missed something and I can overwrite the DFU bootloader without an ISP...?

Arakula

07 Feb 2015, 08:10

It would be a good idea to include the possibility to add an ISP connector on your board. Rarely used, but makes life much easier if you need to reprogram the boot loader (or want to remove it entirely and use all the space for your application).
Layout is like this (view from top):
Image
(from Evil Mad Scientist Laboratories, where you can find a nice description, too).
Most ISP programmers come with a cable for the 10-pin layout, the better ones with both (or an adapter).
As for the original, Atmel's AVR910 document details ISP programming.

On the AT90USB1286 (and, I believe, most AVRs),
PB1 = SCK
PB2 = MOSI
PB3 = MISO

User avatar
idollar
i$

07 Feb 2015, 08:38

I always wondered why Atmel boards do not come always by default with an ISP interface

An SB ISP USBasp is so cheap that I am not sure if it does make sense to do it yourself ...
http://www.aliexpress.com/wholesale?cat ... isp+usbasp

Arakula

07 Feb 2015, 10:59

Careful with these cheap chinese things, they normally come with a practically unusable firmware that requires a strange Windows program to work, or reflashing to work with AVRdude (i.e., you need a programmer to program the programmer :) ). Been there, done that

User avatar
idollar
i$

07 Feb 2015, 11:23

The one that I have works without any problem. I use a GNU linux-based OS

User avatar
Muirium
µ

07 Feb 2015, 11:35

Isn't ATMEGA more power hungry (and way less capable) than ARM? I know we use it (Teensy 2 and ++) for software compatibility's sake. But the Teensy 3.1 is a much more able component, and since you're starting from scratch here it might be smart to go ARM from the outset. Especially for power conscious Bluetooth support reasons!

User avatar
phosphorglow

07 Feb 2015, 14:35

Arakula wrote: It would be a good idea to include the possibility to add an ISP connector on your board. Rarely used, but makes life much easier if you need to reprogram the boot loader (or want to remove it entirely and use all the space for your application).
Layout is like this (view from top):
Image
(from Evil Mad Scientist Laboratories, where you can find a nice description, too).
Most ISP programmers come with a cable for the 10-pin layout, the better ones with both (or an adapter).
As for the original, Atmel's AVR910 document details ISP programming.

On the AT90USB1286 (and, I believe, most AVRs),
PB1 = SCK
PB2 = MOSI
PB3 = MISO
Thanks! Looks quite a bit simpler than what I was making it out to be last night. Cool. That article was really helpful, which then lead me to Make an Arduino into ISP programmer (Let's Make Robots). I think I have a much better understanding now.
Muirium wrote: Isn't ATMEGA more power hungry (and way less capable) than ARM? I know we use it (Teensy 2 and ++) for software compatibility's sake. But the Teensy 3.1 is a much more able component, and since you're starting from scratch here it might be smart to go ARM from the outset. Especially for power conscious Bluetooth support reasons!
Software compatibility. :D
Down the road in the evolution I'm sure it will happen. Plus I'm really enjoying creating a PCB layout - it's better than doing a puzzle!
hasu wrote: Great job!
Totally agree with big B connector. Alps SKHH angled switch doesn't fit there?

Double decker switch like this will be perfect for adding Bluetooth pairing button [emoji1]

Image
Oooh! I was hoping a switch like that existed! I'll take a look at the datasheet and play around with positioning.

User avatar
phosphorglow

07 Feb 2015, 14:51

Additional update:

I've been toying with the second PCB idea and here's what's up:

I'm happy to hear the feedback about the big USB-B connector preference, it's definitely staying. Additionally, I'm definitely including a provision for Micro. My original idea for having secondary pads next to the USB-B won't work - there wouldn't be enough clearance for the cable and case, so the connector needs to be moved vertically to center it a little more.

I have enough room next to the mounting posts for two female headers. The second (modular) PCB can then be stacked on top where I can mount the Micro, some buttons, a switch, and LED. The board will be 5cm x 1.5cm which I can keep in this PCB layout and keep it in the 20cm total design limit and have it v-scored during production.

Excitement continues to ensue.

User avatar
phosphorglow

07 Feb 2015, 15:37

Halvar wrote: Is bluetooth really the most important feature? After all this is still a Model M, which is not one of the most "mobile" keyboards from the start... My guess is what phosphorglow is originally aiming for is mainly the ability to make and sell fully refurbished, bolt-modded and modernized Model Ms that come with a programmable USB controller from the start, for a crowd that wants the quality and retro look of a Model M but no hassle. For that goal, bluetooth might actually be a less important goal, right?

To have a bluetooth controller for the Model M as a "sellable product" (although small scale) would also be a great goal of course, but I guess it would probably look different, not based on this microcontroller and an Adafruit EZKey...

So I guess it's a good compromise to have the option to add bluetooth to this with easily available components and a bit of (more or less) easy assembly required, and maybe go for a full bluetooth design in a different installment.
The first aim I had in mind is simply aesthetics. I absolutely hate having to desolder the SDL connector from a stock controller. I do it very cleanly without damaging the board or connector, with specifically cut wires running to a Teensy (I'm a stickler for pretty wiring), and a specifically Xacto cut panel header that mounts to the board and doesn't require drilling holes in the case (another no-no in my book). In the time it takes me to do all that annoying stuff, I can happily solder a bunch of SMD components to a brand new pretty PCB and be waaaaaay happier with the final result.

It's pretty, but I hate it.
2014-12-02 18.23.191.jpg
2014-12-02 18.23.191.jpg (75.94 KiB) Viewed 5893 times
2014-12-02 18.24.181.jpg
2014-12-02 18.24.181.jpg (82.3 KiB) Viewed 5893 times
The same goal applies to the rest of the community. I want everyone to have a nice layout that they can use which suits their preferences in as many variations as possible for a singe board. I'm also planning a different through hole version to simply mount a Teensy++ to that I'm sure a lot of people would love. Buy a $5 board and solder it together yourself and have a super pretty specialized board for your M. I love it and would love seeing it.

User avatar
phosphorglow

07 Feb 2015, 15:43

(Side-side note: EXCITEMENT!!! My toner transfer sheets are arriving today! I can make my first prototype board this weekend!!! Squeeeeee! ^_^)

User avatar
phosphorglow

09 Feb 2015, 01:02

Sooooo I need to run a couple of wires to replace crappy traces, otherwise so far so good.

The toner transfer sheets I got were utter crap.
Attachments
2015-02-08 18.58.58.jpg
2015-02-08 18.58.58.jpg (62.55 KiB) Viewed 5835 times

User avatar
scottc

09 Feb 2015, 01:44

That sucks! I suppose they'll help to speed up prototyping somewhat, at least (?)

Anyway, great work. I'm very excited for more updates. :D

User avatar
hasu

09 Feb 2015, 02:19

phosphorglow wrote: Time for some thinking out loud again...

The stock bootloader on the 1286 is Atmel DFU. Fine and dandy, except it seems in order to do any flashing you need to invoke the HWB and Reset pins, right? Well that's not very convenient. Currently there's a resistor between ground and the HWB pin in this layout, and I don't know how that affects the DFU.
Thanks for keeping us updated!

You need to press Reset button with pulling HWB down to start bootloader regardless of which bootloadr you are using. (And you can start bootloader from running proper firmware with special key combo with any kind of bootloader.) I don't think HID bootloader has advantage here. Both of them needs Reset button and HWB pull down resistor in the end.(The permanent HWB pull down resistor works with both bootloaders.)

Prmary merit of HID bootloader is its compatibility to Teensy, people may be familiar to Teensy loader already and they don't need to intall additional driver to flash. While DFU flash tools will require driver installation.

I for one don't have any problem with Atmel stock DFU bootloader so far except for its size.

User avatar
phosphorglow

09 Feb 2015, 12:26

2015-02-09 04.58.191.jpg
2015-02-09 04.58.191.jpg (57.2 KiB) Viewed 5821 times
In all its wondrous glory. Can't wait for a real double sided PCB!

Amazingly, it's functional! Not so amazing is that FLIP now throws me an error upon erase/verify after I loaded Soarers Controller (it did flash and verify properly the first time). Google tells me it's because of some stock fuse/lock settings and I need to re-flash the bootloader. Aside from that though, it's working. Time to put the TeensyduinoISP to work!

A thought occurred to me: Do I really need the crystal? Isn't there an internal oscillator? I'm sure I need it, but it doesn't hurt to ask.
hasu wrote:
phosphorglow wrote: Time for some thinking out loud again...

The stock bootloader on the 1286 is Atmel DFU. Fine and dandy, except it seems in order to do any flashing you need to invoke the HWB and Reset pins, right? Well that's not very convenient. Currently there's a resistor between ground and the HWB pin in this layout, and I don't know how that affects the DFU.
Thanks for keeping us updated!

You need to press Reset button with pulling HWB down to start bootloader regardless of which bootloadr you are using. (And you can start bootloader from running proper firmware with special key combo with any kind of bootloader.) I don't think HID bootloader has advantage here. Both of them needs Reset button and HWB pull down resistor in the end.(The permanent HWB pull down resistor works with both bootloaders.)

Prmary merit of HID bootloader is its compatibility to Teensy, people may be familiar to Teensy loader already and they don't need to intall additional driver to flash. While DFU flash tools will require driver installation.

I for one don't have any problem with Atmel stock DFU bootloader so far except for its size.
Very nice to know about the resistor - I was hoping that was the case!

Have you ran into the above mentioned issue with the erase/verify error?

User avatar
phosphorglow

09 Feb 2015, 12:34

scottc wrote: That sucks! I suppose they'll help to speed up prototyping somewhat, at least (?)

Anyway, great work. I'm very excited for more updates. :D
Wellllll, it'll speed up future prototypes knowing not to buy these particular sheets. :P

I ended up using 8 of the 10 sheets, putting 4 boards per page, and only came up with a few usable ones. Maybe it's just my printer? I dunno - guess I'll find out in the future with a different brand. (Any recommendations?)

User avatar
phosphorglow

09 Feb 2015, 18:08

Okie dokie - I can definitely use some help on what fuse settings I should throw at this thing... :P

The fusecalc site has a whole bunch of options that are currently over my head.

Current read of settings is:
lfuse 5E
hfuse 99
efuse F3

User avatar
phosphorglow

09 Feb 2015, 19:35

Otay.

I currently have LUFA DFU bootloader installed, and Soarers Controller. It enumerates as Soarers upon plugin.

New fuse settings are, low 5E, high DA, extended F1.

So I have BOOTRST and HWBE enabled, .

Now... isn't it supposed to enumerate as a DFU device when I hit the reset button? Because it doesn't.

(And now I momentarily bricked it by setting the CKSEL0-3 to programmed, assuming it was to use the external 16MHz crystal, and now I'm getting a verification error saying it's set to FF. This is exciting. I probably don't have the correct capacitors on the xtal. I have 10pF's, and the crystal is 20pF. That's incorrect, I'm assuming. I'm doing a lot of assuming today.)

Edit/Update:
Apparently I set it to use an external clock? Time to whip out another teensy...

Edit edit:
Grr. Walking away from this for now. Time to play with some large power tools instead.

User avatar
phosphorglow

10 Feb 2015, 05:04

TL;DR Version of my previous rambling posts:

I built the prototype, it worked, and then I promptly broke it because I didn't thoroughly RTFM. Shame on me. :P

Apparently in the AVR world, bricking a chip through fuse settings is a rite of passage. Note to self: don't do that again.

User avatar
Halvar

10 Feb 2015, 10:04

That stinks... Thanks for documenting what happened, I will definitely re-read this should I ever have to fidlle with an AVR chip's boot loader.

User avatar
chzel

10 Feb 2015, 10:34

It's not really bricked, with an external clock such as a function generator, you can reprogram the fuses

Arakula

10 Feb 2015, 13:28

For un-bricking, this might be helpful, if you got a Teensy at hand:
http://www.larsen-b.com/Article/260.html
http://www.evilmadscientist.com/2007/fi ... on-an-avr/

User avatar
phosphorglow

04 Mar 2015, 02:31

I'll be posting progress in the morning, but for now...

One of my last hurdles: I need a good very small push on-off toggle with less than 1cm width, or a slide switch with the same footprint and a long actuator (like, 8+mm).

Anyone have something bookmarked? Surely this exists. There's a lot to scroll through on Mouser, but I haven't seen it yet.

(By the looks of it, the Lipo Rider is just using a single pole single throw, even though it looks like a SPDT).

...I'd really love a push on/off, though.

User avatar
phosphorglow

04 Mar 2015, 03:43

Whoa whoa whoa... Potentially never mind. Plus I found that actuator "paddles" are a thing.

I've been thinking that the switch on the lipo was to switch between external and battery power, and now it's dawning on me that it's simply an on/off switch. Durrrrrr.

Halvar - what needs to actually happen to switch between direct connection via usb and Bluetooth?

Post Reply

Return to “Workshop”