New Year’s Resolutions

As we stand here looking at the brand-new year ahead, we find ourselves taking stock, and maybe thinking how we can all be better people in the next year. More exercise, being nicer to your neighbors, consuming more or less of this or that, depending on whether it’s healthy or un. Those are the standard fare. But what’s your hacker new year’s resolution?

Mine, this year, is to branch out into a new microcontroller family, to learn a new toolchain, and maybe to finally dip my toes into Bluetooth Low Energy. Although that last one is admittedly a stretch.

But the former is great resolution material, if you allow me. New programming tooling is always a little unpleasant to set up, but there’s also payoff at the end of the ordeal. It’s a lot like picking up a new exercise – it makes you stronger. Or course, it helps to have an application in mind, the equivalent of that suit you want to be able to fit into at the end of the diet. I’ve got one. I’ve also been out of programming in straight C for a year or so, and I’m faced with a new HAL, so there’s bound to be enough of a challenge to make it worthwhile.

Honestly, I’m looking forward to getting started, but with the usual mix of optimism, over-optimism, and mild dread. It’s the perfect setup for a resolution! What’s yours?

(And yes, the art is from another story, but setting up a good backup regime isn’t a bad resolution either.)

Software Driving Hardware

We were talking about [Christopher Barnatt]’s very insightful analysis of what the future holds for the Raspberry Pi single board computers on the Podcast. On the one hand, they’re becoming such competent computers that they are beginning to compete with lightweight desktop machines, instead of just being a hacker curiosity.

On the other hand, especially given the shortage and the increase in price that has come with the Pi’s expanding memory endowments, a lot of people who would “just throw in a Raspberry Pi” are starting to think more carefully about their options. Five years ago, this would have meant looking into what you could whip together on an Arduino-based platform, either on actual Arduino hardware or on an ESP8266 or similar, but that’s a very different beast from a programmer’s perspective. Working with microcontrollers used to be very different from working with even the smallest Linux machines.

These days, there is no shortage of microcontrollers that have enough memory – both flash and RAM – to support a higher-level environment like MicroPython. And if you think about it, MicroPython brings to the microcontrollers a lot of what people were using a Raspberry Pi for in projects anyway: a friendly interactive programming environment that was free of the compile-here, flash-there debug cycle. If you’re happy coding Python on a single-board Linux computer, you’ll be more or less happy coding in MicroPython or Circuit Python on a microcontroller.

And what this leaves us with, as hackers, is a fantastic spectrum of choices. Where before there was a hard edge between programming C on an 8-bit PIC or an AVR and working with something that had a full Linux operating system like a Pi, it’s all blurry now. And as the Pis, the Jetson, and all the other Linux SBCs are blurring the boundary with more traditional computers as they all become more competent and gain more computer-like peripherals. Nowadays your choice is much freer, and the hardware landscape more fluid. You don’t have to let software development concerns drive your hardware choices, and we think that’s a great thing.

Cornell Updates Their MCU Course For The RP2040

The School of Electrical and Computer Engineering at Cornell University has made [Bruce Land]’s lectures and materials for the Designing with Microcontrollers (ECE 4760) course available for many years. But recently [Bruce], who semi-retired in 2020, and the new lecturer [Hunter Adams] have reworked the course and labs to use the Raspberry Pi Pico. You can see the introductory lecture of the reworked class below.

Not only are the videos available online, but the class’s GitHub repository hosts extensive and well-documented examples, lecture notes, and helpful links. If you want to get started with RP2040 programming, or just want to dig deeper into a particular technique, this is a great place to start.

From what we can tell, this is the third overhaul of the class this century. Back in 2012 the course was using the ATmega1284 AVR microcontroller, and in 2015 it switched to the Microstick II using a Microchip PIC32MX. Not only were these lecture series also available free online, but each has been maintained as reference after being replaced. One common thread with all of these platforms is their low cost of entry. Assuming you already have a computer, setting up the hardware and software development environment for these modules costs less than the price of a pizza dinner, a fact no doubt appreciated by the ECE department’s budget director.

We’ve covered this course before back in 2015 when it first changed. Another free online course on embedded system design is from [Prof James Conrad] at UNC Charlotte, based on the Renasas RX63N microcontroller — the UNC Charlotte team drove development of the autonomous vehicle project we covered back in 2009. If you know of other online embedded systems classes, let us know in the comments below.

Continue reading “Cornell Updates Their MCU Course For The RP2040”

Word Tour Map of High Altitude Balloon Launched at Hackaday Supercon.

Supercon Balloon W6MRR-26 Continues Its World Tour

[Martin Rothfield] and other amateur radio operators from San Francisco High Altitude Ballooning (SF-HAB) treated conference attendees to the 2022 Hackaday Supercon to the launch of two High Altitude Balloons (HABs). On the morning of November 6th, the two balloons were launched from a park across the street from Supplyframe DesignLab in Pasadena, California.

Seven days after its launch from Southern California, one of the balloons was over Tajikistan cruising eastward at an altitude of 42,000 feet (12,800 meters). Balloon W6MRR-26 was already approaching China where it will continue its wonderful world tour to parts unknown. The second balloon (call sign W3HAC-11) landed in northern Arizona where it has continued transmitting whenever it receives power from the sun.

Each balloon carries a tiny payload — a printed circuit board powered only by small photovoltaic cells. The board includes a microcontroller, a GPS module, and a Weak Signal Propagation Reporter (WSPR) radio transmitter.  The transmitted operates on the 20 meter amateur radio band at around 14 MHz.

WSPR beacons can provide time, altitude, and location information.  The WSPR telemetry is then relayed via WSPRgates using Automatic Packet Reporting System (APRS) onto the Internet. The collected information can be viewed and mapped on websites such as aprs.fi.

Continue reading “Supercon Balloon W6MRR-26 Continues Its World Tour”

The Virtue Of Wires In The Age Of Wireless

We ran an article this week about RS-485, a noise resistant differential serial multidrop bus architecture. (Tell me where else you’re going to read articles like that!) I’ve had my fun with RS-485 in the past, and reading this piece reminded me of those days.

You see, RS-485 lets you connect a whole slew of devices up to a single bundle of Cat5 cable, and if you combine it with the Modbus protocol, you can have them work together in a network. Dedicate a couple of those Cat5 lines to power, and it’s the perfect recipe for a home, or hackerspace, small-device network — the kind of things that you, and I, would do with WiFi and an ESP8266 today.

Wired is more reliable, has fewer moving parts, and can solve the “how do I get power to these things” problem. It’s intrinsically simpler: no radios, just serial data running as voltage over wires. But nobody likes running cable, and there’s just so much more demo code out there for an ESP solution. There’s an undeniable ease of development and cross-device compatibility with WiFi. Your devices can speak directly to a computer, or to the whole Internet. And that’s been the death of wired.

Still, some part of me admires the purpose-built simplicity and the bombproof nature of the wired bus. It feels somehow retro, but maybe I’ll break out some old Cat5 and run it around the office just for old times’ sake.

Remoticon 2021 // Voja Antonic Makes You A Digital Designer

[Voja Antonic] has been building digital computers since before many of us were born. He designed with the Z80 when it was new, and has decades of freelance embedded experience, so when he takes the time to present a talk for us, it’s worth paying attention.

For his Remoticon 2022 presentation, he will attempt to teach us how to become a hardware expert in under forty minutes. Well, mostly the digital stuff, but that’s enough for one session if you ask us. [Voja] takes us from the very basics of logic gates, through combinatorial circuits, sequential circuits, finally culminating in the description of a general-purpose microprocessor.

A 4-bit ripple-carry adder with additional CPU flag outputs

As he demonstrates, complex digital electronics systems really are just built up in a series of steps of increasing complexity. starting with individual active elements (transistors operating as switches) forming logic elements capable of performing simple operations.

From there, higher level functions such as adders can be formed, and from those an ALU and so on. Conceptually, memory elements can be formed from logic gates, but it’s not the most efficient way to do it, and those tend to be made with a smaller and faster circuit. But anyway, that model is fine for descriptive purposes.

Once you have combinatorial logic circuits and memory elements, you have all you need to make the necessary decoders, sequencers and memory circuits to build processors and other kinds of higher complexity circuits.

Obviously forty minutes isn’t anywhere nearly enough time time to learn all of the intricacies of building a real microprocessor like the pesky details of interfacing with it and programming it, but for getting up the learning curve from just a knowledge of binary numbers to an understanding of how a CPU is built, it’s a pretty good starting point.

Now, If you can only tear your eyes away from his slick game-of-life wall mounted LED display, you might pick up a thing or two.

Continue reading “Remoticon 2021 // Voja Antonic Makes You A Digital Designer”

Blink An LED On A PIC32 With Rust, Easily

Got a PIC32 microcontroller and a healthy curiousity about the Rust programming language and its low-level capabilities, but unsure how to squash the two of them together with a minimum of hassle? If that’s the case, then today is your lucky day!

[Harry Gill] has you covered with his primer on programming a PIC32 with Rust, which will have you blinking an LED in no time. [Harry] admits that when he got started, his microcontroller programming skills were a bit rusty, so don’t let yourself think setting this up is beyond your abilities. If you have a working knowledge of the basics of microcontroller programming, you’ll be fine. [Harry] had to jump through a few hoops to get the right tools working, but thoughtfully documented the necessary steps, and provides a bare minimum hardware list.

Unsure what Rust is or what it offers? Check out the basics here, and see if it’s something that interests you. If you want to look even deeper, check out the kind of work that goes into writing a bare metal kernel in Rust.