Code Craft: Subtle Interrupt Problems Stack Up

[Elliot Williams’] column, Embed with Elliot, just did a great series on interrupts. It came in three parts, illustrating the Good, the Bad, and the Ugly of using interrupts on embedded systems. More than a few memories floated by while reading it. Some pretty painful because debugging interrupt problems can be a nightmare.

One of the things I’ve learned to watch out for over the years is the subtlety of stack based languages, like C/C++, which can ensnare the unwary. This problem has to do with the corruption of arrays of values on a stack during interrupt handling. The fix for this problem points up another one often used by black hats to gain access to systems.

Continue reading “Code Craft: Subtle Interrupt Problems Stack Up”

New Part Day: The BeagleBoard Gets Bigger

Officially, the latest hardware revision we’ve seen from BeagleBoard is the BeagleBone Black, a small board that’s perfect for when you want to interface hardware to a Linux software environment. This last summer, the BeagleBone Green was introduced, and while it’s a newer hardware release, it’s really just a cost-reduced version of the BB Black. Over the entire BeagleBoard family, it’s time for an upgrade.

It’s been talked about for more than a year now, but the latest and greatest from the BeagleBoard crew is out. It’s called the BeagleBoard X15, and not only is it an extremely powerful Linux board, it also has more ports than you would ever need.

The new BeagleBoard features a dual-core ARM Cortex A15 running at 1.5GHz. There is 2GB of DDR3L RAM on board, and 4GB of EMMC Flash. Outputs include three USB 3.0 hosts, two Gigabit Ethernet controllers, one eSATA connector, LCD output, two PCIe connectors, and an HDMI connector capable of outputting 1920×1080 at 60 FPS. The entire board is open hardware, with documentation for nearly every device on the board available now. The one exception is the PowerVR SGX544 GPU which has a closed driver, but the FSF has proposed a project to create an open driver for this graphics engine so that could change in the future.

The expected price of the BeagleBoard X15 varies from source to source, but all the numbers fall somewhere in the range of $200 to $240 USD, with more recent estimates falling toward the high end. This board is not meant to be a replacement for the much more popular BeagleBone. While the development and relationship between the ~Board and ~Bone are very much related, the BeagleBone has always and will always be a barebone Linux board, albeit with a few interesting features. The BeagleBoard, on the other hand, includes the kitchen sink. While the BeagleBoard X15 hardware is complete, so far there are less than one hundred boards on the planet. These are going directly to the people responsible for making everything work, afterwards orders from Digikey and Mouser will be filled. General availability should be around November, and certainly by Christmas.

While it’s pricier than the BeagleBone, the Raspberry Pi, or dozens of other ARM Linux boards out there, The BeagleBone has a lot of horsepower and plenty of I/Os. It’s an impressive piece of hardware that out-competes just about everything else available. We can’t wait to see it in the wild, but more importantly we can’t wait to see what people can do with it.

Title image credit: Vladimir Pantelic

Vintage BBC Computer gets FPGA Buddies

The BBC Microcomputer System (or BBC Micro) was an innovative machine back in the early 1980’s. One feature that impressed reviewers was a “tube” interface that allowed the machine to become an I/O processor for an additional CPU. When the onboard 6502 became too slow, it could become a slave to a Z-80 or even an ARM processor. The bus was actually useful for any high-speed device, but its purpose was to add new processors, a feature Byte magazine called “innovative.”

[Hoglet67] has released a very interesting set of FPGA designs that allows a small board sporting a Xilinx Spartan 3 to add a 6502, a Z80, a 6809, or a PDP/11 to a BBC Micro via the tube interface. There’s something satisfying about a classic computer acting as an I/O slave to a fairly modern FPGA that implements an even older PDP/11.

Continue reading “Vintage BBC Computer gets FPGA Buddies”

New Part Day: Tiny, Tiny Bluetooth Chips

The future of tiny electronics is wearables, it seems, with companies coming out with tiny devices that are able to check your pulse, blood pressure, and temperature while relaying this data back to your phone over a Bluetooth connection. Intel has the Curie module, a small System on Chip (SoC) meant for wearables, and the STM32 inside the Fitbit is one of the smallest ARM microcontrollers you’ll ever find. Now there’s a new part available that’s smaller than anything else and has an integrated Bluetooth radio; just what you need when you need an Internet of Motes of Dust.

The Atmel BTLC1000 is a tiny SoC designed for wearables. The internals aren’t exceptional in and of themselves – it’s an ARM Cortex M0 running at 26 MHz. There’s a Bluetooth 4.1 radio inside this chip, and enough I/O, RAM, and ROM to connect to a few sensors and do a few interesting things. What makes this chip so exceptional is its size – a mere 2.262mm by 2.142mm. It’s a chip that can fit along the thickness of some PCBs.

To provide some perspective: the smallest ATtiny, the ‘tiny4/5/9/10 in an SOT23-6 package, is 2.90mm long. The smallest PICs are similarly sized, and both have a tiny amount of RAM and Flash space. The BTLC1000 is surprisingly capable, with 128kB each of RAM and ROM.

The future of wearable devices is smaller, faster and more capable devices, and with a tiny chip that can fit on the head of a pin, this is certainly an interesting chip for applications where performance can be traded for package size. If you’re ready to dive in with this chip the preliminary datasheets are now available.

JavaScript for the ESP8266

The ESP8266 is a popular WiFi chip that provides a relatively transparent connection between the TX and RX pins of a microcontroller and a WiFi network. It was released a little more than a year ago, and since then developers and hardware hackers have turned the ESP into much more than a serial to WiFi bridge. It’s a microcontroller platform unto itself, with a real development environment and support for the scripting language Lua.

Lua is okay, but a real win would be a JavaScript interpreter for this tiny WiFi platform. It’s taken months of work, but finally there’s an open source version of JavaScript available for the ESP8266.

This build is based on the Espruino firmware, a JavaScript interpreter for microcontrollers. This interpreter runs on dozens of different microcontrollers, but being the latest, greatest, and most popular new microcontroller platform means a new solution for the ESP is very, very exciting.

Right now the JS interpreter for the ESP is in testing, with expectations high that everything will be brought over into the main branch of the Espruino firmware. There are samples of JavaScript running on the ESP available, and binaries that can be flashed onto an ESP are available here.

Thanks [Richard] for sending this one in. He’s set up an Espruino board on the ESP8266 community forum, that should eventually be filled with new examples of JavaScript running on an ESP.

STM32 JavaScript Peeks and Pokes

A lot of people find scripting languages very productive and we’ve seen quite a few chips now supporting what you normally think of as a scripting language. These high-level abstraction languages are great, until they aren’t. When you need to go under the abstraction and do something complex or you need every cycle of performance, you might have to break your normal tools.

The Espruino is an ARM processor (an STM32) that has JavaScript on board. However, [Gordon Williams] shows how you can use peeks and pokes to access the hardware directly when the need arises. The names derive from another popular abstraction’s escape hatch. The old BASIC languages allowed direct memory access using keywords peek and poke. [Gordon] shows some examples of accessing the timer for PWM, and even looks at the STM32 reference manual to show how he knew where to peek and poke to begin with.

Continue reading “STM32 JavaScript Peeks and Pokes”

Embed With Elliot: Interrupts, the Bad

We love interrupts in our microcontroller projects. If you aren’t already convinced, go read the first installment in this series where we covered the best aspects of interrupts.

But everything is not sunshine and daffodils. Interrupts take place outside of the normal program flow, and indeed preempt it. The microcontroller will put down whatever code it’s running and go off to run your ISR every time the triggering event happens. That power is great when you need it, but recall with Spider-Man’s mantra: With great power comes great responsibility. It’s your responsibility to design for the implicit high priority of ISRs, and to make sure that your main code can still get its work done in between interrupt calls.

Put another way, adding interrupts in your microcontroller code introduces issues of scheduling and prioritization that you didn’t have to deal with before. Let’s have a look at that aspect now, and we’ll put off the truly gruesome side-effects of using interrupts until next time.

Continue reading “Embed With Elliot: Interrupts, the Bad”