Thursday, November 03, 2016

Ports

Something about the discussion around the new MacBook Pros' (lack of) ports was bugging me. In particular, this tweet:

Having re-found and re-read it, I realise now that Marco wasn't saying that pre-iMac Macs used PS/2 and parallel ports. Still, it's as good a jumping-off point as any for why I think comparing the MacBook Pro's move to USB-C ports only to the iMac's adoption of USB in 1998 is a false equivalence.

Prior to the iMac, Macs used ADB, serial via mini-DIN and SCSI. These aren't just legacy ports. ADB was a proprietary Apple connection. Serial and SCSI, while industry standards, were the less popular choices in their respective categories. And that, I think, is why they had to go from Jobs' volksputer. At a time when you could pick up a perfectly reasonable serial mouse for £2, replacement ADB mice started from around £20. [I can't find an information about whether you could use serial mice in place of ADB. Even if you could, you'd need a dongle.] The £99 ink jet printers were parallel (and increasingly USB); models with serial interfaces were available, but they were typically the more expensive pro models. And the SCSI variants of external devices generally came at a premium over their parallel or USB counterparts. Adopting USB — unlike dropping the floppy drive — was as much about opening up access to a world of commodity peripherals as it was about ditching dusty old legacy interfaces.

Saturday, January 02, 2016

Things

Last year I worked my first (and probably last) IoT gig. I was brought in to build a prototype of the product's iOS companion app and then asked to work on the firmware for the (still-NDA'd) product itself. It was definitely an experience.

Firstly, working with hardware engineers in very different from working with software engineers. For one thing, their desks are so much messier. They tend to have far more pointy and/or hot tools to hand, and generally do at least one thing each day which could potentially burn down the build.

Product planning also takes on a very different flavour. Brainstorming meetings typically follow this kind of pattern:

SOFTWARE GUY: Here's an idea. Why don't we do [thing involving computing]

HARDWARE GUY: Well, yes, we could. But it would have a detrimental effect on battery life.

SOFTWARE GUY: Then how about we do [another thing involving computing]

HARDWARE GUY: Maybe. But it would mean drawing an extra [ridiculously small amount of power] from the battery.

SOFTWARE GUY: Or we could —

HARDWARE GUY: No. Battery.

SOFTWARE GUY: Okay. Would anyone like a cup of —

HARDWARE GUY: BATTERY!

The hardware guys I worked with were wonderful chaps, utterly boffiny types, but boy were they obsessed with batteries.

My second observation involves embedded toolchains, and how they are utter shit. Seriously. I was never one of those complain-about-Xcode guys, but from now on, I shall stifle even the smallest gripe should it threat to escape my lips. What's that? Xcode's crashed? Well at least it hasn't caused a kernel panic, like MP-fucking-Labs kept doing.

(Or at least that was the plan before I started working with Swift… But that's a story for another day.)

I don't really want to go too in-depth into exactly how shite the MPLabs IDE is. I'm trying to put the whole experience behind me. I won't bitch about how the compiler's a modified version of GCC which they've somehow managed to make worse. Or how Microchip want to charge you money for allowing you to write in C++. Or even C99. I am completely over the stress-induced headaches which come from it optimising-away entire blocks of code I had set breakpoints in, even at the lowest setting (or that the higher settings were a paid upgrade).

Let me just make a single observation about the IDE: it doesn't feature any kind of code autocompletion, but it does spellcheck your comments.

Finally, let's deal with the important stuff: the hardware and software. What OS did we use? Ha! Where we're going, we don't need no OS! Okay, this isn't entirely true. The hardware doesn't require an OS (this is embedded microcontroller programming, after all), but after a couple of months of random flailing around it because quite obvious that I did. My years wasted writing assembly language on the Atari ST hadn't properly prepared me for getting this close to the metal. In the end there was some considerable re-tooling and we settled on FreeRTOS to provide a sheen of civilisation to the otherwise register-level barbarity. Tasks! Queues! If felt like someone who went camping and ended up booking into a hotel as soon as it started raining, but sod it, I was comfortable again.

There was a little concern that adding the decadent excess of an OS would fritter away our limited resources, and I must admit I got caught up in this until the point where a took a step back and realised that the chip in question — based on the 32-bit MIPS M4K core running at 40Mhz — was more powerful then the first half dozen computers I owned combined. Sure, it only had 32k RAM and 256k ROM, but we were only asking it to perform some very basic coordination between peripherals. The hardware they'd used to make Jurassic Park wasn't that much more powerful. We could manage.

I left the project when yet another shift in hardware was on the cards. It seemed like a natural break. I'd been telling them from day one that they would be better served by hiring an embedded specialist, and eventually I just felt I had to make a move and force them to take that step. I would have liked to stay on to see The Thing go into production and onto the market. Imagine: seeing neatly shrink-wrapped boxes containing a product that you helped take from an idea to a finished item, rolling off the production line and onto the shelves. I'm keeping an eye open for when it does.

Friday, January 01, 2016

Rez '16

I know there's really no cosmic significance to the 1st of January, but it's as good a day as any to make a new start.

This year I'm going to write every day. Simple as that. Sure, I have a good idea of what I want to write, a list of stories waiting to come to life and be checked off the list, some pie-in-the-sky dreams of where I want to end up, but let's not overcomplicate things. I spent most of last year with fingers on keyboard — at least 10 hours a day, as a result of the day job — and yet I produced nothing, adding only a few paragraphs to one short story. And that simply isn't good enough.

I've started running again. I'm wondering why I can do that — peel myself out of a lovely toasty bed, dress myself in silly clothes, go out into the freezing morning and stumble about wheezing and red in the face — and yet I'm finding it so difficult to devote even half an hour a day to writing. That's going to have to change.