Pages: [1] 2 3 4   Go Down
Author Topic: Arduino and VMUSIC2  (Read 7266 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I worked out how to use the Vinculum VMUSIC2 MP3 player with the Arduino.  The VMUSIC2 uses USB flash drives to store MP3 audio.

More info here:

http://techartblog.blogspot.com/2007/08/vmusic2-on-arduino.html



-Thomas
 http://www.t11s.com
 Dorkbot DC organizer
 http://dorkbot.org/dorkbotdc
Logged

Daniel
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

hey

now you're like, the  8-)STAR 8-) of the forum. nice work, lots of people have been waiting for this!

D
Logged

melbourne, AU
Offline Offline
Newbie
*
Karma: 1
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

star indeed... well done!

i'd love to hear how you go with 2-way communication.  keep us posted!

jon
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My thought is that for two-way, you will need to toggle the VMUSIC2 CTS#, so instead of just grounding that pin, you'd attach it to a digital output pin and do something like

Code:
digitalWrite(CTS_pin, LOW);
Serial.print("V3A"); #play all files
Serial.print(13,BYTE);
digitalWrite(CTS_pin,HIGH); #allow data to be transmitted from the VMUSIC2 to the Arduino
while (Serial.available() > 0) {
            incomingByte = Serial.read();
... # do something with it
}

Unfortunately I can't test this for a few days...too many projects going on at the same time!  But I'll post results if it works.  
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yep, well if you take the CTS# pin HIGH you certainly can Serial.read() data coming in from the VMSUIC2.

Unfortunately, the only thing I've been able to read so far is:

"Ver 01.12VMUSIC1 On-Line:
No Upgrade
D:\>
D:\>"

While I'm getting the "login message" and the "command prompt", the information about playback doesn't seem to be coming in for some reason - obviously the neat part would be for the VMUSIC2 to tell you when a clip has done playing.  There might be some weird configuration issue I am missing.

Of course, if you know how long the clip is ahead of time, you can just delay() until it is over.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

To date, I've been able to get back an answer to a "DIR" command, but I can't seem to get the VMUSIC2 to properly indicate when an audio file is done playing (I don't even get the command prompt back).

I thought that perhaps I'd have to upgrade the firmware, but it gives "Bad Command" when I try to "FWU" it.

On the other hand, I seem to have no problem playing back files using "V3A" or "VPF".

UPDATE:  It turns out that my firmware is so old (Ver 01.12) that it doesn't even have the FWU command...I'll have to ask Vinculum to see what I can do about upgrading the firmware.
« Last Edit: August 27, 2007, 11:02:03 pm by dorkbotdc » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

New Update:

Yep, I had old firmware.  I downloaded the newest firmware from Vinculum (http://www.vinculum.com/downloads/firmware/ftrfb_main_03_56VMSC1B.ftd), and renamed it "ftrfb.ftd" and put it on a thumb drive.  I powered it up, and it reflashed the firmware.

Now I'm at "Ver 03.56VMSC1".

Good news: There is some evidence that it sends out the "Playing 1.MP3" style messages once you start playing.

Bad news:  Now bringing CTS high appears to stop playback, although that is the only way you can receive serial data from the device.

Ack!  Looks like I'll have to bang on it some more.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have trouble making the VMUSIC work with Arduino... Could some please give a hint?

Schematics:
http://www.l16.fr/temp/vmusic_arduino.jpg

Code:
void setup() {
    Serial.begin(9600);
}

void loop() {
    Serial.print("VPF test.mp3");
    Serial.print(13,BYTE);
    delay(10000);
}

Problem:
The VMUSIC turns on well but does not play any sound... All I want is to command the Vmusic from the Arduino.

I cable the boards as shown on the picture... I pulled-up the jumper pin to activate the serial UART mode instead of SPI.
The TX pin of the arduino seems to send the signal well, but the VMUSIC is not responding even if the LED is green.

Should I format my usb key to a specific standard?
I read that "Disks which do not have a sector size of 512 bytes are not supported".

Am I missing something obvious?

Thanks for your help.
« Last Edit: March 01, 2008, 06:26:57 am by katapulp » Logged

Wuppertal/Germany
Offline Offline
God Member
*****
Karma: 1
Posts: 895
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi katapulp,

Quote
...Am I missing something obvious?


Yes, I think the GND of the Arduino and the GND of the VMUSIC must be connected.

That is very obvious, but since I don't have a VMUSIC myself I can't tell about the rest of  the wiring.

BTW any reason why you don't power the VMUSIC from the Arduino-USB-Supply instead of the external Power-Supply ?

Eberhard



« Last Edit: March 01, 2008, 07:35:47 am by wayoda » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yep, it's working if I connect it without external supply. Does anyone know why?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Yep, it's working if I connect it without external supply. Does anyone know why?

You need to run a ground between arduino and your external power supply; then i bet it will work with external power.
Logged

Brisbane
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi - I've also made some code for the VMUSIC2 that I'd like to share. This works better for me (in our setup) because;
i) Arduino attaches to PC via USB serial, VMUSIC2 attaches to Arduino via softSerial
ii) All commands are available, and there is two-way communication with the VMUSIC2 (particularly good for reading where in the song playback is up to, since the VMUSIC2 sends a time updates every second).

This is slightly buggy, since quite often the VMUSIC2 will respond with 'Bad Command' - but that's the beauty of two-way comms, eh?

Here's the code:

Quote

 

#include <avr/interrupt.h>
#include <SoftwareSerial.h>

#define VMUSIC_CTS 5  //to VMUSIC CTS pin 6 (or ground!)
#define VMUSIC_RX 2  //to VMUSIC TXD pin 5
#define VMUSIC_TX 3  //to VMUSIC RXD pin 4
#define ledPin 13

// set up a new serial port
SoftwareSerial mySerial =  SoftwareSerial(VMUSIC_RX, VMUSIC_TX);  //(RXpin, TXpin)

void setup() {
  Serial.begin(9600);      // opens serial port, sets data rate to 9600 bps

  // define pin modes for tx, rx, led pins:
  pinMode(VMUSIC_CTS, OUTPUT);
  pinMode(VMUSIC_RX, INPUT);
  pinMode(VMUSIC_TX, OUTPUT);
  pinMode(ledPin, OUTPUT);  // declare LED as output
  digitalWrite(ledPin, LOW);

  // set the data rate for the SoftwareSerial port:
  mySerial.begin(9600);

  //This will allow softwareSerial to process incoming automatically:
  attachInterrupt(0, readSoftwareSerial, LOW);

  //Tells VMUSIC that hardware is connected:
  digitalWrite(VMUSIC_CTS, LOW);    
}


void loop() {
  int serialReceived = 0;
  if(Serial.available() > 0){
    noInterrupts();
    digitalWrite(VMUSIC_CTS, LOW);
  }  
  while(Serial.available() > 0){
    char incoming = Serial.read();
    mySerial.print(incoming);
    serialReceived = 1;
  }
  if (serialReceived == 1){
    mySerial.print(13,BYTE);  //carriage-return for VMUSIC2
    serialReceived == 0;
  }
  interrupts();  //re-enable softwareSerial
}


void readSoftwareSerial(){
  noInterrupts();
  digitalWrite(ledPin, HIGH);
  char incoming = mySerial.read();
  Serial.print(incoming);
  digitalWrite(ledPin, LOW);
  interrupts();
}


/* VMUSIC COMMANDS:

VPF·file       Plays a single file eg: "VPF 1.mp3"

VRF·file       Repeatedly plays a single file

VST            Stops playback

V3A            Plays all MP3 files

VRA            Repeatedly plays all MP3 files

VRR            Repeatedly plays random MP3 files

VSF            Skip forward one track

VSB            Skip back one track

VSD            Skip forward one whole directory

VP             Pause playback

VF             Fast forward 5 seconds

VB             Rewind 5 seconds

VRD·byte       Reads command register

VWR·byte+word  Writes command register

VSV·byte       Sets playback volume

*/

 
Logged

Amsterdam
Offline Offline
Full Member
***
Karma: 1
Posts: 139
he's looking at you, kiddy...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

And spend another day finding out a way to format a usb stick with 512bytes per sector on a mac and a pc. Aarrhhgg!!
is there a simple way to do it? disk utility on mac doesnt work, formatting in the explorer in win xp neither.

now i'm playing with the cli tool newfs_msdos but i'm not even shure if that is the right tool for the job.and should i select /dev/disk1 or /dev/rdisk1, or even /dev/disk1s1? no clues here.

it seems that using this tool, i only parially whipe the data. because sometimes it works, sometimes it doens'nt

besies that, if it works, the arduino can control the vmusic very nice.
Logged

--
"We're all in this together..."

Amsterdam
Offline Offline
Full Member
***
Karma: 1
Posts: 139
he's looking at you, kiddy...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

"What happen????. somebody set up us the bomb!!!" :-?

and once of a sudden it works. same sticks, same computer (mac MDD  os x 10.4.9) and disk utilities. first select whole drive and erase as mac os extended, not journaled. then format again as MS_DOS filesystem. eject and voila, working sicks.

How do i know?

make a working serial connection:

remove the atmega from your arduino. pry it off with a  small flatscrewdriver. working your way in from both sides. connect the following signals:

orange to 0 RX.

yelow to 1 TX
red to 5v
black to GND
green to GND

notice that for normal arduino operation, orange goes to 1 TX and yellow to 0 RX
set your terminal program to the right port (in zterm hold the shift after staring up the app and select usbserial-xxxxxx where xxxxx is a unique serialstring)
connection speed: 9600, no handshake, 8n1

if you have a working serial connection between the VMUSIC and your computer watch for the right sequence:

Device Detected P2
No Upgrade
D:\>


after removing notice the line that says:

No Disk

if the stick is not recognized you'll get the shorter version:

Device Detected P2

and nothing more. after removing only:

Device Removed P2

so the best thing to do when starting with the VMUSIC2 is:

1. check the usb stick like mentioned above.
2. upgrade the firmware to the latest from:
http://www.vinculum.com/downloads/firmware/ftrfb_main_03_64VMSC1F.ftd

notice that after pressing enter you also get the D:\> prompt. this does not indicate a working stick

if you send the string
idd

the VMUSIC answers with something like:

USB VID = $0204
USB PID = $6025
Vendor Id = USB
Product Id = FLASH DISK
Revision Level = 5.00
I/F = SCSI
FAT32
Bytes/Sector = $0200
Bytes/Cluster = $001000
Capacity = $391AB000 Bytes
Free Space = $ Bytes


with a non working stick, you will have a empty line where it reads FAT32 and the sizes will all be zeros

good luck!
Logged

--
"We're all in this together..."

Amsterdam
Offline Offline
Full Member
***
Karma: 1
Posts: 139
he's looking at you, kiddy...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

and after asking the vinculum team about the power requirements i got the following reply with a interesting option:

The VNC1L will have a normal operating current of 25mA (idle and play modes)
and the SUM firmware command will put the device into suspend during which
the device will only draw a maximum of 2mA.


i just asked them about the min and max voltages the player will work. (batteries?)

ill keep you posted. but it may take a few days before i get a reply.
Logged

--
"We're all in this together..."

Pages: [1] 2 3 4   Go Up
Jump to: