General Purpose I/O: How to get more

The first program anyone writes for a microcontroller is the blinking LED which involves toggling a general-purpose input/output (GPIO) on and off. Consequently, the same GPIO can be used to read digital bits as well. A traditional microcontroller like the 8051 is available in DIP packages ranging from 20 pins to 40 pins. Some trade the number of GPIOs for compactness while other devices offer a larger number of GPIOs at the cost of complexity in fitting the part into your design. In this article, we take a quick look at applications that require a larger number of GPIOs and traditional solutions for the problem.

A GPIO is a generic pin on an integrated circuit or computer board whose behavior, including whether it is an input or output pin, is controllable by the user at runtime. See the internal diagram of the GPIO circuit for the ATmega328 for reference.

Simply put, each GPIO has a latch connected to a drive circuit with transistors for the output part and another latch for the input part. In the case of the ATmega328, there is a direction register as well, whereas, in the case of the 8051, the output register serves as the direction register where writing a 1 to it sets it in output mode.

The important thing to note here is that since all the circuits are on the same piece of silicon, the operations are relatively fast. Having all the latches and registers on the same bus means it takes just one instruction to write or read a byte from any GPIO register.
Continue reading “General Purpose I/O: How to get more”

Neon Lamps Make For The Coolest Of Nixie Clocks

Revisiting old projects is always fun and this Nixie Clock by [pa3fwm] is just a classic. Instead of using transistors or microcontrollers, it uses neon lamps to clock and drive the Nixie Displays. The neon lamps themselves are the logic elements. Seriously, this masterpiece just oozes geekiness.

Inspired by the book “Electronic Counting Circuits” by J.B. Dance(ZIP), published in 1967, we covered the initial build a few years back. The fundamental concept of operation is similar to that of Neon Ring Counters. [Luc Small] has a write-up explaining the construction of such a device and some math associated with it. In this project, [pa3fwm] uses modern day neons that you find in indicators, so his circuit is also updated to compensate for the smaller difference in striking and maintaining voltages.

The original project was done in 2007 and has since undergone a few upgrades. [Pa3fwm] has modified the construction to make it wall mounted. Even though it’s not a precise timekeeper, the project itself is a keeper from its time. Check out the video below for a demonstration.

Feel inspired yet? Take a peek at the White Rabbit Nixie Clock and you are looking for a low voltage solution to powering Nixies then check out the 5-volt Nixie Power supply.

Continue reading “Neon Lamps Make For The Coolest Of Nixie Clocks”

Baremetal Rust On the Horizon

Rust Programming Langauge has grown by leaps and bounds since it was announced in 2010 by Mozilla. It has since become a very popular language owing to features such as memory safety and its ownership system. And now, news has arrived of an Embedded Devices Working Group for Rust aiming at improving support for microcontrollers.

Rust is quite similar to C++ in terms of syntax, however Rust does not allow for null or dangling pointers which makes for more reliable code in the hands of a newbie. With this new initiative, embedded development across different microcontroller architectures could see a more consistent and standardized experience which will result in code portability out of the box. The proposed improvements include IDE and CLI tools for development and setup code generation. There is also talk of RTOS implementations and protocol stack integration which would take community involvement to a whole new level.

This is something to be really excited about because Rust has the potential to be an alternative to C++ for embedded development as rust code runs with a very minimal runtime. Before Arduino many were afraid of the outcome of a simple piece of code but with rust, it would be possible to write memory-safe code without a significant performance hit. With a little community support, Rust could be a more efficient alternative. We have seen some Rust based efforts on ARM controllers and have covered the basics of Rust programming in the past if you want to get started. Good times ahead for hardware hackers.

Hijacking A Sony Watchman For Pong

The era of the vintage television was a great one, and one of the transitional by-products was the Sony Watchman. It was a portable TV which Sony started selling in 1982, and the amazing thing about it was that it had an actual 4-inch cathode ray tube or CRT. [Sideburn] just posted a video in which he hijacks the internals of a Watchman to make it into a portable game of Pong.

The hack begins with removing the TV tuner module inside to make some room for the new residents. Next comes the M51364P which is VIF video decoder chip, and for which surprisingly there is not a lot of info on the web. They were able to find a part of the schematic, which though it was in Russian may still be useful for enthusiasts. Removing the VIF revealed the audio and video pins that needed the appropriate signals for the hack to be successful. In an age of multilayer boards it is amazing how a two-layer PCB makes life so easier for the tinkerer.

For the new brains an Arduino Nano clone was selected, and instead of adding modern buttons the existing volume and band select switches were convinced to be the paddle control and play/pause button. Getting everything to fit was easy with the absence of the tuner module, and voila! New(ish) hardware. For the firmware, [Sideburn] turns to Hackvision firmware which has a host of games such as Space Invaders, Asteroids, and even Tetris.

We covered Hackvision a few years ago as a hardware/firmware bundle, and if you are more into CRTs then check out the Arduino driven 6845 CRT controller.

Continue reading “Hijacking A Sony Watchman For Pong”

Customising a $30 IP Camera For Fun

WiFi cameras like many other devices these days come equipped with some sort of Linux subsystem. This makes the life of a tinkerer easier and you know what that means. [Tomas C] saw an opportunity to mod his Xiaomi Dafang IP camera which comes configured to work only with proprietary apps and cloud.

The hack involves voiding the warranty by taking the unit apart and installing custom firmware onto it. Photos posted by [Tomas C] show the mainboard powered by an Ingenic T20 which is a popular IP Camera processor featuring some image and video processing sub-cores. Upon successful flashing of the firmware, the IP camera is now capable of a multitude of things such as remote recording and playback which can be configured using the web UI as documented by [Tomas C]

We did a little more digging on the custom firmware and discovered that the original author of the custom firmware, [EliasKotlyar] has done a lot of work on this project. There are loads of images of the teardown of a camera and an excellent set of documentation of how he made the hack. Everything from adding serial headers, getting root access, dumping the firmware and even toolchain links are given on the page. This is extremely handy for a newbie looking to get into the game.

And IP Cameras are not of the only hackable hardware out in the wild. There are other devices that are running Linux based firmware such as the Wifi SD Cards that run OpenWRT. Check out the essential guide to compiling OpenWRT from source if you are looking to get started with your next IP Camera hack.

Thanks for the tip [Orlin82]

Smell That? It’s time.

Steampunk is beautiful. There is something about the exposed metal and primitive looking artifacts that visually appeal to the brain of a maker and engineer alike. Makers have been busy the last decade building clocks with this theme because hey, everyone needs a clock. [Fuselage] has put together a Steam Punk Clock that releases actual steam(actually steam oil smoke) for its hourly chime. How cool is that?

The clock is designed around the Conrad C-Control Unit (translated) which has the Motorola 68HC08 and [Fuselage] uses BASIC to write the routines for the system. Unlike a lot of steampunk clocks that use Nixie Tubes, this one uses 4 Numitron displays for the hours and minutes display. An analog dial panel display is employed for the seconds’ and is driven by a PWM signal. The absence of the RTC module was not obvious until we saw that the BOM includes a DCF77 receiver. For the uninitiated, DCF77 is a longwave time signal and standard-frequency radio station in Mainflingen, Germany. If you are anywhere within a 2000 km range of that location, you can pick up a 24-hr time signal for free which is excellent if you plan to make say… a radio clock.

The steam/smoke generator is a subproject of sorts. The custom machine is designed to have a separate oil reservoir and pump in addition to the actual generator so that the system does not run out of fuel as quickly. Clearly [Fuselage] did his homework which is explained in brief in his project logs. The final design has a brass tube as the main heating and also serves as the outlet chamber. The oil is pumped from under the heating filament in the brass tube, and excess fluid drains off back into the reservoir. A piece of nichrome wire serves as the filament that vaporizes the liquid to gaseous form. Sensors make sure of the oil levels in the reservoir as well as the steam tube. Servo motors and fans add the effect of the opening the exhaust rain cap, and a small LED helps illuminate the exhaust to complete the impression of real steam.

The project is a great example of a simple but effective implementation and for those who are wondering about Numitron Tubes, check out this tutorial on the subject. Of course, there is the Giant Electro-mechanical Clock for those looking at more sizable works of art.

Continue reading “Smell That? It’s time.”

MicroPython learns a new trick – ISP for AVRs

One of the reasons why the Arduino became so popular was the ability to program it with ease. It meant the end of big parallel programmers that would cost an arm and a leg. The latest installment of CircuitPython from [Lady Ada] and the team over at Adafruit is a library for programming AVR microcontrollers without a dedicated PC.

For the uninitiated, in-system programming or ISP for AVR controllers employ the SPI bus to write the compiled binary to the flash memory of the controller. The discount on the number of pins used itself is a benefit though getting the timings right was a bit tricky in the good old days. Most dedicated ISPs handle this nicely, though they are normally slaves to a host PC where an ‘upload’ button initiates the process.

With CircuitPython (a derivative of MicroPython), programming microcontrollers does not require going through the code-compile-flash cycle. It can be run on a number of processors, however, AVRs are not among them so this neat little library offers the next best thing. Wire-up an Atmega328P or ATmega2560 to a board like the ESP8266 that does run CircuitPython, and you can write firmware on the fly.

There is a complete tutorial on the subject thanks to [Phillip Torrone] and [Lady Ada] which includes some demo files for testing out the functionality. This opens up a lot of possibilities where OTA firmware updates for an AVR co-processor. We expect to see some keychain AVR programmers in the near future taking a hint from the ESP8266 based Two-Factor Authentication featured previously.