Gdbdiff: Diff-ing A Real RP2040 MCU Against An Emulated MCU

What to do when developing an RP2040 emulator but validating the emulator instruction by instruction is a slow and tedious process? Why, automatically compare it against the real hardware if you’re [Uri Shaked], of course. This is the purpose of gdbdiff. This project uses the GDB remote serial protocol via OpenOCD to run test firmware step by step.

During a livestream (video linked via the above link), this allowed [Uri] to find a number of instruction bugs in the emulator this way. These issues involved issues such as incorrect flags in the APSR register and an edge case in the LSRS register. This gdbdiff livestream is part of an entire series of live-coding sessions during which [Uri] writes an RP2040 emulator from scratch.

We applaud [Uri] for creative thinking here, and assume that this way the livestream was probably more entertaining to watch than when doing instruction-level debugging purely by hand :)

Fueling Up For Fusion: MAST’s Super-X, JET’s Deuterium-Tritium Experiments For ITER, And More

We’ve had nuclear fission reactors in operation all over the world for ages, but nuclear fusion always seems to be a decade or two away. While one cannot predict when we’ll reach the goal of sustained nuclear fusion, the cutting edge in test hardware is advancing at a rapid pace that makes us optimistic. Beginning as soon as this month and extending over a few years, we’re living through a very exciting time for nuclear fusion and plasma physics.

The Mega Ampere Spherical Tokamak (MAST) got a big upgrade to test a new cooled divertor design. JET (Joint European Torus) will be testing the deuterium-tritium fuel mixture that will be powering the ITER (the research project whose name began as an acronym for International Thermonuclear Experimental Reactor but has since been changed to just ITER). And the Wendelstein 7-X stellarator is coming back online with upgraded cooled divertors by next year.

Here the MAST Upgrade’s Super-X divertors have so far shown a ten-fold decrease in the temperature which the divertor is exposed to while carrying thermal energy out of the tokamak reactor. This means a divertor design and ultimately a fusion reactor that will last longer between maintenance sessions. On the stellarator side of things, Wendelstein 7-X’s new divertors may allow it to demonstrate the first continuous operation of a stellarator fusion reactor. Meanwhile, JET’s fuel experiments should allow us to test the deuterium-tritium fuel while ITER is working towards first plasma by 2025.

Continue reading “Fueling Up For Fusion: MAST’s Super-X, JET’s Deuterium-Tritium Experiments For ITER, And More”

Adding Remote Controls To A Blackmagic Studio Camera Without Breaking The Bank

What to do when one ends up in the possession of a 4K studio camera, but without the requisite hardware and software to remotely control it? When [Glen Akins] ended up in this situation, he took the reasonable option here and developed his own knob-based remote control to adjust exposure and focus on the Blackmagic Designs Micro Studio Camera 4K. Without a remote control option, the only adjustment options are via fiddly small buttons on the camera itself, which wouldn’t have been a fun experience during the webcam usage that this camera would be used for.

This camera is normally controlled via the control channel on the SDI input which also handles the video output from the camera. For larger installations the proprietary ATEM software is commonly used, and there’s a $99 Arduino expansion board as well that’s apparently rarely stocked. With SDI not an option, the second option was LANC, which runs into pretty much the same issue with proprietary protocols and very expensive hardware.

Behind door number three is the more curious control option of the Futaba S.BUS protocol. Originally created for remotely controlling radio-controlled aircraft and similar remotely controlled systems, the thought here appears to be that this studio camera can also be used with systems that already have an S.BUS receiver, such as large drones.

With this S.BUS protocol having been reverse-engineered for a while now, it was a fairly straightforward procedure from there to create an MCU-based board with a lot of encoder knobs on it that map to a specific adjustment on the camera. The result of [Glen]’s labor can be found on GitHub.

Main image: The finished knob-box with the Blackmagic Designs camera. (Credit: Glen Akins)

Linus Åkesson’s ‘A Mind Is Born’ Commodore 64 Demo In Just 256 Bytes

It would be an understatement to say that the Commodore 64 demo scene is quite amazing. For those who are unaware, a ‘demo’ in this context is essentially a technological demonstration. Usually to show off particular effects or other (visual) properties that either push the limits of the platform on which it is being run, or use its hardware in a special fashion.  In the case of [Linus Åkesson]’s A Mind Is Born demo, the challenge was to do as much as possible in 256 bytes, while providing an audiovisual experience.

Although at first glance 256 bytes may sound like a lot to work with, this code has to generate the entire melody that is output via the Commodore 64’s SID audio chip, while simultaneously generating an attractive visual pattern. This is quite an undertaking, as the video capture of the result (included after the break) makes clear. The secret sauce here is to make use of the C64’s SID audio & VIC-II video chips.

Driven by a 60 Hz timer interrupt, the three voices of the SID are used to play the kick drum and bass, melody and drone respectively, creating the 64 total bars of the music using a linear-feedback shift register (LFSR). This means that the melody is in a sense randomly generated, but deterministically enough to sound pleasing to the human ear.

For the visual side, the C64 runs in Extended Character Mode, using fonts along with a background color to create interesting patterns using what is essentially a cellular automaton algorithm. While there are some visual glitches due overwriting of video data, and a race condition, these end up adding to the charm. The resulting audio track is pretty catchy too, and absolutely worthy of a listen.

Thanks for the tip, Johannes!

(That banner image?  That _is_ the whole code.)

Continue reading “Linus Åkesson’s ‘A Mind Is Born’ Commodore 64 Demo In Just 256 Bytes”

Raspberry Pi RP2040: Hands-On Experiences From An STM32 Perspective

The release of the Raspberry Pi Foundation’s Raspberry Pi Pico board with RP2040 microcontroller has made big waves these past months in the maker community. Many have demonstrated how especially the two Programmable I/O (PIO) state machine peripherals can be used to create DVI video generators and other digital peripherals.

Alongside this excitement, it raises the question of whether any of this will cause any major upheaval for those of us using STM32, SAM and other Cortex-M based MCUs. Would the RP2040 perhaps be a valid option for some of our projects? With the RP2040 being a dual Cortex-M0+ processor MCU, it seems only fair to put it toe to toe with the offerings from one of the current heavyweights in the 32-bit ARM MCU space: ST Microelectronics.

Did the Raspberry Pi Foundation pipsqueak manage to show ST’s engineers how it’s done, or should the former revisit some of their assumptions? And just how hard is it going to be to port low-level code from STM32 to RP2040? Continue reading “Raspberry Pi RP2040: Hands-On Experiences From An STM32 Perspective”

Increased Neutron Levels At Chernobyl-4: How Dangerous Is Corium?

When the Chernobyl nuclear plant suffered the power output surge that would destroy its #4 reactor, a substance called ‘corium‘ was formed. This originally lava-like substance formed out of the destroyed fuel rods along with surrounding materials, like concrete, that made up the reactor. The corium ultimately cooled down and left large amounts of solid corium in the rooms where it had pooled.

Over the past few days there have been numerous reports in the media regarding a ‘sudden surge’ in neutron flux levels from this corium, with some predicting a ‘second Chernobyl disaster’. Obviously, this has quite a few people alarmed, but how dire are these neutron output changes exactly, and what do they tell us about the condition of the corium inside the ruins of the #4 reactor building? Continue reading “Increased Neutron Levels At Chernobyl-4: How Dangerous Is Corium?”

The Coffee Must Flow: Replacing A Spent Lithium Cell In A Coffee Machine

When [hacky] bought a used Douwe Egberts Gallery 200 all-in-one coffee maker, the machine was known to have a ’empty battery’. Being one of those fancy coffee makers that handle everything from the grinding of coffee beans to the application of hot water and steam, it relies on instructions for each coffee recipe. Unfortunately, it turns out that this machine stores these on battery-backed SRAM, as [hacky] found out with help from friendly folk over at the Dutch Tweakers forum.

The Douwe Egberts Gallery 200 is a rebranded machine that’s also sold in Scandinavia as the Wittenborg FB 5100. These machines have an ST M48T58 TimeKeeper module that combines 8 kB of persistent SRAM with a real-time clock. Being powered from a single coin cell (lithium carbon monofluoride chemistry), their lifespan is limited.

Replacing the coin cell in an M48T58 TimeKeeper module with AA cells.

Fortunatley, a DE-9 connector is provided on the back to provide service/maintenance access to to the hardware. Using a conveniently available programming guide for the hardware, it was easy to figure out the pinout and baud rate (9600, 8 bit, ignore parity, no flow control). This allows for reprogramming the SRAM, but without replacing the battery this data would be gone again on the next start.

Based on the ST M48T58 datasheet, it’s not clear that the clip-on module containing the coin cell and crystal can be replaced, though one could simply plug in a new M48T58 module. Or, as [hacky] did, it’s also possible to cut open the ‘SNAPHAT’ top section and wire in a replacement battery module. With two 1.5V AA cells providing the 3V to the module, it was operational again.

Next up: working out what to write to the SRAM to make the coffee flow again.