Programming Ada: First Steps On The Desktop

Who doesn’t want to use a programming language that is designed to be reliable, straightforward to learn and also happens to be certified for everything from avionics to rockets and ICBMs? Despite Ada’s strong roots and impressive legacy, it has the reputation among the average hobbyist of being ‘complicated’ and ‘obscure’, yet this couldn’t be further from the truth, as previously explained. In fact, anyone who has some or even no programming experience can learn Ada, as the very premise of Ada is that it removes complexity and ambiguity from programming.

In this first part of a series, we will be looking at getting up and running with a basic desktop development environment on Windows and Linux, and run through some Ada code that gets one familiarized with the syntax and basic principles of the Ada syntax. As for the used Ada version, we will be targeting Ada 2012, as the newer Ada 2022 standard was only just approved in 2023 and doesn’t change anything significant for our purposes.

Continue reading “Programming Ada: First Steps On The Desktop”

It’s About Time

I’m pretty good with time zones. After all, I live in Germany, Hackaday’s server is in Los Angeles, and our writers are scattered all over the globe. I’m always translating one time into another, and practice makes (nearly) perfect. But still, it got me.

I was in the states visiting my parents, when Daylight Saving Time struck, but only in the USA. Now all my time conversions were off by an hour, and once I’d worked through the way the sun travels around the globe, I thought I had it made. And then my cell phone started reporting a time that was neither CEST nor EDT, but a third time zone that was an hour off. Apparently some cell towers don’t transmit time zone information, and my phone defaults to UTC. Who knew? For a short while, my phone lied to me, the microwave oven clock in the hotel lied to me, and I felt like I was going nuts.

But this all got me thinking about clocks and human time, and possibly the best advice I’ve ever heard for handling it in your own programs. Always keep time in something sensible like UNIX time – seconds elapsed since an epoch – because you don’t have to worry about anything more than adding one to a counter every second. When and if you need to convert to or from human times, you can write the function to do that simply enough, if you don’t already have a library function to do so.

Want to set an alarm for 2 hours from now? That’s easy, because you only need to add 7,200 seconds, and you don’t need to worry about 59 wrapping around to 0 or 23:59 to 0:00. Time math is easy in seconds. February 29th? That’s just another 86,400 seconds. It’s only us humans who make it complicated.

Paged Out! Releases Long-Awaited Third Issue

We’re happy to pass along word that Paged Out! has finally released Issue #3. This online zine covers a wide array of technical topics, from software development to hardware hacking, computer security, and electronics.

It’s distributed as a PDF, and is notable for its somewhat experimental format that limits each article to a single page. The first two issues were released back in 2019, but between a global pandemic and some administrative shuffling, progress on the current release was slowed considerably.

Among the 50 articles that make up the third Paged Out! there are a number of pieces focusing on hardware, such as the serial communications “cheat sheet” from [Jay Greco], and a pair of articles covering the state-of-the-art in custom keyboards. But overall the zine does lean hard into programming topics, and is probably best suited for those with an interest in software development and infosec.

Still, the line between hardware and software is getting blurrier all the time, so we’re sure you can find something in Paged Out! that should interest you no matter which side of the fence you’re on. Here’s hoping the time between releases can be reduced a bit for Issue #4.

Switching Converter For EEPROM Programmer Taxes Solderless Breadboard

We all know that solderless breadboards have their limitations. All that stray capacitance can play hell with circuits, especially high-speed stuff, but they’re so darn useful that avoiding them in favor of some other prototyping method can be really hard. So we often just forge ahead, plugging in our parts and hoping for the best

A recent veteran of the breadboard battle is [Anders Nielsen], who kicked off a new project by prototyping this high-voltage boost converter on a breadboard, with mixed results. The project is a scratch-built programmer for old-school ROM chips, a task normally farmed out to a dedicated programmer, but where’s the sport in that? Besides, this is the future, and generating the 12 to 14 volts needed should be a snap. And it would be, except for the fact that his chosen chip, a MIC2288 switching boost regulator, is only available in an SMD package. Getting the chip and a few other SMD support components onto breadboard-compatible breakouts proved to be challenging, and getting it working once it was there was even more work.

A lot of the trouble was down to simple breadboarding errors, but the big problem was the input capacitance, which [Anders] had to fiddle with quite a bit to get the converter to 14 volts. The current maxes out at about 25 mA before the voltage starts dropping, which just might be enough to burn those old chips, so we’ll call this a provisional win and see what happens when he builds the rest of the programmer.

[Anders]’ experience here raises a good question: what’s the best way to prototype using fussy SMD components? PCBs are cheap enough that it’s tempting to go straight to one, but swapping parts in and out like he had to do here to get everything just right would be much harder that way. We’re not sure we know the answer, but we’re pretty sure we’ll hear your thoughts on that in the comments section.

Continue reading “Switching Converter For EEPROM Programmer Taxes Solderless Breadboard”

Wio Terminal Makes Passable Oscilloscope

There was a time when getting a good oscilloscope not only involved a large outlay of capital, but also required substantial real estate on a workbench. The situation has improved considerably for the hobbyist, but a “real” scope can still cost more than what a beginner is looking to spend. Luckily, plenty of modern microcontrollers are capable of acting as a basic oscilloscope in a pinch, provided there’s a display available to interface with it. Combined with the right software, the Wio Terminal looks like a promising option.

The Wio Terminal is a platform gaining some popularity due to its fairly capable SAMD51 microcontroller and also its integration with a display and a number of input buttons. On the hardware side, [mircemk] mounted the Terminal in a convenient vertical orientation and broke out a pair of connectors for the inputs.

But it’s the software that really makes this project work. [Play With Microcontroller] originally developed the firmware for the PIC24 back in 2017, but ported the code over to the Wio Terminal a couple years back. Noting that the microcontroller is not particularly fast, the project doesn’t exactly match the specifications or capabilities of a commercial unit. But still, it does an impressive job of recreating the experience of using a modern digital scope

The Wio Terminal is a device we’ve seen around here for a few unique projects, among them a device for preventing repetitive strain injuries while using a computer mouse and another that is a guide for game development in MicroPython. And if you’re just itching to port oscilloscope software to accessible but under-powered microcontrollers, be sure to check out [mircemk]’s other oscilloscope projects like this one built around the STM32 microcontroller.

Continue reading “Wio Terminal Makes Passable Oscilloscope”

Humble Arduino As PLC

On the surface, a programmable logic controller (PLC) might seem like nothing more than a generic microcontroller, perhaps outfitted to operate in industrial settings with things like high temperatures or harsh vibrations. While this is true to some extent, PLCs also have an international standard for their architecture and programming languages. This standard is maintained by the International Electrotechnical Commission, making it so that any device built under these specifications will be recognizable to control engineers and maintenance personnel worldwide. And, if you use this standard when working with certain Arduinos, this common platform can become a standard-compliant PLC as well.

The IDE itself supports programming ladder diagrams, functional block diagrams, and other programming systems covered under the IEC 61131-3 standard. Not only that, it allows the combination of these types of PLC programming with Arduino sketches. The system offers many of the perks of PLC programming alongside the familiar Arduino platform, and supports a number of protocols as well including CANOpen, Modbus RTU, and Modbus TCP. It can also be used for monitoring a PLC system, essentially adding IoT capabilities to existing systems, enabling continuous monitoring, debugging, and program updates.

While not every Arduino is a great platform to build a PLC around, there are a few available for those looking for a system a little less proprietary and a little more user-friendly than typical PLC systems tend to be. There’s a reason that PLCs are built around an international standard and generally have certain hardware in mind to run it, though, and this comparison of a Raspberry Pi with an off-the-shelf PLC goes into detail about why certain components aren’t good choices for PLCs.

Building A Weather Display In Rust

We’ve seen a lot of weather displays over the years, and plenty of the more modern ones have been using some form of electronic paper. So what makes this particular build from [Harry Stern] different? The fact that the firmware running on the ESP32 microcontroller at its heart was developed in Rust.

The weather station itself is capable of operating for several months on its rechargeable NiMH battery bank. The Rust section of the project is in two parts, the first of which runs on a server which downloads the weather data and aggregates it into an image. The second part runs on the ESP32 using esp-idf which configures peripherals, turns on and connects to Wi-Fi, retrieves the image from the server, displays the image and then puts the display to sleep. By doing the heavy lifting on the server, the display should be able to run for longer than it would if everything was happening on the ESP32.

The project code is available from this GitHub page which should allow even Rust beginners to follow along, and the case file is also available for those with a 3D printer. [Harry] has a few upgrades planned for future releases as well, including a snap-fit case, a custom PCB, and improved voltage regulator for better battery life, and enhanced error handling for the weather API. And Rust isn’t the only interesting part of this project, either. As prices for e-paper displays continue to fall, more and more of them are found in projects like weather stations and even complete laptops which use these displays exclusively.