Bare Metal STM32: The Various Real Time Clock Flavors

Keeping track of time is essential, even for microcontrollers, which is why a real-time clock (RTC) peripheral is a common feature in MCUs. In the case of the STM32 family there are three varieties of RTC peripherals, with the newest two creatively called ‘RTC2′ and RTC3’, to contrast them from the very basic and barebones RTC that debuted with the STM32F1 series.

Commonly experienced in the ubiquitous and often cloned STM32F103 MCU, this ‘RTC1’ features little more than a basic 32-bit counter alongside an alarm feature and a collection of battery-backed registers that requires you to do all of the heavy lifting of time and date keeping yourself. This is quite a contrast with the two rather similar successor RTC peripherals, which seem to insist on doing everything possible themselves – except offer you that basic counter – including giving you a full-blown calendar and today’s time with consideration for 12/24 hour format, DST and much more.

With such a wide gulf between RTC1 and its successors, this raises the question of how to best approach these from a low-level perspective.

Continue reading “Bare Metal STM32: The Various Real Time Clock Flavors”

FreeCAD Foray: From Brick To Shell

Over a year ago, we took a look at importing a .step file of a KiCad PCB into FreeCAD, then placing a sketch and extruding it. It was a small step, but I know it’s enough for most of you all, and that brings me joy. Today, we continue building a case for that PCB – the delay is because I stopped my USB-C work for a fair bit, and lost interest in the case accordingly, but I’m reviving it now.

Since then, FreeCAD has seen its v 1.0 release come to fruition, in particular getting a fair bit of work done to alleviate one of major problems for CAD packages, the “topological naming problem”; we will talk about it later on. The good news is, none of my tutorial appears to have been invalidated by version 1.0 changes. Another good news: since version 1.0, FreeCAD has definitely become a fair bit more stable, and that’s not even including some much-needed major features.

High time to pick the work back up, then! Let’s take a look at what’s in store for today: finishing the case in just a few more extrusions, explaining a few FreeCAD failure modes you might encounter, and giving some advice on how to make FreeCAD for you with minimum effort from your side.

Continue reading “FreeCAD Foray: From Brick To Shell”

GPS And Its Little Modules

Ever want to find your device on the map? Think we all do sometimes. The technology you’ll generally use for that is called Global Positioning System (GPS) – listening to a flock of satellites flying in the orbit, and comparing their chirps to triangulate your position.

The GPS system, built by the United States, was the first to achieve this kind of feat. Since then, new flocks have appeared in the orbit, like the Galileo system from the European Union, GLONASS from Russia, and BeiDou from China. People refer to the concept of global positioning systems and any generic implementation as Global Navigation Satellite System (GNSS), but I’ll call it GPS for the purposes of this article, and most if not all advice here will apply no matter which one you end up relying on. After all, modern GPS modules overwhelmingly support most if not all of these systems!

We’ve had our writers like [Lewin Day] talk in-depth about GPS on our pages before, and we’ve featured a fair few projects showing and shining light on the technology. I’d like to put my own spin on it, and give you a very hands-on introduction to the main way your projects interface with GPS.

Continue reading “GPS And Its Little Modules”

Bootstrapping Android Development: A Survival Guide

Developing Android applications seems like it should be fairly straightforward if you believe the glossy marketing by Google and others. It’s certainly possible to just follow the well-trodden path, use existing templates and example code – or even use one of those WYSIWYG app generators – to create something passable that should work okay for a range of common applications. That’s a far cry from learning general Android development, of course.

The process has changed somewhat over the years, especially with the big move from the Eclipse-based IDE with the Android Development Tools (ADT) plugin, to today’s Jetbrains IntelliJ IDEA-based Android Studio. It’s fortunately still possible to download just the command-line tools to obtain the SDK components without needing the Google-blessed IDE. Using the CLI tools it’s not only possible to use your preferred code editor, but also integrate with IDEs that provide an alternate Android development path, such as Qt with its Qt Creator IDE.

Continue reading “Bootstrapping Android Development: A Survival Guide”

No Ham License? Listen Anyway In Your Browser

Full disclosure: ham radio isn’t for everyone, and there are many different facets to it. What appeals to one person might bore another to death. One area of ham radio that has changed a lot in the last few years is more or less local and typically mobile operation on VHF or UHF. Not long ago, hams used HTs (walky-talkies or handi-talkies) or mobile radios via repeaters to talk to each other and — the golden prize back then — make phone calls from their cars. Cell phones have made that much less interesting, but there is still an active community of operators talking on repeaters. However, the traffic has gone digital, the Internet is involved, and people with inexpensive, low-powered radios can talk to each other across the globe. This is nothing new, of course. However, having digital services means that operators with special interests can congregate in what amounts to radio chat rooms organized by region or topic.

There’s a long history of people listening to ham radio conversations with shortwave radios, SDRs, and scanners. But with so much activity now carried on the Internet, you can listen in using nothing more than your web browser or a phone app. I’ll show you how. If you get interested enough, it is easy enough to get your license. You don’t need any Morse code anymore, and a simple Technician class license in the United States is all you need to get going.

A Quick DMR Primer

There are several digital ham networks around and like real networks, you can have different physical transport layers and then build on top of that. For the purposes of this post, I’m going to focus on DMR (digital mobile radio) on the Brandmeister network which is very large and popular ham network. You won’t need a license nor will you need to sign up for anything as long as you are content to just listen.

Continue reading “No Ham License? Listen Anyway In Your Browser”

One Small Step: All About Stepper Motors

The primary feature of stepper motors is listed right within their name: their ability to ‘step’ forwards and backwards, something which they (ideally) can do perfectly in sync with the input provided to their distinct coils. It’s a feature that allows the connected controller to know the exact position of the stepper motor, without the need for any sensor to provide feedback after a movement, saving a lot of hardware and effort in the process.

Naturally, this is the optimal case, and there are a wide number of different stepper motor configurations in terms of coil count,  types of rotors and internal wiring of the coils, as well as complications such as skipped steps due to mechanical or driver issues. Despite this, in general stepper motors are quite reliable, and extremely versatile. As a result they can be found just about anywhere where accurate, step-based movement is desirable, such as (3D) printers and robotics.

For each application the right type of stepper motor and driving circuit has to be determined, of course, as they also have many reasons why you’d not want to use them, or just a particular type. When diving into a new stepper motor-based project, exactly what are the considerations to pay attention to?

Continue reading “One Small Step: All About Stepper Motors”

Sony Vaio Revived: How Does One Start?

A long-term project of mine is the the Sony Vaio new mainboard project. A year ago, I used it as an example to show you the cool new feature in KiCad 8, known as “background bitmaps”.

There are a heap of cool aspects to this specific Sony Vaio. It’s outrageously cute and purse-sized, the keyboard is nice enough for typing, motherboard schematics are available (very important!), and it’s not too terribly expensive. Of course, the most motivating aspect is that I happen to own one, its mainboard is not in the best state, and I’ve been itching to make it work.

It turned out to be a pretty complicated project, and, there was plenty to learn – way more than I expected in the beginning, too. I’m happy to announce that my v1 PCB design has been working wonders so far, and there are only a few small parts of it left untested.

I know that some of you might be looking to rebuild a lovely little computer of your choice. Hell, this particular laptop has had someone else rebuild it into a Pi-powered handheld years ago, as evidenced by this majestic “mess of wires” imgur build log! In honor of every hacker who has gotten their own almost-finished piece of hardware waiting for them half-assembled on the shelf, inside a KiCad file, or just inside your mind for now, let’s go through the tricks and decisions that helped make my board real.

Continue reading “Sony Vaio Revived: How Does One Start?”