I'm currently trying to use the rMP3 shield with the DFRduino LCD Keypad shield. The problem is, while rMP3 uses digital pins 6, 7, 8, 11, 12 & 13, the LCD shield uses 5, 6, 7, 8 & 9. Therefore, I'd like to reroute pins 6, 7 & 8 to use pins 3, 4 & 10 by cutting the jumpers and wiring them up. So far, so good. The problem I have, though, is that I can't seem to work out how I'd let the C compiler know of the change. There aren't any obvious locations in the C file or associated header and I can't see any mention of this in the documentation. Could you please give me a clue as to how I would do this?
I have not really delved into how it does what it does but I presumed that it just could use those other pins.
Isn't the communication via serial? In which case it would require 2 pins?
Also another question, I know that the LED on board (activity LED) flashes when music is playing and seems to brighten at corresponding points in the music. Is there any easy way to get audio values sent to the arduino so a visualiser could be done from it?
Lee - The rMP3 only uses 2 serial pins to communicate. The SPI port is there as an optional way to control the rMP3, but the current version of firmware (100.01) hasn't got that implemented (expect it in the next version).
You figured out how to do the serial change though. Just cut the jumper at pins 6 (rMP3 TX) and 7 (rMP3 RX), and reroute the pads to the new pins you want to use. (make sure you connect wires to the pads FURTHEST of the two from the Arduino header).
The change in the code should be really simple. Wherever you see:
NewSoftSerial rmp3_serial(6, 7);
change it to (in your case):
NewSoftSerial rmp3_serial(3, 4);
(I'm assuming that you changed pin 6 on the rMP3 to pin 3, and pin 7 to pin 4).
If that doesn't work, post your code and we can see what's going on.
mowcius - sounds like either you're listening to a VBR mp3 file (wide range one too! 32 kbps -> 320 kbps) and the music has really quiet and really loud spots, or your eyes are fooling you! The data goes directly from the card to the decoder. So, the only effect you'd see is if the MP3 frames had different bitrates.
RE: documentation, our wikidocs have always been public, unfortunately you had to register. I've changed it now so that you don't have to register. Just add any comments/questions you have on any page that has a discussion.
mowcius - sounds like either you're listening to a VBR mp3 file (wide range one too! 32 kbps -> 320 kbps) and the music has really quiet and really loud spots, or your eyes are fooling you! The data goes directly from the card to the decoder. So, the only effect you'd see is if the MP3 frames had different bitrates.
I was indeed! I hadn't noticed that it didn't change with non VBR files. It was only on the loud bits that I got brighter flashes...
Any chance you could do the Input/Output Interface page on the wiki?
The rest of the documentation does indeed look good, it has been a while since I have looked and I suppose I did not have a great look through.
I have just gone through and had a thorough read! Interesting stuff!
Now back to my previous question
Is there any easy way to get audio values sent to the arduino so a visualiser could be done from it?
It is not a problem if not, it would just be interesting to do it without all the extra circuitry it usually requires.
L and R provide accurate activity for that sort of thing Why not branch from there for both output and route to analog input in the Arduino? I don't know what the upper or lower values for those pads are (maybe in the docs?), but it's surely a valid option. Just make sure it doesn't exceed the pins impedance.
You mean speaker L & R?
That requires all the annoying circuitry in between to get that to work...
I suppose i am more asking about a frequency visualiser which is more complicated...
Not necessarily. The analog input in the Arduino can take any value between 0v - 1v (I believe), so, as long as you limit the voltage (using the correct resistance), then you have a simple variable source right there. The biggest issue is making sure your querying of that source doesn't use the potential that would otherwise drive your speaker output (though you could increase that with an amp).
Yeah, 5v... That's what I meant Well, you're okay, then, seeing as 5v is the maximum voltage anywhere past the regulator! Hook even one of those pads into the Arduino and use it as an input. Actually, you could also average the highs and lows so as to get better results, as those highs and lows will be quite similar in value.
You have to be careful when using audio signals. The output from the rMP3 on the L and R pins are actually AC signals (because of the filter capacitors on the outputs). This means that the voltage with respect to ground on those pins can be negative, if you connect them to the analog inputs on the Arduino. This can damage the ADC on the Atmel chip.
You could introduce a DC offset, but that will require extra components which I think mowcius is trying to avoid.
I'd stay away from connecting the audio output to one of the analog inputs, unless you know what you're doing.
mowcius - your wish is my command. Here is the updated documentation on the input interface:
Hadn't thought about it being AC (which should be as obvious as the nose on my face), but it's nothing that a handful of diodes couldn't fix. In fact, one could always route the negative edge to a separate pin as a positive feed.
Sparkfun's MP3 breakout is far less functional. I really had to search high and low for a "high quality" and flexible MP3 board for my JukeBox project I'm building. There just aren't that many out there. It was pure luck that this one was already arduino compatible, because I was quite prepared to fashion one into an arduino ready product.
I never had a problem with that shield - until I tried to use it. You pay less for more work (and more headaches, and more technical jargon, and so on). If that turns your crank, go for it. The adage always holds true: "You get what you pay for".
I'll put forward a challenge to you though. If you can explain the differences between that board and the Rogue Robotics rMP3 shield, I'll send you a free rMP3 shield. [Offer only valid for Sannin ]
b
P.S. I'll steer clear of the fact that they also use Arduino in their product name when it clearly isn't endorsed by the Arduino Team.