Bare-Metal STM32: Setting Up And Using SPI

The Serial Peripheral Interface (SPI) interface was initially standardized by Motorola in 1979 for short-distance communication in embedded systems. In its most common four-wire configuration, full-duplex data transfer is possible on the two data (MOSI, MISO) lines with data rates well exceeding 10 Mb/s. This makes SPI suitable for high-bandwidth, full-duplex applications like SD storage cards and large resolution, high-refresh displays.

STM32 devices come with a variable number of SPI peripherals, two in the F042 at 18 Mb/s and five in the F411. Across the STM32 families, the SPI peripheral is relatively similar, with fairly minor differences in the register layout. In this article we’ll look at configuring an SPI peripheral in master mode.

Continue reading “Bare-Metal STM32: Setting Up And Using SPI”

Hacking Developers With A Cat Feeder: Who’s A Good Kitty?

Most of us probably know the drudgery of getting through some coding work, with just tedious hours of monkeying around stretching ahead of us. What if this tedium were to be interrupted by an occasional reward when we did something productive, like pushing a commit or other measure of progress? That’s roughly the concept that [John Partee] started off with when his gaze fell upon one of those automated cat feeders. Cat or developer, who doesn’t like to hear the tinkle of a tasty treat falling into their bowl?

The target pet feeder is a PetKit Fresh Element Solo, which allows for objects with a size of 12×12 mm (any orientation) to be fed through the feeding mechanism. Fortunately [John]’s favorite dark chocolate-covered almonds treat fit these requirements, and he set to work to figure out the REST API call needed to trigger a manual feeding event on the cat feeder device, employing the existing PyPetKit Python library that does the heavy lifting of connecting to and communicating with PetKit’s servers, as the feeder is of course an IoT device.

This means that the event flow still depends on PetKit’s “cloud”, which may inspire some enterprising hackers to make a stand-alone version, the development of which may be assisted by [John]’s solution through a regular treat. Before taking such a solution into use, be sure to discuss it with any pets you have, as they may not quite comprehend why there’s no reward for them whenever the *tinkle* sound occurs.

Continue reading “Hacking Developers With A Cat Feeder: Who’s A Good Kitty?”

Leading Edge Erosion: When Precipitation Destroys Wind Turbine Blades

Erosion is all around us, from the meandering course of rivers and other waterways, to the gradual carving out of channels in even the toughest mountains, and the softening of features in statues. Yet generally we expect erosion from precipitation to be gradual and gentle, taking decades to make a noticeable difference. This of course takes into account gentle flows and the soft pitter-patter of rain on stone, not turbine blades passing through the air at many times the terminal velocity of rain drops of up to 9 m/s.

As wind turbines have increased in size and diameter of their blades, this has noticeably increased the speed of especially the blade tips. With more and more wind turbine blade tips now exceeding speeds of 100 m/s, this has also meant a significant increase in the impact of rain drops, hail and other particulates on the lifespan of these turbine blades. As comparison, 100 m/s is 360 km/h (224 mph), which is only slightly slower than the top speed of a Formula 1 car.

The effect of turbine blade leading edge erosion (LEE) not only decreases aerodynamic efficiency, but also invites premature failure. Over the past years, special coatings and leading edge tapes have been developed that act as sacrificial surfaces, but as wind turbines only keep getting larger, so does the effect of LEE. Beyond simply replacing LE tape every year on every turbine, what other options are there?

Continue reading “Leading Edge Erosion: When Precipitation Destroys Wind Turbine Blades”

Intranasal Vaccines: A Potential Off-Ramp For Coronavirus Pandemics

An interesting and also annoying aspect about the human immune system is that it is not a neat, centralized system where you input an antigen pattern in one spot and suddenly every T and B lymphocyte in the body knows how to target an intruder. Generally, immunity stays confined to specific areas, such as the vascular and lymph system, as well as the intestinal and mucosal (nasal) parts of the body.

The result of this is that specific types of vaccines have a different effect, as is demonstrated quite succinctly with the polio vaccines. The main difference between the oral polio vaccine (OPV) and inactivated vaccine (injected polio vaccine, or IPV) is that the former uses a weakened virus that induces strong immunity in the intestines, something that the latter does not. The effect of this is that while both protect the individual, it does not affect the fecal-oral infection route of the polio virus and thus the community spread.

The best outcome for a vaccine is when it both protects the individual, while also preventing further infections as part of so-called sterilizing immunity. This latter property is what makes the OPV vaccine so attractive, as it prevents community spread, while IPV is sufficient later on, as part of routine vaccinations. The decision to use a vaccine like the OPV versus the IPV is one of the ways doctors can tune a population’s protection against a disease.

This is where the current batch of commonly used SARS-CoV-2 vaccines are showing a major issue, as they do not provide significant immunity in the nasal passage’s mucosal tissues, even though this is where the virus initially infects a host, as well as where it replicates and infects others from. Here intranasal vaccines may achieve what OPV did for polio.

Continue reading “Intranasal Vaccines: A Potential Off-Ramp For Coronavirus Pandemics”

Sappers clearing the last mines from the beach front of a former French luxury hotel, now in use as a rest club for troops of 3rd Division, 15 July 1944.

The Long Tail Of War: Finding Unexploded Ordnance Before It Finds Us

Long after the enemy forces have laid down their arms, peace accords have been signed and victories celebrated, there is still a heavy toll to be paid. Most of this comes in the form of unexploded ordnance, including landmines and the severe pollution from heavy metals and other contaminants that can make large areas risky to lethal to enter. Perhaps the most extreme example of this lasting effect is the Zone Rouge (Red Zone) in France, which immediately after the First World War came to a close comprised 1,200 square kilometers.

Within this zone, contamination with heavy metals is so heavy that some areas do not support life, while unexploded shells – some containing lethal gases – and other unexploded ordnance is found throughout the soil. To this day much of the original area remains off-limits, though injuries from old, but still very potent ordnance are common around its borders. Clean-up of the Zone Rouge is expected to take hundreds of years. Sadly, this a pattern that is repeated throughout much of the world. While European nations stumble over ordnance from its two world wars, nations in Africa, Asia and elsewhere struggle with the legacy from much more recent conflicts.

Currently, in Europe’s most recent battlefield, more mines are being laid, booby traps set and unexploded shells and other ordnance scattered where people used to live. Clearing these areas, to make them safe for a return of their inhabitants has already begun in Ukraine, but just like elsewhere in the world, it is an arduous and highly dangerous process with all too often lethal outcomes.

Continue reading “The Long Tail Of War: Finding Unexploded Ordnance Before It Finds Us”

Water drop on rose leaf.

Groundwater: Management Of A Much Neglected Lifeline

It seems obvious that if you dig or drill into the soil, at some point you will hit groundwater. Drill deep enough and you will reach an aquifer containing enormous amounts of fresh water. After this you can just pump water out of these wells and you will have fresh water aplenty. Or so was the thinking among many for the longest time. As enormous the fresh water reserves in the form of groundwater are – with most liquid fresh water being groundwater – we can literally empty them faster than that they’ll refill.

As the Dust Bowl disaster painfully showed in the 1930s and drought along with surface subsidence issues as in e.g. California’s Central Valley shows today is that we cannot simply use the soil and groundwater and expect no consequences. While the 19th century saw many fresh settlers to the West’s arid and semi-arid regions like California believe in the ‘Rain follows the plow‘ mysticism, the 20th century and these first few decades of the 21st century taught us that tilling the soil and drawing groundwater for irrigation does not change an arid climate into a lush one.

Perhaps ironically, even with increasing droughts, most human settlements use stormwater drainage and combined sewage systems to carry rainwater away, rather than letting the groundwater recharge naturally. Fortunately, more and more regions these days are seeing the necessity of managing groundwater.

Continue reading “Groundwater: Management Of A Much Neglected Lifeline”

Frank Drake’s Legacy, Or: Are We All Alone In The Universe?

When Frank Drake began his astronomy career in the late 1950s, this was an incredibly exciting time for the field. Humanity was beginning to unlock the secrets of the Universe using ever more powerful radio frequency and optical telescopes, including the tantalizing prospect of space-based telescopes. Amidst the ramping up Space Race between the US and USSR, there was an ever-growing excitement about humankind’s future among the stars.

As concrete plans for landings and colonies on the Moon, Venus and Mars were proposed and put into action, it also brought to the forefront many existing and new questions about humanity’s place in the Universe. During Frank Drake’s 92 years on planet Earth – until his passing on September 2nd of this year – he was one of the driving forces behind the search for extraterrestrial intelligence (SETI), along with other legends like Carl Sagan.

Although to the average person the acronym SETI is most likely to bring to mind popcorn movies about little grey – or green – men, Drake’s Project Ozma, as well as the SETI Institution and the ongoing Breakthrough Listen project are just some of the attempts made by Drake and his colleagues over the decades to answer that one question that may affect the very course of humankind’s future: are we alone in the Universe?

Continue reading “Frank Drake’s Legacy, Or: Are We All Alone In The Universe?”