Taking A Deep Dive Into SPI

With the prevalence of libraries, it has never been easier to communicate with hundreds of different sensors, displays, and submodules. But what is really happening when you type SPI.begin() into the Arduino IDE? In his most recent video, [Ben Eater] explores the Serial Peripheral Interface (SPI) and how it really works.

Most Hackaday readers probably know [Ben] from his breadboard-based computers, such as the 6502 build we featured in 2019. Since then he has been hard at work, adding new and interesting additions to his breadboard computer, as well as diving into different communication protocols to better understand and implement them. For this video, [Ben] set the goal of connecting the BME280, a common pressure, temperature, and humidity sensor with an SPI interface, to his breadboard 6502 computer. Along the way, [Ben] discusses how exactly SPI works, and why there is so much conflicting nomenclature and operations when looking at different SPI devices.

If breadboard computers aren’t your thing, there are tons of other uses for the BME280, such as helping to modernize a Casio F-91W.

Continue reading “Taking A Deep Dive Into SPI”

Diving Into The Details Of Keyboard Interfaces At The Gate-Level

Never doubt the value of a good teacher. Even if you know — or think you know — the material being presented, a good teacher can open your eyes to new ways of looking at things that will pay dividends you never expected.

That’s the feeling we got while watching [Ben Eater]’s latest video on building a keyboard interface (embedded below) for his breadboard 6502 computer. On the face of it, getting a keyboard to talk to a computer should be a simple job. [Ben] had previously looked at the serial protocol used by the old PS/2 keyboard and even built a wildly complex circuit out of discrete shift register chips to visualize the data being sent by the keyboard. The video below continues that work, this time concentrating on using the keyboard with his 6502 breadboard computer.

After some instructive preliminaries on interrupt programming, [Ben] dives into the logic-level details of teasing useful signals from the keyboard. His signal processing starts with some inverters and an RC network to turn multiple clock pulses into one logic level transition. Walking through this circuit step by step was the really interesting bit; even if you know that the answer is eventually going to be “Schmitt trigger,” getting to that point was really instructive.

Of course, what [Ben]’s videos mainly accomplish is making us want to follow along with him and build a breadboard computer of our own. From a low-rez VGA card to a reliable UART, following along with his discrete chip builds is always educational.

Continue reading “Diving Into The Details Of Keyboard Interfaces At The Gate-Level”

Breadboard Computer Plays Snake On Character Display; Also In A Browser!

If building a homebrew computer on a breadboard is your thing, you’re most certainly familiar with [Ben Eater], whose design of using nothing but logic gates has served as inspiration for many replicas over the years. [visrealm] took the concept and expanded upon it, even adding a 16×2 LCD that let’s you play Snake by moving a single pixel on the character display!

Making the most of tiny resolution is impressive — it’s a difficult constraint for the game field. But there are other tricks at work as well. [visrealm] uses different intensities to distinguish between the snake and its food which is kind of a dark pixel in the demo shown after the break. But what stands out most is that the breadboard build is really only half of the story. In addition, [visrealm] built an entire emulator that resembles his actual breadboard design, which can be programmed and used via browser, giving WebAssembly a whole new meaning. While that’s convenient for anyone interested to play around with these breadboard computers, but lacks the patience to build one themselves, it also functions as the real one’s programming environment. In addition, an ESP8266 is used to load a new program directly via WiFi.

All the code and some build notes are available on GitHub, and if you’re looking for a nifty LCD emulator for your web site, there’s a standalone repository for that as well. But in case you need a better display option for your own breadboard computer, how about adding a VGA connector? And if you don’t build your own yet, it’s never too late to start.

Continue reading “Breadboard Computer Plays Snake On Character Display; Also In A Browser!”

Low Res Video Card Is Still Amazing Since It’s Made Out Of Logic Chips

[Ben Eater] has been working on building computers on breadboards for a while now, alongside doing a few tutorials and guides as YouTube videos. A few enterprising hackers have already duplicated [Ben]’s efforts, but so far all of these builds are just a bunch of LEDs and switches. The next frontier is a video card, but one only capable of displaying thousands of pixels from circuitry built entirely on a breadboard.

This review begins with a review of VGA standards, eventually settling on an 800×600 resolution display with 60 MHz timing. The pixel clock of this video card is being clocked down from 40 MHz to 10 MHz, and the resulting display will have a resolution of 200×150. That’s good enough to display an image, but first [Ben] needs to get the horizontal timing right. This means a circuit to count pixels, and inject the front porch, sync pulse, and back porch at the end of each horizontal line.

To generate a single horizontal line, [Ben]’s circuit first has to count out 200 pixels, send a blanking interval, then set the sync low, and finally another blanking interval before rolling down to the next line. This is done with a series of 74LS161 binary counters set up to simply count from 0 to 264. To generate the front porch, sync, and back porch, a trio of 8-input NAND gates are set up to send a low signal at the relevant point in a horizontal scan line.

The entire build takes up four solderless breadboards and uses twenty logic chips, but this isn’t done yet: all this confabulation of chips and wires does is step through the pixel data for the horizontal and vertical lines. A VGA monitor detects it’s in the right mode, but there’s no actual data — that’ll be the focus of the next part of this build where [Ben] starts pushing pixels to a monitor.

Continue reading “Low Res Video Card Is Still Amazing Since It’s Made Out Of Logic Chips”