In the last episode, I advocated a little bit for Forth on microcontrollers being a still-viable development platform, not just for industry where it’s usually seen these days, but also for hackers. I maybe even tricked you into buying a couple pieces of cheap hardware. This time around, we’re going to get the Forth system set up on that hardware, and run the compulsory “hello world” and LED blinky. But then we’ll also take a dip into one of the features that make Forth very neat on microcontrollers: easy multitasking.
Mecrisp-Stellaris Forth runs on a great number of ARM microcontrollers, but I’ll focus here on the STM32F103 chips that are available for incredibly little money in the form of a generic copy of the Maple Mini, often called a “STM32F103 Minimum System Board” or “Blue Pill” because of the form-factor, and the fact that there used to be red ones for sale. The microcontroller on board can run at 72 MHz, has 20 kB of RAM and either 64 or 128 kB of flash. It has plenty of pins, the digital-only ones are 5 V tolerant, and it has all the usual microcontroller peripherals. It’s not the most power-efficient, and it doesn’t have a floating-point unit or a DAC, but it’s a rugged old design that’s available for much less money than it should be.
Similar wonders of mass production work for the programmer that you’ll need to initially flash the chip. Any of the clones of the ST-Link v2 will work just fine. (Ironically enough, the hardware inside the programmer is almost identical to the target.) Finally, since Forth runs as in interactive shell, you’re going to need a serial connection to the STM32 board. That probably means a USB/serial adapter.
This whole setup isn’t going to cost much more than a fast food meal, and the programmer and USB/serial adapter are things that you’ll want to have in your kit anyway, if you don’t already.
You can power the board directly through the various 3.3 and GND pins scattered around the board, or through the micro USB port or the 5V pins on the target board. The latter two options pass through a 3.3 V regulator before joining up with the 3.3 pins. All of the pins are interconnected, so it’s best if you only use one power supply at a time.
There are very few things that are so far reaching across many different disciplines, ranging from biology to engineering, as is the relation of the surface area to the volume of a body. This is not a law, as Newton’s second one, or a theory as Darwin’s evolution theory. But it has consequences in a diverse set of situations. It explains why cells are the size they are, why some animals have a strange morphology, why flour explodes while wheat grains don’t and many other phenomena that we will explore in this article.
You find them everywhere from 3D printers to jet airliners. They’re the little switches that detect paper jams in your printer, or the big armored switches that sense when the elevator car is on the right floor. They’re microswitches, or more properly miniature snap-action switches, and they’re so common you may never have wondered what’s going on inside them. But the story behind how these switches were invented and the principle of physics at work in the guts of these tiny and useful switches are both pretty interesting.
It was a dark and stormy afternoon, the kind you get on the east side of the country. I was drinking a coffee, sitting in a camping chair in front of my door, and watching like a hawk for the treacherous cable man to show up. This day there would be no escape. There would be no gently rapping the door with a supple sheepskin leather glove before scurrying away for another union mandated coffee break. I was waiting, I was kind of grumpy, and by God today would be the day. Today would be the day that after hours on hold, after three missed appointments, after they lost my records twice; I would get an answer on whether or not they could actually service internet to my apartment. If I was lucky, and the answer was yes, then approximately two to three thousand years later they would run a cable from the telephone pole to my house and I could stop commandeering WiFi from the pizza shop across from me.
It’s important to note that I was in the middle of the city. I wasn’t out in the boonies. Every house on the block but mine had cable. While this is dumb, it begins to make more sense when you dive into the history. Louisville, Kentucky is a strange place. It used to be the gateway to the west. Ships would crawl up its river until they reached the falls. Then porters would charge an exorbitant fee to carry all those goods down to the bottom of the falls where they would be loaded on a ship and be sent ever westward. Resulting in every rich merchant, captain, and manufacturer in the region having a nice house there. Ever wonder why the Derby is in Louisville and the Queen comes to visit sometimes? It probably has something to do with it having the highest concentration of Victorian buildings and mansions outside of New York City.
There’s a lot to be said in favor of getting kids involved in hacking as young as possible, but there is one thing about working in electronics that I believe is best left as a mystery until at least the teenage years — hide the shrink tube. Teach them to breadboard, have them learn resistor color codes and Ohm’s Law, and even teach them to solder. But don’t you dare let them near the heat shrink tubing. Foolishly reveal that magical stuff to kids, and if there’s a heat source anywhere nearby I guarantee they’ll blow through your entire stock of the expensive stuff the minute you turn your back. Ask me how I know.
I jest, but only partly. There really is something fun about applying heat shrink tubing, and there’s no denying how satisfying a termination can be when it’s hermetically sealed inside that little piece of inexplicably expensive tubing. But how does the stuff even work in the first place?
If you are a connoisseur of analogue audio, it’s probable you might have a turntable and a stack of records at home somewhere. If you are of a certain age you may even have a cassette deck, though you’re more likely to have abandoned that format some time in the 1990s. If you are old enough to have been around in the 1960s or 1970s though, you may have owned another analogue audio format. One of several that you might have found in a well-equipped home of that period was the 8-track stereo cartridge, a self-contained tape cassette format that fit four stereo tracks onto a single quarter-inch tape loop as eight parallel tracks, four each of left and right. A triumph of marketing, really, it should more accurately have been called 4-track stereo.
8-track cartridges were developed from earlier tape cartridge formats, largely to satisfy the demands of the automotive industry for interchangeable in-car entertainment. Thus if you owned an 8-track player it was most likely to have been found in your car, but it was not uncommon to find them also incorporated into home hi-fi systems. Thus we come to our subject today. Our retrotechtacular series usually highlights a video showing a bygone technology, but today we’re going to get a little more hands-on.
Some time in the early 1990s, I acquired an 8-track player, a BSR McDonald unit manufactured in the UK and dating from the early 1970s. BSR were much more well-known for their turntables, so this is something of an oddity. Where I found it has disappeared into the mists of time, but it was probably at a radio rally or junk sale. I certainly didn’t buy it because I wanted it to play 8-track tapes, instead I wanted a talking point for my hi-fi, something quirky to set it apart from everyone else’s. So every incarnation of listening enjoyment chez List for the last quarter century has had an 8-track player nestling within it, even if it has never played a tape while in my ownership. Thus we have a unique opportunity for this retro teardown.
It was but two weeks ago when I told my story of woe — the tale of an LG Nexus 5X that fell ill, seemingly due to a manufacturing fault at birth. I managed to disassemble it and made my way through a semi-successful attempt at repair, relying on a freezer and hairdryer to coax it back to life long enough to backup my data. Try as I might, however, I simply couldn’t get the phone running for more than ten minutes at a time.
All was not in vain, however! I was rewarded for documenting my struggles with the vast experience and knowledge of the wider Internet: “Hairdryers don’t get as hot as heatguns!”
It turned out I had just assumed that two similar devices, both relying on a hot bit of metal and a fan as their primary components, must be virtually identical if rated at a similar power draw. I was wrong! Apparently the average hairdryer stays well cooler than 150 degrees Celsius to avoid melting one’s silky locks or burning the skin. I even learned that apparently, wet hair melts at a lower temperature than dry hair. Who knew?
Armed with this knowledge, I rushed out and bought the cheapest heat gun I could find — around $50. Rated up to 600 degrees C, this was definitely going to be hotter than the hairdryer. With the prevailing opinion being that I had not applied enough heat in general, I decided to also increase the heating period to 90 seconds, up from a quick 30 second pass originally.