A 6502 All In The Data

Emulating a 6502 shouldn’t be that hard on a modern computer. Maybe that’s why [lasect] decided to make it a bit harder. The PG_6502 emulator uses PostgreSQL. All the CPU resources are database tables, and all opcodes are stored procedures. Huh.

The database is pretty simple. The pg6502.cpu table has a single row that holds the registers. Then there is a pg6502.mem table that has 64K rows, each representing a byte. There’s also a pg6502.opcode_table that stores information about each instruction. For example, the 0xA9 opcode is an immediate LDA and requires two bytes.

The pg6502.op_lda procedure grabs that information and updates the tables appropriately. In particular, it will load the next byte, increment the program counter, set the accumulator, and update the flags.

Honestly, we’ve wondered why more people don’t use databases instead of the file system for structured data but, for us, this may be a bit much. Still, it is undoubtedly unique, and if you read SQL, you have to admit the logic is quite clear.

We can’t throw stones. We’ve been known to do horrible emulators in spreadsheets, which is arguably an even worse idea. We aren’t the only ones.

Your Own Tool Changer

All the cool new 3D printers have tool-changing heads. Instead of multiplexing filament through one hot end, you simply park one hot end and pick up another. Or pick up a different tool, depending on what you need. There are many advantages to a system like that, but one disadvantage: cost. [Ultimate Tool Changer] has been working on a design for what he calls a simple, cheap changer, and it appears to be working well, as you can see in the video below.

This is one of those things that seems easy until you try to do it. He talks about a lot of the failures and dead ends along the way.

Continue reading “Your Own Tool Changer”

Skylab Under The Ocean

A crew lives on a station in a hostile environment. Leaving that environment requires oxygen tanks and specialized gear to deal with pressure differentials. A space station? Nah. A base built on the ocean floor. The US Navy was interested in such a base in the 1960s, and bases like this are a staple of science fiction. But today, we see more space stations than underwater bases. Have you ever wondered why?

Diving deep underwater is a tricky business. At a certain depth, the pressure forces gas like nitrogen to dissolve into your body. By itself, this isn’t a problem, but when you ascend, it is a big problem. If the gas all comes out at the same time, you get bubbles, which can cause decompression sickness, commonly called the bends. The exact problems vary, but the bends often cause extreme joint pain, fatigue, or a rash. Sometimes people die.

While you think of the bends as a deep-sea diver’s problem, it can also happen in airplanes and outer space. Any time you go from high pressure to low pressure quickly, you are subject to decompression sickness. Depending on what you are doing, there are different ways to mitigate the problem. For diving, traditionally, you simply don’t surface too quickly.

You dive, do your work, and then head towards the surface, stopping at preset stops to let the pressure equalize gradually. Physics is a bear, though. The longer you stay at a given depth, the longer you have to decompress.

That means you rapidly reach a point of diminishing returns. Suppose you dive to the ocean floor. You spend an hour working. Then you have to spend, say, eight hours gradually rising to the surface. That makes extended operations at significant depth impractical.

George Bond was thinking about all this and had an interesting idea. It is true that, in general, the longer you stay down, the more gas your body absorbs. But it is also true that, eventually, your tissues saturate, and then you don’t absorb any more.

Continue reading “Skylab Under The Ocean”

Passive Radar Explained

It is an old trope in submarine movies. A sonar operator strains to hear things in the ocean but dares not “ping” for fear of giving away the boat’s location. Radar has a similar problem. If you want to find an airplane, for example, you typically send a signal out and wait for it to bounce off the airplane. The downside is that the airplane now knows exactly where your antenna is and, these days, may be carrying missiles to home in on it. In a recent post, [Jehan] explains how radar, like sonar, can be passive.

Even if you aren’t worried about a radar-homing missile taking out your antenna, passive radar has other advantages. You don’t need an expensive transmitter or antenna, a simple SDR can pull it off. You don’t need a license for the frequencies you want to use, either. You are just listening.

Continue reading “Passive Radar Explained”

Kiki Is The Unknown Array Language

Kiki bills itself as the “array programming system of unknown origin.” We thought it reminded us of APL which, all by itself, isn’t a bad thing.

The announcement post is decidedly imaginative. However, it is a bit sparse on details. So once you’ve read through it, you’ll want to check out the playground, which is also very artistically styled.

If you explore the top bar, you’ll find the learn button is especially helpful, although the ref and idiom buttons are also useful. Then you’ll find some examples along with a few other interesting tidbits.

Continue reading “Kiki Is The Unknown Array Language”

Authenticate SSH With Your TPM

You probably don’t think about it much, but your PC probably has a TPM or Trusted Platform Module. Windows 11 requires one, and most often, it stores keys to validate your boot process. Most people use it for that, and nothing else. However, it is, in reality, a perfectly good hardware token. It can store secret data in a way that is very difficult to hack. Even you can’t export your own secrets from the TPM. [Remy] shows us how to store your SSH keys right on your TPM device.

Continue reading “Authenticate SSH With Your TPM”

Using Metal Screws In Plastic Parts

Machine screws aren’t made for wood or sheet metal, they make specific screws for those applications. You probably also know there are special screws for plastic. But did you know there are at least two distinct types? In a recent video, [Lost in Tech] show us different types of plastic screws, including thermal camera shots of screws driving into 3D printed parts, along with tests using a torque driver.

We have often used “any old” screw in printed parts, which usually works OK. We’ve also used threaded inserts or captive nuts, classic choices. One of the issues with screws or inserts is that you have to get accurately sized holes in your 3D prints.

In addition to learning about the types of screws and how best to accommodate them, he also developed a free web-based tool that does all the math for you.

Of course, there are cases when you do need a threaded insert. In particular, the plastic screws will tend to wear the plastic each time you insert them. If you expect the screw to go in and out many times, this might not be the right technique for you. On the other hand, if you think you might remove and replace the screws a few dozen times over the life of the part, this might be attractive.

We’ve covered self-tapping screws in plastic before, but, as the video shows, not all of them are created equal. And, of course, there are always heat-set inserts.

Continue reading “Using Metal Screws In Plastic Parts”