Monthly Archives: June 2014

Stellaris Mod Player

I while ago I bought a couple of Stellaris® LM4F120 launch pad evaluation kits. I really wanted to play around with the ARM processors and the Stellaris offers and extremely low cost introduction. This board features a  LM4F120H5QR ARM® Cortex™-M4F processor with 256KB of flash memory, 32KB of RAM, 2KB of EEPROM, two 12-bit analog to digital converters, a USB 2.0 device port, a hibernation module, other serial connectivity and flexible GPIO. The board comes with on-board emulation, which means you can program and debug your projects without the need for additional tools. All this for around £10.

Support for these boards on-line is huge both from Texas Instruments and from other people who have been using them in their own personal projects.

My boards have been sitting in my drawer for months I had used them initially but only running the test code under debug and familiarising my self with the tool set and the StellarisWare library (an extensive suite of software designed to simplify and speed development of stellaris-based microcontroller applications).

One project that did catch my eye was a MOD player a guy named Ronen K had implemented on his Stellaris Launchpad. The player had been ported from another project based on a Microchip PIC32 by Serveur perso.

You can see Ronens work on his blog here and here.

What really impressed me is the audio is generated from driving the GPIO pin with a PWM signal. According to his blog Ronen spent a fair amount of time redoing the PWM/timer code to get it to work on the Stellaris and the timing is fairly crtical. But wow it sounds awesome. A small LC filter (10 Khz cutoff) was added to help improve the audio.

For those who don’t know the MOD file format is a file format used to represent music. The format was very popular on the Commodore Amiga. Having had an Amiga as a teen I really wanted to relive some of those old memories.

Once I had Ronens code up and running playing files from the SD card I decided to add a 1.8″ TFT display module I had lying around. This allowed my to have a menu showing all of the mod files found on the SD card. The user could then choose which file to play. The display also shows some basic information such as the mods title, number of patterns etc all extracted from the mod file being played.

Check out the video to see it in action. Gives you a warm feeling hearing some of those old demo tunes again. The Amiga really was an awesome bit of kit.

Weecade Xbox Arcade Machine

I built this portable arcade machine back in the summer of 2012 while being stuck in most weekends looking after the kids while my partner went back to work after giving birth to our second child. It took me around 6 months to complete from start to finish in the end. Still worth the effort.

The internet is full of these weecade arcade machines and plans to build your own are abundant. However unlike most which tend to run windows on a cut down PC this one uses the parts from my old original Xbox.

I stripped down the Xbox and mounted the parts in the new cabinet. Rather than mounting the entire DVD-ROM drive I removed the PCB and just mounted that instead. As far as the Xbox is concerned it’s a perfectly functioning drive so everything works fine. The hard drive is mounted on the monitor support due to lack of space and the mains in is distributed via a junction box.Weecade Internals 2

For the display I opted for a 17” monitor (flat screen obviously there was no way a CRT was going to fit with everything else in there).  Some people prefer a 19” screen but personally I think that is just slightly too big for a bar top arcade cabinet like this. Converting the RGB video signal to VGA for the monitor I purchased one of these CGA/EGA/YUV to VGA converters. I know there are cheaper alternatives but I can honestly say this thing is worth every penny. It has a number of inputs including an RGBHV input which I am feeding from the Xbox’s scart.IMG_1910To ensure the best signal possible into the converter I built a sync stripper (based around the LM1881 Video Sync Separator chip from Texas Instruments). The sync stripper basically takes the composite video signal and extracts both the horizontal and vertical sync signals. This way I can feed the converter with clean dedicated component and sync signals. The converter then up scales the video to the native resolution of the monitor. I must say the results are awesome.

Next step sound. For this rather than stripping down a set of old mains powered PC speakers I decided to buy a dedicated amplifier instead. I was toying with the idea of building my own amplifier based on a pair of TDA2003 10W car radio audio amplifier ICs but after pricing it up it worked out cheaper just to buy a kit instead. Weecade SpeakersSo I did. It states it’s capable of driving something like 18W per channel but that’s into a load of 4 ohms. The speakers I have fitted are much higher impedance than that so the output power will be significantly lower. This did concern me at first. But after powering it up for the first time I needn’t have worried. It is more than loud enough.

For the control panel I opted for the standard two player layout. Six buttons per player plus the 1P/2P buttons. To interface the joysticks and buttons I decided to use two old Xbox type S controllers. Weecade ControlsAfter stripping them down to just the PCB I soldered onto various points for each of the original Xbox buttons. This meant I could just plug the controllers directly into the mother board controller ports.

The control panel buttons I went for are actually illuminated. Each has a small 12V bulb inside. After getting the buttons working and illuminated I decided they would look much better if they could be lit in sequence like some sort of arcade fruit machine. So I set to work coming up with something. After a few days tinkering I had a circuit built using an Atmel AVR microcontroller using 16 logic level FETs to drive each of the bulbs. With another button to switch patterns. The code was written in such a way the additional patterns could be added with minimum fuss. There are only two patterns, plus all on and all off at the moment but I do plan to add some more later.

Wasn’t entirely happy with the plain old boring marquee I had originally fitted so I decided to upgrade it. It now has this lovely TRON classic retro 10″ backlit marquee header supplied by my favourite sticker seller on eBay. Finished WeecadeThe sticker is sandwiched between two sheets of 3mm clear acrylic. The bottom sheet being painted back with a clear window underneath the sticker allowing light to be shone through. Back lighting is provided by a strip of 30 white LEDs. Its not the brightest but its more than adequate.

You can see a video of it running here.