Moving Forth With Mecrisp-Stellaris And Embello

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.

To work!

Hardware

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.

Programmer Connected, Power over USB

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.

Continue reading “Moving Forth With Mecrisp-Stellaris And Embello”

Ethanol-Powered Arduinos

Following the time-honored YouTube tradition of ordering cheap stuff online and playing with it while the camera runs, [Monta Elkins] bought a Stirling engine that drives a DC motor used as a generator. How much electrical juice can this thing provide, running on just denatured alcohol? (Will it blend?)

The answer is probably not really a spoiler: it generates enough to run “Blink.ino” on a stock Arduino, at least when powered directly through the 5 V rail. [Monta] recorded an open-circuit voltage of around 5 V, and a short-circuit current of around 100 mA at a measured few hundred millivolts. While he didn’t log enough of the points in-between to make a real power curve, we’re guessing the generator might be a better match for 3.3 V electronics. The real question is whether or not it can handle the peaky demands of an ESP8266. Serious questions, indeed!

The video is a tad long, but it’s more than made up for by the sight of an open flame vibro-botting itself across his desk while [Monta] is trying to cool the cold side down with a melting ice cube. Which got us thinking, naturally. If you just had two of the Stirling enginesContinue reading “Ethanol-Powered Arduinos”

A Real Hacker’s IDE

We don’t use a GUI IDE, but if we did, it would most certainly be something along the lines of [Martin]’s embedded-IDE project. We’ve always felt that most IDEs are just fancy wrappers around all the tools that we use anyway: Makefiles, diff, git, ctags, and an editor. [Martin]’s project makes them less fancy, more transparent, and more customizable, while retaining the functionality. That’s the hacker’s way — putting together proven standard tools that already work.

The code editor he uses is QScintilla, which uses clang for code completion. The “template” system for new projects? He uses diff and patch to import and export project templates. Because it uses standard tools all along the way, you can install the entire toolchain with sudo apt-get install clang diffutils patch ctags make on an Ubuntu-like system. Whatever compiler you want to use is supported, naturally.

We can’t see a debugger interface, so maybe that’s something for the future? Anyway, if you want a minimalistic IDE, or one that exposes the inner workings of what it’s doing rather than hiding them, then give [Martin]’s IDE a try. If you want more bells and whistles that you’re not going to use anyway, and don’t mind a little bloat and obscuration, many of our writers swear by Eclipse, both for Arduino and for ARM platforms. We’ll stick to our butterflies.

A Tool For KiCad Board Renderings

If you’re producing documentation for a PCB project, you might as well make the board renders look good. But then, that’s a lot of work and you’re not an artist. Enter [Jan]’s new tool that takes KiCad board files, replaces each footprint with (custom) graphics, and provides a nice SVG representation, ready for labelling. If you like the output of a Fritzing layout, but have higher expectations of the PCB tool, this is just the ticket.

We all love [pighixx]’s pinout diagrams. Here’s his take on the Arduino Uno, for instance. It turns out that he does these largely by hand. That’s art for ya.

Sparkfun has taken a stab at replicating the graphical style for the pin labels, but then they toss in a photo of the real item. [Jan]’s graphic PCB generator fills in the last step toward almost putting [pighixx] out of a job. Get the code for yourself on GitHub.

Mangling Images With Audio Effects

Ever wonder what those snapshots you took of your trip to Paris would look like if you ran them through a Proco RAT or a Boss Overdrive? How about a BF-3 flanger? [Robert Foss] wrote in with this nifty little script (GitHub) that processes images as if they were audio files so that you can try it out without investing in a rack of analog pedals. Test your audio/visual DSP intuition and see if you can name the images without looking at the effects.

If you know your Linux command-line utilities, there’s really not much to it — scroll down to the very bottom of the script to see how it’s done. ffmpeg converts the images to YUV format, which works much better than RGB for audio processing, and then sox adds the audio effects. Another trip through ffmpeg gets you back to an image or video.

OK, it’s cheating because it’s applying the audio effects inside the computer, but nothing’s stopping you from actually taking the audio out and running it through that dusty Small Stone. Of course, once you’ve got audio outside of the computer, the world is your oyster. Relive the glorious 70’s when video artists made works using souped-up audio synthesizers. If you haven’t seen the Sandin Image Processor or the Scanimate in action, you’ve got some YouTubing to do.

Gain Access To Science Two Ways

Not a hack, but something we’ve been wanting to see forever is open access to all scientific publications. If we can soapbox for a few seconds, it’s a crying shame that most academic science research is funded by public money, and then we’re required to pay for it again in the form of journal subscriptions or online payments if we want to read it. We don’t like science being hidden behind a paywall, and neither do the scientists whose work is hidden from wider view.

Here are two heartening developments: Unpaywall is a browser extension that automates the search for pre-press versions of a journal article, and the Bill and Melinda Gates Foundation are denying rights to research that it has funded if the resulting publications aren’t free and open.

The concept of “publishing” pre-print versions of academic papers before publication is actually older than the World Wide Web — the first versions of what would become arXiv.org shared LaTeX version of physics papers and ran on FTP and Gohper. The idea is that by pushing out a first version of the work, a scientist can get early feedback and lay claim to interesting discoveries prior to going through the long publication process. Pre-prints are available in many other fields now, and all that’s left for you to do is search for them. Unpaywall searches for you.

Needless to say, this stands to take a chunk out of the pocketbooks of scientific publishers. (Whether this matters in comparison to the large fees that they charge libraries, universities, and other institutional subscribers is open to speculation.) The top-tier journals — Nature, Science, the New England Journal of Medicine, and others — have been reluctant to offer open access, so brilliant scientists are faced with the choice of making their work openly available or publishing in a prestigious journal, which is good for their career.

In a step to change the status quo, the Bill and Melinda Gates Foundation took their ball and went home; research funded with their money has to be open-access, period. We think that’s a laudable development, and assuming that the foundation funds quality research, the top-tier journals will be losing out unless they cooperate.

To be fair to the journal publishers, many journals are open-access or have open-access options available. The situation today is a lot better than it was even five years ago. But if we had a dime for every time we try to research some scientific paper and ran into a paywall, we wouldn’t be reduced to hawking snazzy t-shirts.

Thanks [acs] for the tip!

High Vacuum With Mercury And Glassware

If you want to build your own vacuum tubes, whether amplifying, Nixie or cathode-ray, you’re going to need a vacuum. It’s in the name, after all. For a few thousand bucks, you can probably pick up a used turbo-molecular pump. But how did they make high vacuums back in the day? How did Edison evacuate his light bulbs?

Strangely enough, you could do worse than turn to YouTube for the answer: [Cody] demonstrates building a Sprengel vacuum pump (video embedded below). As tipster [BrightBlueJim] wrote us, this project has everything: high vacuum, home-made torch glassware, and large quantities of toxic heavy metals. (Somehow [Jim] missed out on the high-voltage from the static electricity generated by sliding mercury down glass tubes for days on end.)

Continue reading “High Vacuum With Mercury And Glassware”