Diagram of C99 designated initializers.

Tips For C Programming From Nic Barker

If you’re going to be a hacker, learning C is a rite of passage. If you don’t have much experience with C, or if your experience is out of date, you very well may benefit from hearing [Nic Barker] explain tips for C programming.

In his introduction he notes that C, invented in the 70s by Dennis Ritchie, is now more than 50 years old. This old language still appears in lists of the most popular languages, although admittedly not at the top!

He notes that the major versions of C, named for the year they were released, are: C89, C99, C11, and C23. His recommendation is C99 because it has some features he doesn’t want to live without, particularly scoped variables and initializing structs with named members using designated initializers. Also C89 is plagued with non-standard integer types, and this is fixed by stdint.h in C99. Other niceties of C99 include compound literals and // for single-line comments.

Continue reading “Tips For C Programming From Nic Barker”

A photo of the front-panel with a bunch of lamps and knobs.

The Making Of A Minimalist Analog Drum Machine

Our hacker [Moritz Klein] shows us how to make a minimalist analog drum machine. If you want the gory details check out the video embedded below and there is a first class write-up available as a 78 page PDF manual too. Indeed it has been a while since we have seen a project which was this well documented.

A typical drum machine will have many buttons and LEDs and is usually implemented with a microcontroller. In this project [Moritz] eschews that complexity and comes up with an analog solution using a few integrated circuits, LEDs, and buttons.

The heart of the build are the integrated circuits which include two TL074 quad op amps, a TL072 dual op amp, a CD4520 binary counter, and eight CD4015 shift registers. Fifteen switches and buttons are used along with seven LEDs. And speaking of LEDs, our hacker [Moritz] seems to have an LED schematic symbol tattooed to his hand, and we don’t know about you, but this screams credibility to us! :)

Continue reading “The Making Of A Minimalist Analog Drum Machine”

Moondream title with man's face visible in background.

Using Moondream AI To Make Your Pi “See” Like A Human

[Jaryd] from Core Electronics shows us human-like computer vision with Moondream on the Pi 5.

Using the Moondream visual language model, which runs directly on your Raspberry Pi, and not in the cloud, you can answer questions such as “are the clothes on the line?”, “is there a package on the porch?”, “did I leave the fridge open?”, or “is the dog on the bed?” [Jaryd] compares Moondream to an alternative visual AI system, You Only Look Once (YOLO).

Processing a question with Moondream on your Pi can take anywhere from just a few moments to 90 seconds, depending on the model used and the nature of the question. Moondream comes in two varieties, based on size, one is two billion parameters and the other five hundred million parameters. The larger model is more capable and more accurate, but it has a longer processing time — the fastest possible response time coming in at about 22 to 25 seconds. The smaller model is faster, about 8 to 10 seconds, but as you might expect its results are not as good. Indeed, [Jaryd] says the answers can be infuriatingly bad.

In the write-up, [Jaryd] runs you through how to use Moonbeam on your Pi 5 and the video (embedded below) shows it in action. Fair warning though, Moondream is quite RAM intensive so you will need at least 8 GB of memory in your Pi if you want to play along.

If you’re interested in machine vision you might also like to check out Machine Vision Automates Trainspotting With Unique Full-Length Portraits.

Continue reading “Using Moondream AI To Make Your Pi “See” Like A Human”

Photo of the Haasoscope Pro

Haasoscope Pro: Open-Everything 2 GHz USB Oscilloscope

Our hacker [haas] is at it again with the Haasoscope Pro, a full redesign of the original Haasoscope, which was a successful Crowd Supply campaign back in 2018.

This new Pro version was funded on Crowd Supply in April this year and increases the bandwidth from 60 MHz to 2 GHz, the vertical resolution from 8 to 12 bits, and the sample rate from 125 MS/s to 3.2 GS/s. Selling for $999 it claims to be the first open-everything, affordable, high-bandwidth, real-time sampling USB oscilloscope.

The firmware and software are under active development and a new version was released yesterday.

Continue reading “Haasoscope Pro: Open-Everything 2 GHz USB Oscilloscope”

A photo of the internal wiring.

Imagining The CPS-1: An Early 70s 4-bit Microcomputer From Canada

[Michael Gardi] wrote in to let us know about his project: CPS-1: Imagining An Early 70s 4-bit Microcomputer.

The CPS-1 was the first Canadian microprocessor-based computer. It was built by Microsystems International Ltd. (MIL) in Ottawa between 1972 and 1973 and it is unknown how many were made and in what configurations. The CPS-1 supported a 12-bit address bus and a 4-bit data bus. MIL also developed the supporting hardware including RAM. The processor was called the MIL 7114.

[Michael] worked in collaboration with [Zbigniew Stachniak] from York University Computer Museum. [Zbigniew] had developed a MIL CPS-1 Emulator and [Michael]’s job was to implement a front panel hardware interface for the emulator which runs on a Raspberry Pi. The only complication: there are no remaining CPS-1 computers, and no known photographs, so no one can say for sure what a real front panel might have looked like!

With a bit of guess work and 3D printing, as well as some inspiration from contemporaneous hardware such as the DEC PDP-11, [Michael] came up with an implementation. He used an IO extender HAT which adds 32 IO pins to the existing Pi GPIO pins that are accessible via an 3-wire I2C interface. This was enough hardware to support the 26 switches and 29 LEDs on the panel. There’s a brief demo of the custom printed switches in the video embedded below.

If you’re interested in old school 4-bit tech you might also like to check out 4-bit Single Board Computer Based On The Intel 4004 Microprocessor.

Continue reading “Imagining The CPS-1: An Early 70s 4-bit Microcomputer From Canada”

Photo of Microtronic 2090

The Microtronic Phoenix Computer System

A team of hackers, [Jason T. Jacques], [Decle], and [Michael A. Wessel], have collaborated to deliver the Microtronic Phoenix Computer System.

In 1981 the Busch 2090 Microtronic Computer System was released. It had a 4-bit Texas Instruments TMS1600 microcontroller, ran at 500 kHz, and had 576 bytes of RAM and 4,096 bytes of ROM. The Microtronic Phoenix computer system is a Microtronic emulator. It can run the original firmware from 1981.

Between them the team members developed the firmware ROM dumping technology, created a TMS1xxx disassembler and emulator, prototyped the hardware, developed an Arduino-based re-implementation of the Microtronic, designed the PCB, and integrated the software.

Unlike previous hardware emulators, the Phoenix emulator is the first emulator that is not only a re-implementation of the Microtronic, but actually runs the original TMS1600 firmware. This wasn’t possible until the team could successfully dump the original ROM, an activity that proved challenging, but they got there in the end! If you’re interested in the gory technical details those are here: Disassembling the Microtronic 2090, and here: Microtronic Firmware ROM Archaeology. Continue reading “The Microtronic Phoenix Computer System”

The schematic on the left and the assembled circuit on the right.

How To Make A Simple MOSFET Tester

Over on YouTube our hacker [VIP Love Secretary] shows us how to make a simple MOSFET tester.

This is a really neat, useful, elegant, and simple hack, but the video is kind of terrible. We found that the voice-over constantly saying “right?” and “look!” seriously drove us to distraction. But this is a circuit which you should know about so maybe do what we did and watch the video with subtitles on and audio off.

To use this circuit you install the MOSFET you want to test and then press with your finger the spare leg of each of two diodes; in the final build there are some metal touch pads attached to the diodes to facilitate this. One diode will turn the MOSFET off, the other diode will turn the MOSFET on, and the LED will show you which is which.

Continue reading “How To Make A Simple MOSFET Tester”