Breakout Board Becomes Pogo Pin Programmer

Making a programming jig becomes exponentially more difficult after two pins and who would even consider building one if they were not setting up more than twenty boards? If it were easy for novices to construct jigs, we might all have a quiver of them on the shelf next to our microprocessors. Honestly, a tackle box full of homemade programming fixtures sounds pretty chic. The next advantage to ditching the demo boards is that bare processors take up less room and don’t draw power for unnecessary components like unused voltage regulators and LEDs. [Albert David] improves the return-on-time-investment factor by showing us how to repurpose a WeMos board to program a bare ESP8266 module.

[Albert]’s concept can apply to many other surface-mount chips and modules. The first step is to buy a demo board which hosts a programmable part and remove that part. Since you’ve exposed some solder pads in the process, put pogo pins in their place. Pogo pins are small spring-loaded probes that can be surface mounted or through-hole. We’ve used them for programming gorgeous badges and places where the ESP8266 has already been installed. When you are ready to install your software, clamp your Franken-porcupine to the controller and upload like normal. Rinse, wash, repeat. We even get a view of the clamp [Albert] uses.

Play Tetris On A Transistor Tester, Because Why Not?

[Robson] had been using the same multimeter since he was 15. It wasn’t a typical multimeter, either. He had programmed it to also play the Google Chrome jumping dinosaur game, and also used it as a badge at various conferences. But with all that abuse, the ribbon cable broke and he set about on other projects. Like this transistor tester that was just asking to have Tetris programmed onto its tiny screen.

The transistor tester is a GM328A made for various transistor testing applications, but is also an LCR meter. [Robson]’s old meter didn’t even test for capacitance but he was able to get many years of use out of that one, so this device should serve him even better. Once it was delivered he set about adding more features, namely Tetris. It’s based on an ATmega chip, which quite easy to work with (it’s the same chip as you’ll find in the Arduino Uno but [Robson’s] gone the Makefile route instead of spinning up that IDE). Not only did he add more features, but he also found a mistake in the frequency counter circuitry that he fixed on his own through the course of the project.

If you’ve always thought that the lack of games on your multimeter was a total deal breaker, this project is worth a read. Even if you just have a random device lying around that happens to be based on an ATmega chip of some sort, this is a good primer of getting that device to do other things as well. This situation is a fairly common one to be in, too.

Continue reading “Play Tetris On A Transistor Tester, Because Why Not?”

How To Program A Really Cheap Microcontroller

There are rumors of a cheap chip that does USB natively, has an Open Source toolchain, and costs a quarter. These aren’t rumors: you can buy the CH552 microcontroller right now. Surprisingly, there aren’t many people picking up this cheap chip for their next project. If there’s no original projects using this chip, no one is going to use this chip. Catch 22, and all that.

Like a generous god, [Aaron Christophel] has got your back with a working example of programming this cheap chip, and doing something useful with it. It blinks LEDs, it writes to an I2C display, and it does everything you would want from a microcontroller that costs a few dimes.

The CH552, and its friends the small CH551 all the way up to the CH559, contain an 8051 core, somewhere around 16 kB of flash, the high-end chips have a USB controller, there’s SPI, PWM, I2C, and it costs pennies. Unlike so many other chips out there, you can find SDKs and toolchains. You can program the chip over USB. Clearly, we’re looking at something really cool if someone writes an Arduino wrapper for it. We’re not there yet, but we’re close.

To program these chips, [Aaron] first had to wire up the microcontroller into a circuit. This was just a bit of perf board, a resistor, a few caps, and a USB A plug. That’s it, that’s all that’s needed. This is a fairly standard 8051 core, so writing the code is relatively easy. Uploading is done with the WCHISPTool software, with options available for your favorite flavor of *nix.

But it gets better. One of the big features of the CH552 is USB. That means no expensive or weird programmers, yes, but it also means the CH552 can emulate a USB HID device. The CH552 can become a USB keyboard. To demo this, [Aaron] programmed a CH552 board (DE, here’s the Google translatrix) loaded up with touch pads and LEDs to become a USB keyboard.

If you don’t feel like soldering up one of these yourself, there are some suppliers of CH554 dev boards, and the files for [Aaron]’s projects are available here. Check out the videos below, because this is the best tutorial yet on programming and using some very interesting chips that just appeared on the market.

Continue reading “How To Program A Really Cheap Microcontroller”

Build Retro Games With Script-8

A whole generation of programmers learned to program by writing — or at least typing in — game programs for relatively simple computers like a TRS-80, a Commodore 64, or any of a handful of similar machines. These days, games are way more complicated and so are computers. Sure, it is more fun to play Skyrim than Snake, but for learning, you are probably going to get more out of starting with a simple game. If you want to learn programming today — or maybe start someone else on that same journey, you should check out Script-8, a project by [Gabriel Florit]. You can get a taste of how it looks in the video below, or just surf over to the site and play or modify a game (hint: press “a” to launch the ball).

Instead of paraphrasing, here’s the excellent elevator speech from the web site:

SCRIPT-8 is a fantasy computer for making, sharing, and playing tiny retro-looking games (called cassettes). It’s free, browser-based, and open-source. Cassettes are written in JavaScript.

Continue reading “Build Retro Games With Script-8”

Crash Your Code – Lessons Learned From Debugging Things That Should Never Happen™

Let’s be honest, no one likes to see their program crash. It’s a clear sign that something is wrong with our code, and that’s a truth we don’t like to see. We try our best to avoid such a situation, and we’ve seen how compiler warnings and other static code analysis tools can help us to detect and prevent possible flaws in our code, which could otherwise lead to its demise. But what if I told you that crashing your program is actually a great way to improve its overall quality? Now, this obviously sounds a bit counterintuitive, after all we are talking about preventing our code from misbehaving, so why would we want to purposely break it?

Wandering around in an environment of ones and zeroes makes it easy to forget that reality is usually a lot less black and white. Yes, a program crash is bad — it hurts the ego, makes us look bad, and most of all, it is simply annoying. But is it really the worst that could happen? What if, say, some bad pointer handling doesn’t cause an instant segmentation fault, but instead happily introduces some garbage data to the system, widely opening the gates to virtually any outcome imaginable, from minor glitches to severe security vulnerabilities. Is this really a better option? And it doesn’t have to be pointers, or anything of C’s shortcomings in particular, we can end up with invalid data and unforeseen scenarios in virtually any language.

It doesn’t matter how often we hear that every piece of software is too complex to ever fully understand it, or how everything that can go wrong will go wrong. We are fully aware of all the wisdom and cliches, and completely ignore them or weasel our way out of it every time we put a /* this should never happen */ comment in our code.

So today, we are going to look into our options to deal with such unanticipated situations, how we can utilize a deliberate crash to improve our code in the future, and why the average error message is mostly useless.

Continue reading “Crash Your Code – Lessons Learned From Debugging Things That Should Never Happen™”

Machine Learning On Tiny Platforms Like Raspberry Pi And Arduino

Machine learning is starting to come online in all kinds of arenas lately, and the trend is likely to continue for the forseeable future. What was once only available for operators of supercomputers has found use among anyone with a reasonably powerful desktop computer. The downsizing isn’t stopping there, though, as Microsoft is pushing development of machine learning for embedded systems now.

The Embedded Learning Library (ELL) is a set of tools for allowing Arduinos, Raspberry Pis, and the like to take advantage of machine learning algorithms despite their small size and reduced capability. Microsoft intended this library to be useful for anyone, and has examples available for things like computer vision, audio keyword recognition, and a small handful of other implementations. The library should be expandable to any application where machine learning would be beneficial for a small embedded system, though, so it’s not limited to these example applications.

There is one small speed bump to running a machine learning algorithm on your Raspberry Pi, though. The high processor load tends to cause small SoCs to overheat. But adding a heatsink and fan is something we’ve certainly seen before. Don’t let your lack of a supercomputer keep you from exploring machine learning if you see a benefit to it, and if you need more power than just one Raspberry Pi you can always build a cluster to get your task done just a little bit faster, too.

Thanks to [Baldpower] for the tip!

A Portal Port Programmed For Platforms Of The Past

If you still have a Commodore 64 and it’s gathering dust, don’t sell it to a collector on eBay just yet. There’s still some homebrew game development happening from a small group of programmers dedicated to this classic system. The latest is a Portal-like game from [Jamie Fuller] which looks like a blast.

The Commodore doesn’t have quite the same specs of a Playstation, but that’s no reason to skip playing this version. It has the same style of puzzles where the player will need to shoot portals and manipulate objects in order to get to the goals. GLaDOS even makes appearances. The graphics by [Del Seymour] and music by [Roy Widding] push the hardware to its limits as well.

If you don’t have a C64 laying around, there are some emulators available such as VICE that can let you play this game without having to find a working computer from the 80s. You can also build your own emulator if you’re really dedicated, or restore one that had been gathering dust. And finally, we know it’s not, strictly speaking, a port of Portal, but some artistic license in headlines can be taken on occasion.

Continue reading “A Portal Port Programmed For Platforms Of The Past”