Wednesday, February 16, 2011

R.I.P. HFE Electronics, Sac's Electronic Part Source

I wrote a post about the HFE Electronics Store last year. They took over the former HSC Electronics store here in the Sacramento area. I drove by today, and the store was empty.

HFE Electronics. A Valiant Effort, but Now It's Gone.

It looks like they went out of business two or three months ago, based on their Facebook discussion page. I only got down there four or five times a year, but I usually stocked up on parts, tools, and supplies on each trip.

Unfortunately this leaves me without a local storefront supplier for electronics. Our local Fry's Electronics carries enough in the way of components and such to make up for what Radio Shack dropped from their line a few years ago. But the selection of parts like interconnects, switches, and prototyping components they had at HFE was far greater than I'd expect to find anywhere other than an old-fashioned electronics store.

I do buy a lot of parts online now, I'll admit. I have about two shopping sprees a year for parts from places like The Electronic Goldmine and BG Micro. Not to mention frequent buys of parts from regular suppliers like Jameco, Mouser Electronics, All American Semiconductor.

But there's a difference.

At a local storefront, the parts are in my hands today. Plus, I can see them and handle them. With items like switches this is extremely important. I can also buy parts in small quantities speculatively then come back the next day if they work out and I need more (I've done this several times over the years at HFE/HSC. I remember once buying over $100 more in components on both days than I had planned on buying on each of two consecutive days. As I recall, the main culprit was some displays one the first day, and some uP support chips the second.)

Another thing that's important about local stores is their accessibility to youngsters getting into the electronics hobby. I know that for me when I was young, and now my daughters, fishing through boxes of parts and imagining what could be done with them is very inspirational. A couple of the fellows at the shop I haunted in my teens (Wenger's Electronics in Walnut Creek, CA) mentored me on several of my early projects. Plus there was advice I picked up from other customers. Not to mention that Wengers had a rack of bubble pack parts from Jameco, where I got my first 8080A.

A Long Time Since

I've been shopping at what was HSC and became HFE since I moved to the Sacramento almost exactly 25 years ago. Back then, I lived just a few blocks away. I not only stopped by in the evenings (if I had to run out in the evening for something, hey, HSC was next door to a Circle K store. How convenient is that? Pick up milk and potentiometers on the same trip out!) They had great flea markets on the weekends. You could pick up most of an Altair or IMSAI for a song back back then, enough that a little TLC would get you there (I wish I'd picked up an IMSAI for the front panel.)

There were other electronics stores* in Sac back then, plus I was right at the north end of town so it was easier to get to places like Natomas and Del Paso Heights for those stores. Since I moved to the foothills, HFE has been where I go.

This is where I met Dave Baldwin. I followed him home to get a treasure trove of old computer and parts he was seeking a home for. It's where I picked up about half of my test instruments, in various states of operability, that I use regularly today. It's where I've picked up interesting bits for many projects, and bits that still inhabit my parts drawers awaiting future fun projects.

I'll miss it.

Note: If you know something else in the area that I don't seem to know about (I already know about Fry's and Radio Shack, obviously), then drop a comment or an email, please!

*I'm using the term "electronics store" to refer to what I consider to be an electronics store, which is not a place that primarily sells consumer electronics. We used to call those "TV shops" or "Stereo Stores". I'm rather perturbed by such places moving in on the term "electronics store" (though many old-line electronics stores were once TV stores or repair shops.)

Monday, February 14, 2011

Home-Made Miniature: TCG Yavuz

TCG Yavuz in 1:1800

Among the various games I enjoy are naval miniatures games. When Axis and Allies: War at Sea came out a few years ago, I liked the fact that there was an easy source of new naval miniatures (and a decent set of rules). But the minis were in yet another new scale. Traditional miniatures already came in a bunch of different scales depending on rule set and manufacturer. Though things had pretty well settled down to being in either 1:1200 scale or 1:1250 scale for mid-sized minis.

Then came War at Sea with 1:1800 scale. The minis are nice for the size, and given the fact that they're molded in a fairly soft plastic, they've got pretty good detail. Even if it's a bit blocky.

Homebrew Ships
I thought I'd try my hand at making a mini in the same scale. I built this mini in 2007, shortly after War at Sea first appeared, before any expansion sets were released. It's been sitting in a desk drawer waiting for a paint job since then, I just finished painting it.

When I decided to make my own mini, I wanted to make something that I could be pretty sure wouldn't be coming out in an expansion. It'd be pretty silly to make a ship that would be available for a few bucks from the manufacturer a month after I finished it. Also, the ship had to be interesting enough to model and play with. Not to mention that it should be large enough for me to model by hand, without sculpting and casting.

So, a capital ship. But where would I find a period capital ship that's not likely to appear in the War at Sea expansions?

As it happens I like unusual ships with interesting stories behind them (well, who doesn't?) The TCG Yavuz fits that description exactly. A German Battlecruiser built before WWI, it became the Turkish navy's flagship when it fled the British in the eastern Mediterranean, docked in neutral Turkey, then was sold to Turkey by Imperial Germany as an inducement to Turkey to enter the war on their side.

So an interesting German capital ship escaped the scuttling at Scapa Flow at the end of WWI. It served in the Turkish navy until the 1950's.

When modelling something in a small scale, you have to make a number of choices about what you're going to model and what you're going to skip. You want the ship to represent its prototype, but you'll go mad if you try to capture all its details. In my case, I decided to mainly get guns, turrets, and major masses of superstructure on the model, as well as hull details like the belt and the casemates.

What I ended up with is less than perfect. The fore stack is too short. The hull's entry is too narrow. The mass I use to represent the searchlight tower and other structure around the aft mast is too large. But overall I'm pretty happy with how it turned out.

And to date, it's the only TCG Yavuz I know of that's around for War at Sea.

Monday, February 7, 2011

Coding Forms for Hand-Made Programs

I've posted some of the coding forms I use on my website.

For me, hand coding and hand assembling software is pleasant and relaxing. It's like crochet or embroidery (I do both of those as well as programming.) Something as simple as a printed form makes it nicer, neater, and faster.

The forms of my own I've posted are generic assembly language forms. I've also posted a TI 960/980 assembly language form as well as some programming forms for the HP-41C, HP-67 and HP-97 that I use with all of my programmable calculators (like my HP-35S.)

Friday, February 4, 2011

MAG-85: 8085 Microprocessor Project Software Progress

With the hardware work on my 8085 microprocessor trainer project about 99% complete, most of my effort over the past month or so has been developing a simple monitor program (a sort of mini-OS) for it.

The biggest part of that OS deals with the user interface (go figure), specifically the routines for controlling the LCD. The most demanding of the routines have been done for well over a year now, ever since I finished testing the LCD display with the breadboard version of the MAG-85.

The Early MAG-85 with LCD Demo Program

When writing my own software while playing with the LCD (i.e. goofing off rather than writing code for the monitor), I've been writing lots of ad-hoc software to write to the LCD or control it whenever I wanted something more sophisticated than "write this character to the screen" or "send this string to the screen". Character out and string out routines were in my early test software. What I needed were things like automatic wrapping at the end of the displayed line and some terminal control commands.

Coding Rule: Make One to Throw Away

The display controller for the LCD has a larger "display" area than the LCD actually displays. Its buffer holds two lines of 40 characters. That's really nice on my other display which has a 40x2 LCD display on it. But the MAG-85 uses a 16x2 display. This means you can send characters to it, and it'll happily accept them and put them into the buffer in places that the LCD doesn't show. So you don't see over half of what you write. Or you need to keep track of how many characters you've written since the start of the line and wrap to the start of line 2 yourself. And so on.

In my first shot at a set of LCD routines for the system monitor, I wrote a bunch of stand alone cursor position tracking and movement routines. Then I had to invoke them from all over to keep track of stuff. And since the software had to do its own tracking, stuff would get missed, the LCD would get out of sync, and it became standard practice to re-home the cursor and display every so often to keep things from going off track for too long.

Plus the number of routines was getting out of hand, along with the size of the software. I'd intended the software to come in somewhere around a page in length, and I was at about twice that with only about half the software implemented! For comparison sake, a system that uses a hardware approach to display control (e.g. LED or other simple segmented displays with data buffers and select logic) rather than software like the LCD uses fits the whole monitor into about 1K of memory. I was looking at my LCD routines taking up as much room as the whole rest of the monitor.

Frankly, I felt that I was going the wrong way, and it slowed me down in getting the monitor done.

Coding Rule: Make Another to Keep

I decided to strip the code back to my original tight routines. All they do is initialize the LCD, send out a character or a command byte, or a string of characters. First, I dressed up my initialization routine by moving out some recurring code for delays into subroutines. This not only reduced the size of that routine, but made those subroutines available elsewhere.

Then I looked at my character out routine, and decided to put the intelligence about where the cursor was in there. After all, if it gets written this is where it happens. I built in an automatic wrap. It seemed to fit well, and it took a lot of heat off the user code. Suddenly things were looking a lot better.

Once I got to rewriting some of the other added functionality, it turned out smaller and simpler. It went so well, that I'm much farther along in implementing everything I want than I got with the old code. And at present I'm only just over a page in length, without having gone back to look for optimizations (repeated code and so on.) That'll come next, after which I'll be desk=checking my stack handling as I jump around between different routines.

But I'm much happier, and I've got a lot more to show for my time this time. It's nothing revolutionary, but there are times when it's a breakthrough just to step back and see the obvious.