Cause for hope
First of all, I got the demo USB peripheral running. The thing has a button and a light; software on a Windows PC can switch the light and read the button. Also, in a surprisingly unrelated fashion, I had a lovely experience at Fry’s yesterday that somehow made me optimistic on behalf of the casual hobbyist. I shall describe both forthwith.
Fry’s
I think that, for an electronics hobbyist, it’s highly desirable or even necessary to have a store within driving distance that sells a meaningful stock of electronic components. Back when I lived in Gaithersburg nothing would bring a project (not to mention my morale) to a screeching halt quite like finding out that I’d forgotten to include something on my last Newark order and would have to wait a good week at least to continue. The creative process is spontaneous. Inspiration doesn’t wait for that next package; it wanes. It withers. And only sometimes is one lucky enough to get it back. (If there were a society dedicated to keeping that spark always alive, I’d be in touch.)
But, at any rate, I believe that this justifies a stock of whatever it is you might need to cross the finish line that sits closer than a website, even if it does occasionally mean a premium of convenience. I also believe that such a store is pretty crucial to a culture of would-be amateur engineers doing interesting things with electricity in their own homes, if only because passing by an electronics kit in a store is a lot more likely to pique the interest of a non-initiate than the same stuff on a piddly web page.
I recently wrote about my recent perusal of the stock of a local Radio Shack. To review, RS was somewhat hopeful, I’d say looking up, but still quite disappointing.
I happen to be fortunate enough to live near one of the few scattered Fry’s locations outside California and Texas (homes of the first and second Maker Faires, respectively), in the northern ‘burbs of Indianapolis, in the very building where Incredible Universe once tried (and failed) to change the way we think about consumer electronics.
My primary objective was a tube of no-clean flux to use in conjunction with an electric skillet reflow soldering adventure, but overall, I was just curious. I hadn’t been to Fry’s since I unpacked my breadboard after 3 solid years of cold storage, and my time now being more valuable than ever, I wanted to know what I could expect to get here in the event that I needed it faster than I could order it.
I was pleasantly surprised to say the least.
Their selection of discrete components and ICs is almost comically massive. Like with RS, some of this stuff must have been on the shelf for some time now, but unused electronics in packaging not exposed to animals, weather, and so forth tends to hold up. A lot of the silicon looked like a catalog for TV repair, including big diodes and CRT support chips, but I was able to pick out several important digital logic ICs in both TTL and CMOS. There was also a handy selection of capacitors and resistors, including just about any potentiometer I could imagine using in a normal project. There were even assorted variety packs of capacitors, resistors, and LEDs, presumably for the person who hasn’t yet built up a strong collection of components.
In the same section, I found a decent selection of breakout boards for various types of surface-mount components. I’d need to make or buy something like this, for example, to breadboard around the TQFP-packaged PIC micros I got as samples. The price was a little high for my taste, but it didn’t seem that much worse than the actual price—I think I’d hesitate to buy one from anyone unless I needed it. But it’s very nice to know those are there.
I actually saw what appeared to be a 50-pack of solder-cup DE-9 connectors (the kind used by serial mice and Atari/Commodore-compatible joysticks). I wonder who’s buying these.
Their kit/hobby selection was outstanding. I’m going to highlight something very important and notable here: Fry’s sells clones of six different models of Arduino. The name is OSEPP, and they seem to be working almost verbatim from the Arduino reference plans. They’re not plagiarizing, though—they have given credit where it’s due, posted their modifications to their site, and even given the same model names as the originals (Uno, Nano, Fio, Pro, Pro Mini, and Mega). They don’t seem to be inflating the price, either—the nominal baseline (Uno) is $31, which is only a dollar more than the real deal at SparkFun (before shipping, which I assume is not free).
And, if Arduino isn’t your thing, they also seem to have a pretty substantial selection of boards and kits from Parallax based on the Propeller (their multi-core microcontroller) and BASIC Stamp. Several robotics-related offerings were available, including kits for full robots as well as sensor modules (range/distance and GPS, among others), so this might be your gig if you like things that move. (It’d be great to see the same kits for Arduino, because it is possible. The sensor modules could easily be made to work with an Arduino as well.)
As I said before, I think it’s important that these things be available on the shelf at an actual store, where the possibility of direct eye contact with something cool can stoke a fledgling or wistful mind into action.
Finally, if you thought Lite Brite was cool, this oughta do something for you:
This nifty toy (which also comes in a more gender-neutral version and a games version) looks like it must be a piece of conductive foam with a voltage bias from one edge to the other. In effect, if you plug an LED into it, it will turn on. (I believe it’s the same principle as the LED hot dog, but with kid-safe voltages.)
I bought hardly any of the above; just the flux, a couple of the “Surfboards” (surface-mount breakouts with pre-attached breadboard pins), a few 10-pin header connectors, and a USB A-to-pins cable for when I inevitably second-guess the soldering job on my USB B connector. (See below.) This would demonstrate a modicum of self-control, of which I think I expected to have a little less.
USB
I haven’t made a complete writeup about the USB thing because most of the important stuff is in the original article. I do have these points of interest to mention:
- Starting off, the only 20MHz crystals I had sitting around were surface-mount (i.e. not breadboard-friendly) and I was afraid that I’d have to solder one before I got started. However, to my pleasant surprise, the solderable lands on this device are actually just flat wires, and they can be bent down carefully to turn them into breadboard leads! Yay. This didn’t do away with all the soldering, though…
- I needed a 5-pin male-male adapter to form a ICSP (programming) header; the PC-mount contacts on the pins aren’t long enough to stay stably connected to the breadboard. I snipped a small piece of perfboard and soldered one 5-pin header to another positioned upside-down with its plastic rack slid to the end. It seems to work nicely.
- I also needed a USB B connector. The through-hole connector can be easily coerced to fit in perfboard; I added a 4-pin header and connected everything with bus wire.
- I didn’t wire up the circuit correctly at first. For one thing, I’d forgotten to route any power to the chip. D’oh! After I corrected this, it would power up but wouldn’t run. Scrutiny revealed that I’d crossed the data and clock lines on the ICSP header. Always check.
I was able to compile the firmware in MPLAB running on Wine. To actually test the device, I had to boot into Windows for a spell. Everything works, but there’s too much closed software involved in the process.
But I’d like to get the whole project ported open. The easier part would be the client software: Get a Linux program talking to the device. What I’ve read so far suggest that the task shouldn’t be too monumental if it’s based on libusb, and there seem to be bindings for several usable languages.
The harder part would be the firmware, which would be so much better if it could be compiled by SDCC, a microcontroller-oriented C compiler. It’s already written in C, but this is definitely not the whole story. PIC 18* has several available C compilers, but of the important ones in Windows—Microchip’s stock C and Hi-Tech C—only the latter can be used on the project’s code. SDCC isn’t (intended to be) the spitting image of either one, and will likely have its own quirks to be worked out.
Anyway, the easy one is also the first one that must be done; there’s no sense in writing a bunch of firmware in SDCC if I have to reboot to Windows to verify it.
Cool.