May 09 2008
The Time Traveling Radio : Part 3
Now that I have the Olimex MOD-MP3 board, it’s time to start figuring it out. As I mentioned previously, it can be a tough nut to crack. The documentation on the board-designers’ site is almost non-existent, and the forums show nothing but frustration. Google searches don’t help much, either.
However, there were two leads that helped: First was a Google search that hit on a guy at Sun who used this board for a Pumpkin effect. Second was a forum post that pointed (roughly) to PDFs on the VLSI site. Unfortunately, those links were old and are now dead, so I’ll upload those file to my server for future generations to stumble on. VLSI doesn’t make the breakout board, Olimex does, but they do make the chip that is the heart of this project.
First Sounds
Now, in theory, all you have to do is load some MP3s on a memory card, plug in headphones, and put in a battery. In theory. But, I came across my first dilemma. The darn thing wouldn’t play.
I put the memory card in, dropped some music on, but nothing. It flashed a lot (there is an onboard LED), but no sound. I read something on a data sheet that it might need to boot and “reorganize” the memory card (up to 30 seconds), but this thing would just spin and spin.
So, I looked at the music I dropped on there. In my rush, I pulled what I had on my laptop. Well, those stupid files were in Windows Media format. Doh! So I checked for supported formats, looked at the wrong data sheet for a while (thought it wouldn’t support MP3), found the right data sheet (which clearly shows MP3 supported), and then loaded up the new NIN MP3 files I downloaded the other day.
And it wouldn’t play them either. Damnit. Well, I looked at the data sheet again, and found that the chip supports WAV files, so I grabbed the Windows sounds and dropped them on the card. Success! It plays WAVs but not MP3s, which would really, really suck. (WAV files are uncompressed and take up loads of space.)
Well, I finally ended up going to an Old Time Radio site and pulled down a MP3. Loaded it up, and, it played! For some reason, those NIN MP3s don’t play, maybe they are using a newer version of the MPEG standard. Who knows. Anyhow, my older MP3 files were playing, and that’s what counted.
So, here’s what I’ve learned so far: It will play MP3s and WAVs, but the MP3s must be MPEG 1 & 2 audio layer 3, according to the specs. If the thing flashes and flashes, but makes no sound, then your MP3 is probably bad. Try using the Windows Startup WAV file. That should play fine.
Microcontroller Or Not?
Okay, so I finally have this thing making sounds. That only took an afternoon to figure out.
Next up, how to control it.
As I had mentioned previously, I was planning on having a microcontroller like the Atmel ATMEGA168 (Arduino setup) do the work of interfacing. It would listen for the rotary encoder input (for track forward/previous, mute, etc) and send commands to the player.
Well, the guy at Sun had tried that, along with people on the forums, and found that process to be a huge pain in the ass. You’d have to code up quite a bit, get communications just right, etc, etc. This was not a path I wanted to go down.
Luckily, the Olimex board has some built in EEPROM firmware that gives you the basics. You can play, pause, volume, navigate, etc. (For my Time Traveling Radio, that’s really all I need. I don’t need, nor want, a Track Display (an LCD, for example), since that would ruin the effect.) The Sun guy had figured out some of the basic pins to do this sort of thing, without having to offload all the work to the MCU, so that sounded like a good solution.
What I’ve learned: If you don’t need a display, and just want the basic functionality, use the onboard EEPROM program. It ain’t robust, but it does all the basics. It also means you’re much more likely to get away with not needing a microcontroller. Less complication is good.
Simple Control Of The Olimex Board
So, it looks like the board can be simply controlled, by “simulating” the on-board switch. Luckily, you don’t need to solder stuff on the board to get at the control pins. (I thought I might have to, but learned it’s easier than that.) Check out the connector in the below photo:
See note at bottom–The above photo is incorrect. DCS is NEXT and MOSI is PREVIOUS.
What you see if the “UEXT” 10 pin connector. Normally, this is used to interface with a MCU for total control, but you don’t have to. For example, if the board is set in “standalone” mode, you can short a couple of pins to get functionality. For example:
DCS to Ground, short period, Next Track
MOSI to Ground, short period, Previous Track
DCS to Ground, long period, Volume (have not tested, not sure which direction)
MOSI to Ground, long period, Volume (have not tested, not sure which direction)
DCS to SW-CS1, short period, Play/Pause toggle
DCS to SW-CS1, long period, Loudness / Random toggle (depending on current mode, not tested)
None of this was very well documented, so I relied on what the Sun guy found, along with some reading up on the datasheet and sample applications. To test it out, I simply took a piece of jumper wire and connected whatever pin to Ground (or SW-CS1).
In addition, I found that you can get the LED status light by connecting DREQ to Ground. This was very helpful, since I could use that for my front-panel dial lighting effects. In fact, the LED flickers as the memory card is read. Bonus! Now I get a Neon-like light effect for my dial.
To test the LED, I took an LED and drop resistor, and connected between DREQ and Ground. Worked fine (and bright).
Finally, make sure you leave the jumpers at their “default”. In other words, the Battery Jumper should be toward the right (EXT=Left, BAT=Right). The DREQ jumper is right about the UEXT connector. Leave DREQ jumped to indicate “standalone” mode. Remove the jumper if you’re doing full MCU control (I have not tested this). The RST (reset) jumper to the right of UEXT should be floating (unconnected).
See note at bottom–The above photo is incorrect. DCS is NEXT and MOSI is PREVIOUS.
What I’ve learned: You can control all of the basic functions of the player using the UEXT connector. This can be connected to microcontroller pins (via transistors) or via off-board buttons. The Sun guy recommends going from MCU to 100 ohm resistor to NPN (3904) for DCS/Ground. Same thing for MOSI to ground. For the toggle of play/pause he says MCU to 100 ohm to PNP (3906) for DCS/SW-CS1. I haven’t tested this, but it looks good.
Next up, how to control the previous/next using my rotary encoder, without a microcontroller. It’s time to debounce and flip-flop! If you are gathering parts, grab some resistors, caps, and a CD4013 Dual D (data/delay) Flip Flop (7474 TTL and 74C74 should work, too–have not tested). At least, I hope a Flip Flop will work.
IMPORTANT UPDATE FOR EXPERIMENTERS: I based my DCS amd MOSI photos off of the Sun diagram. Those do NOT appear to be correct. I think that they are reversed. So, you need to use DCS (pin 10) for NEXT and MOSI (pin
for PREVIOUS. I’ll update the diagrams once I’ve triple-checked everything. (I’m just now doing the Arduino “smoke test”.)
Also, after messing around with the flip flop for a while, I’ve decided to go back to using a microcontroller. I’m using an Arduino (ATMEGA168) for proof of concept and will then switch over to ATTINY2313 for the final product.
What I’ve learned, yet again: Trust NOTHING you find on the web. This is about the 100th time we’ve found problems with diagrams on the web. Pisses me off, since I did test the pins, and my text was correct, but I used the other diagram to do my photos. Grr.
Comments Off



