My good friend Robie has some connections in the salvage industry. We have a running deal where I do some general IT work for him, and he finds me cool geeky stuff in exchange. So far, he’s gotten me a nice handheld FLIR, a couple of old portable computers, and a cold-war era radiation detector. Yesterday he called my and said he had something really nice. I stopped by today and wasn’t let down.
That’s all TTL logic, save a few specialized IC’s. No microprocessors. Awesome.
It’s an ADM-3A terminal. This thing is really a piece of computing history. With Linux, ‘~’ means home in many shells. That’s because on the ADM-3A, the word “home” and ‘~’ are printed on the same key. Also, the text editor “vi” uses the HJKL keys as arrows. That’s because the corresponding arrows are printed on the ADM-3A’s keys. This standard has found its way into many programs beyond vi, including NetHack and even a Google Labs feature of Gmail. It’s quite satisfying to own such an item, and I can’t wait to use it with one of my boxen, as soon as my USB->RS232 cable arrives.
Finally, I have a question for the audience. In the research I’ve been doing, I haven’t been able to find pictures or any information about the ADM-3A in orange. It doesn’t appear that it was painted. Since I can’t find anything about the color, I’m wondering if my new little box is somehow special. If you happen to know anything about it, please do reply.
This is a clock I made for my dad’s Christmas present. He’s been an incredible help to me while I’ve been returning to school for a degree in computer engineering. I wanted to make him a gift that would show thanks for all he has done for me. I thought it would be appropriate to make him something using what I have learned in school. Thanks, dad!
The clock’s display is built from Soviet-era IV-9 Numitron tubes I picked up off of eBay. They’re really easy to work with compared to nixie tubes, and look (arguably) just as cool. Each segment draws about as much current as an LED, and they can work with either common anode or common cathode drivers. This allowed me to use some HEF4794B LED drivers I had on hand. These chips are chainable shift registers, so the display only required 3 microcontroller pins.
I also wanted the clock to have an audible alarm. In a previous post, a reader named lasershark tipped me off about about a really interesting way of generating music with minimal code, called Bytebeat. This method generates 8-bit audio at 8000 samples per second using only one line of code. I have Bytebeat implemented in the file “sound.c” in the source code zip below.
I tried to keep the build as clean as possible since the clock is intended mostly for display. Extra effort was made on the jumpers to the Numitrons. I didn’t want things to turn into a rat’s nest while running 9 wires to every tube. I also chose Christmas colors for the protoboard and wires.
I haven’t forgotten about you! I’ve been working the last couple of days on rewriting the clock code for the TI-Launchpad. I plan to release the source and build instructions sometime in January. I’ll update you on my progress soon.
I’ve decided to take a little break from MSP430 and learn something new. FPGA’s have always intrigued me, so I picked up a Nexys 2 from Digilent and started reading a book called FPGA Prototyping by Verilog Examples by Pong P. Chu. (That reminds me, I still need to finish Pong for the MSP430.)
I read several chapters to familiarize myself with the hardware and language, but nothing beats learning by doing. My summer construction job was rained out today, so I decided to grab a Rockstar energy drink and write my first Verilog project. I figured a Kitt light/Larson Scanner/Cylon eye would be something I could figure out in a few hours. I’m not too sure how “correct” my code is, so I’d love to hear some suggestions.
# clock pin for Nexys 2 Board
NET "clk" LOC = "B8"; # Bank = 0, Pin name = IP_L13P_0/GCLK8, Type = GCLK, Sch name = GCLK0
NET "Led<0>" LOC = "J14"; # Bank = 1, Pin name = IO_L14N_1/A3/RHCLK7, Type = RHCLK/DUAL, Sch name = JD10/LD0
NET "Led<1>" LOC = "J15"; # Bank = 1, Pin name = IO_L14P_1/A4/RHCLK6, Type = RHCLK/DUAL, Sch name = JD9/LD1
NET "Led<2>" LOC = "K15"; # Bank = 1, Pin name = IO_L12P_1/A8/RHCLK2, Type = RHCLK/DUAL, Sch name = JD8/LD2
NET "Led<3>" LOC = "K14"; # Bank = 1, Pin name = IO_L12N_1/A7/RHCLK3/TRDY1, Type = RHCLK/DUAL, Sch name = JD7/LD3
NET "Led<4>" LOC = "E17"; # Bank = 1, Pin name = IO, Type = I/O, Sch name = LD4? s3e500 only
NET "Led<5>" LOC = "P15"; # Bank = 1, Pin name = IO, Type = I/O, Sch name = LD5? s3e500 only
NET "Led<6>" LOC = "F4"; # Bank = 3, Pin name = IO, Type = I/O, Sch name = LD6? s3e500 only
NET "Led<7>" LOC = "R4"; # Bank = 3, Pin name = IO/VREF_3, Type = VREF, Sch name = LD7? s3e500 only
Pin 1.5 is floating unconnected, and is measured by the adc. The LSB is used as the random bit. There’s a twist though. Pin 1.4 is also floating unconnected, and is used as Vref+, so the top end of the range is floating as well. I thought that was pretty clever. Nice, TI!
I wrote a few console programs to help me visualize the randomness. It turned out the generator was biased toward producing 0′s. This function used with the previous function seemed to remove the bias:
EDIT: it was just dumb luck that the following function removed the bias. I did the math afterward, and this 0′s the bias when getRandomBit() returns a 1 30% of the time. I guess that means the ’0′ to ’1′ ratio of getRandomBit() is close to 7 to 3. Not great. I’m mulling over the idea of using laser speckle as a cheap way to generate the randomness.
I did some work on the MIDI synth to make it polyphonic. With the help of George Lucas and John Williams, I was able to win the 43oh.com April 2011 Project of the Month Contest. Check out my thread on the 43oh forums for the details and to find out what this has to do with George Lucas.
Just a quick update. With the new MSP430G’s and their bigger flash space, I was able to increase the resolution of my TV output program. The resolution is now 192×240. When the new 16K MSP430G’s arrive, I plan on increasing this to 384×240, which will finally approach the native aspect ratio.
I just had to change a couple lines of code to get this going, and include the larger image file. I used an MSP430G2452 with 8K flash.
NOTE: This should be compiled in CCS under debug mode. Using release mode or different compilers will likely require adjustment of the software delay toward the bottom of the code.
If you want to make your own images to use, first create a 192×240 monochrome bitmap. To convert the bitmap into a header.h file, I used a program called Image2Code from CrystalFontz. Use this setting to get the proper image format:
I saw this article on Hack a Day today for a library that supports some Arduino-like functions. I thought I’d share a couple of code snippets I have for analogRead(), millis(), and delayMillis(). The delay function on the HaD article used a software delay loop. My millis() and delayMillis() use the WDT.
It’s been awhile since I’ve posted anything, but I’ve been working on several projects. I’ve just been feeling lazy about writing them up. I thought this one might be the most enjoyable and useful to people. I’m going to keep it short and sweet, so please comment if you have any questions.
This is a simple square wave synthesizer. It has a standard midi interface, so it could be used with a midi keyboard or another midi controller.
Here’s the BOM:
1x TI Launchpad or another MSP430
1x 280 ohm resistor (can use internal pull-up instead)
1x 220 ohm resistor
1x Sharp PC900V optoisolator
1x Speaker (I just bought one from RadioShack)
1x MIDI female jack
A midi cable and some kind of midi controller
You could probably get away with not using the optoisolator, but I felt like adhering to spec with the hardware. If you want to use another MSP430, be sure it has a USI and not a USCI, or you’ll have to rewrite some of the code. Also, the code expects to have the DCO calibrated for 16MHz. I think an approximation would work too, but if you’re too far off the midi clock will skew and the notes could be detuned as well.
The speaker gets hooked up to Launchpad ground and P1.2.
On the software side, the USI runs constantly and oversamples the midi data from the optoisolator. The oversampling is resolved with something like a state machine(?). I tried to use the USI properly, but I always seem to run into issues in using it with clockless serial. There’s probably a cleaner way to read the midi data, but it works, so I don’t mind. It’s all yours to fix!
Once we’re able to read the MIDI, it’s just a matter of properly adjusting the period of TimerA, the square wave sound generator, to get the proper note. The synth is monophonic, so some care is also taken to handle and store simultaneous on-notes.
By the way, you can use one optoisolator circuit to send data to multiple launchpads. Just assign each LP a different MIDI channel by changing this line of code:
#define MIDI_CHANNEL 0
So I hooked it up to my midi keyboard. That was OK. Then I downloaded some midi files and routed them through a USB – MIDI converter with Ableton Live. Now that gave me a warm, nerdy feeling inside.
Check it out: