Electronic Hobbyists Corner

Home
Site Information
Contact Details

Projects
Technical Articles
Reference Section
Component Tutorials

Site Map
Links
Hardware Interface
Winamp Hardware Interface Winamp Hardware Interface
Tree Hardware Interface - Hardware details, firmware code.
Tree Host Software - Software overview, download and source code.



About Winamp
Hardware Overview
Schematic
Firmware
Images



About Winamp:
While this is not a promotional page for Nullsoft Winamp, the software does deserve a mention as it is the core of this project.

For the few readers who aren't in the know, Winamp is one of the more popular freeware media players for Windows. It takes care of the basic tasks like playing MP3's, CD audio and most standard video formats but also does more interesting things like advanced programmable visualisation and automatic preset selection for the ten band EQ. Winamp can also be expanded to do many more useful (and not so useful) things through plugins, which are just third party DLLs which are controlled by Winamp.

While Winamp has moved on since it's success with the 2.x releases, (to "Winamp 3" and "Winamp It's-so-good-we-skipped-a-number 5") I still prefer the later 2.x versions, Winamp 2.92 in particular. This is mostly because this release doesn't take nearly as long to load as the later ones, but also because the releases prior to Winamp 3 are still the most stable and well documented.

Hardware Overview:
This is another one of those projects which designed itself, or rather, what I could find in my junk box(s) determined most aspects of the final design. The interface consists of four push-buttons, two dual-color LEDs, a four digit 7-segment LED display, a rotary encoder and a 10-segment LED bar graph which I'm still trying to get to work. The rotary encoder has a built in push-button which toggles "hardware modes" in which the four push-buttons can perform different functions and the LED display(s) can deliver different information. The brains of the operation is a PIC16F628 (at 5MHz) with a serial link to the host software via COM2.

As this is probably the more complex projects I've tried to explain, I'll start with a diagram.


Hardware Overview Diagram


The PIC16F628 ('628 from here on) is the heart of the hardware part of this project, being linked to most of the interface and to the host software through COM2. (By the way, COM2 could be any COM port) Note that the DTR (Data Terminal Ready) line of the serial port is linked to /MCLR on the '628, meaning that if the host software asserts and then releases the DTR line the '628 undergoes a hardware reset.

The PWM module in the '628 is used to control the bar graph through the LM3914. (The LM3914 is a programmable linear bar graph driver which can display a moving dot or a solid bar) The bar graph itself will eventually be a progress indicator, showing the current position within a track or playlist.

The rotary encoder hooks directly to the PIC with 100KΩ pull-ups, (not shown, this isn't a schematic) using the external interrupt to ensure quick response. When the shaft is pushed it operates a push-button which is the third line to the '628. Some extensive software was needed to debounce this push-button....

Two dual-color LEDs are used to show if Winamp is running and to indicate the current hardware mode. They are driven directly from a hex inverter IC (CMOS 4069B) so that they only require two I/O lines. When the input to the 4069B is low the respective LED goes red, when it is high it goes green. (there is no off state)

Finally, the 7-segment displays are driven by a single decoder (CMOS 4511B) which is multiplexed by a serial shift register. (74HC595) The '628 shifts a byte into the 74HC595, the low nibble of which is the BCD representation of the current digit. (The four lines running from the 74HC595 to the 4511B) The high nibble is a bit mask which connects the common cathode of the current digit to ground through a transistor. (The four lines marked "COMM" running from the 74HC595 to the display)

Because the display is multiplexed at about 4.8KHz the rated 20mA per segment from the 4511B results in a dim display. To make the display readable in daylight I increased the segment current to ~33mA, which the 4511B can handle due the the low duty cycle involved. (it may be 13mA out of spec, but it's only on less than 50% of the time) Unfortunately, the display multiplexing stops during programming and when the chip is held in reset because the 74HC595 maintains it's outputs when the '628 stops updating them and the display freezes on the current digit, at 100% duty cycle. In order to prevent damage to the 4511B and the driving transistor the 4511B's blanking input (/BI) is tied low and connected to the '628. While the '628 is running properly the blanking input is driven high the the display works. When the chip is reset or programmed the I/O pin connected to the blanking input goes into high-impedance mode and the pull-down blanks the display, saving the aforementioned components.

Schematic:
This is not the simplest of circuit diagrams, so feel free to ask me questions if you need to. It might help to refer to the block diagram and explanation above while studying this schematic.


Winamp Hardware Interface Schematic
Click to view image alone


A few points to note about the schematic which are not mentioned in the above explanation:

The LM3914 bar graph aspect of the project isn't quite functioning properly yet, so it might not be the best of ideas to use that part of the schematic for any sort of reference. I'll update it when I get time to fix the problem.

J1 had to be added when I implemented the hardware reset from DTR. I think the MAX232 drives high with a smaller impedance than the Wisp628 Programmer, preventing an external reset from another source and therefore making programming difficult. This jumper may not be needed for other programmers.

The buttons are connected directly to the serial port input lines and have no connection to the '628 itself. The software handles button presses, including debouncing, with simple event driven code and the MSComm control. (more details on the Host Software page.)

The crazy looking circular components connected to the 4069B IC are dual color LEDs. Usually these are drawn as two LEDs wired in whatever arrangement the LED concerned has, I enclosed them with a dash-circle to show that they're actually a single component. The same applies to the rotary encoder just above the '628, which is really just two switches working in a set pattern.

Firmware:
The firmware is written in assembly code with MPASM compatible syntax.

There's really very little point in me explaining the firmware code for two reasons:
  • Those that don't understand assembly language won't understand no matter how well I explain it.
  • Those that do understand assembly language won't need an explanation, they can figure it out with relative ease. (It's not a very large piece of code)

You can download or view the firmware source from the links below.

View in Browser (text file)
Download - ZIP archive containing source (.asm), HEX (.hex), error (.err), listing (.lst) and include (.inc) files.

Images:
A few photographs for the curious types.... Starting with the front panel in action.


Winamp Hardware Interface
Click for a larger image


The PIC16F628 being programmed with new firmware. Programming is not actually taking place in this image, because J1 is still shorted.


Programming firmware
Click for a larger image


The entire assembly removed from the drive bay. I have a strange case which uses sliding racks rather than screwing onto the case.


Removed from drive bay
Click for a larger image


Finally, the PCB itself. Not the neatest work I have done but prototypes have a tendency to be that way. Most of the interconnections are made with wire links on the underside of the board.


PCB assembly
Click for a larger image




If you have any comments or suggestions please don't hesitate to contact me.

Return To Top Last Updated: 12/02/2007 Home Page