PDA

View Full Version : Vinculum VMUSIC2 connections to BS2



uxorious
04-12-2007, 10:59 PM
I am a newbie to the Basic Stamp but have been involved in electronics for a long time. (My first basic programming was on a TRS-80 in junior high and I have been in PCB Mfg since '91). In the last month or so I have obtained a homework board, professional development board, a BS2, a text to speech module, a VMUSIC2 module, and various other parts. I have several Stamp projects on my plate, but one in particular is giving me trouble (due to my lack of Stamp experience). Here are the details:

My daughter has a Power Wheels Mustang GT and since we have a year or so before she can reach the pedals, I have come up with several mods I would like to do to it. Some are simple like adding working headlights, tailights, remote kill, etc. One mod consists of rewiring the two buttons and speaker on the existing "radio" to be used with a Basic Stamp and Vinculum's VMUSIC2 USB/MP3 module. See http://www.vinculum.com/prd_vmusic1.html#vmusic2

The VMUSIC2 has UART connections of GND, RTS#, 5V, RXD, TXD, and CTS#. I am having trouble interfacing this with the BS2. I have searched several posts, but nothing gave me a standard answer for connecting a BS2 to a serial UART. Most are specific to a particular project. However, from the posts, I believe I should be using a MAX232? Any ideas and or tips as to properly interfacing between my BS2 and the VMUSIC2 would be greatly appreciated. I know you can connect the VMUSIC2 to a PC via USB using the USB-TTL cable from Vinculum ( http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm ). Aren't the outputs of the BS2 at TTL level?

thanks,
Dru-

Mike Green
04-12-2007, 11:13 PM
The I/O pins of the BS2 can be directly connected to the VMUSIC2. Because of the possibility of programming errors, it's generally a good idea to use a series resistor in the leads, typically 220 ohm to 1K. You don't need a UART because the BS2 SERIN/SEROUT statements function as one. The minimum connection would be RX and TX each connected through a 1K resistor to a Stamp pin, RTS# left unconnected, and CTS# connected directly to ground. The ground connections of the VMUSIC2 and the Stamp have to be connected and the VMUSIC2 needs a source of regulated +5V. The BS2's on-substrate regulator can't supply enough current, but the development board's 5V regulator is fine. The Homework Board, if it's revision C or D , has enough current capacity. It also has the 220 ohm series resistors built-in.

Post Edited (Mike Green) : 4/12/2007 4:17:42 PM GMT

P.O.
04-18-2007, 01:39 AM
Hi.
sorry to barge in, but have you tried this yourself?
I'm in the same situation, trying to interface a BS2 to the Vmusic2 module.
Tried the connection you suggest, no response from the Vmusic.
Tried the "VPF" (play a file) and the "V3A" (play all mp3 files) commands with no results...

thanks, P.O.

Chris Savage
04-18-2007, 02:08 AM
Hello,

Both Mike and myself have used some of the Vinculum Evaluation Boards and while I myself haven’t seen the VMusic 2 I believe the chip connections are the same. The Vinculum Chip is compatible with the BASIC Stamp 2 so it should work. Take care.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support

Franklin
04-18-2007, 02:10 AM
What format are your files in and can you play them on a PC?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen

Mike Green
04-18-2007, 02:19 AM
P.O.,
Although I tried the VDIP1 with a Stamp initially, most of my work with the Vinculum devices has been with a Propeller. I have used a VMUSIC2 with a Propeller and it hooks up just the same as the VDIP1 (the internal chip is the same). Make sure the jumper is set properly for the serial interface (UART) and make sure CTS# is connected properly.

Franklin,
The files are supposed to be standard MP3 files that you can download or convert from CD tracks or record directly on a PC or Mac and copy to a standard thumb drive.

Franklin
04-18-2007, 02:23 AM
Thanks Mike. (I knew that I was just checking to see if P.O. was using the correct files)

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen

P.O.
04-18-2007, 03:11 AM
Yes, the jumper is set up for UART.
As for the files, they are on a SD card through a USB carrier. They're from my Macintosh: Although I can't check to see if they play on a PC 'cuz my PC is really helpless, the Mac reports the SD card & carrier combo as "DOS" formatted... I guess I should check this more seriously....

P.O.

P.O.
04-18-2007, 03:23 AM
PS Of course they are legal MP3...

T Chap
04-18-2007, 03:40 AM
PO Did you try the jumpers in any other position? If not, give that a shot and test the results.

P.O.
04-18-2007, 04:32 AM
Well, there is only one jumper!
I tried it on the supposedly UART position, and I tried without the jumper- it is supposed to default to UART function that way.

unless there are other jumpers inside the case I should care about??

P.O. e

T Chap
04-18-2007, 04:44 AM
What I mean is try it in SPI jumper mode and see what happens even though you are using serial uart.

Unsoundcode
04-18-2007, 07:39 AM
Hi, allthough I don't have a vmusic the firmware is an extension of the vdap firmware so I was thinking the way to control the two is very similar.

Just to make sure on the connections, looking down on the top of the vmusic,

Pin 8 (R#)·····Blue........not connected
Pin 6 (CTS#) Green......connected to Vss
Pin 5 (TXD)·· Yellow.....connect to Stamp P1 (for this example)
Pin 4 (RXD)·· Orange....connect to Stamp P0 (for this example)
Pin 3 (5V0)··· Red........connect to Vdd
Pin 2 (RTS#)· Brown.....not connected
Pin 1 (GND)··· Black......connect to Vss

Jumper .......middle pin to left pin (as Mike and TChapman pointed out this jumper is important and has been described wrongly in the docs before. Try all three jumper possibilities with the following code before you give up)

I·am·unable·to try this but its worth a shot. The file extensions on the thumdrive must be MP3.

Jeff T.

·EDIT .......sorry I should say the jumper is looking down from the back when I say left pin.

Post Edited (Unsoundcode) : 4/18/2007 12:57:16 AM GMT

P.O.
04-18-2007, 09:21 AM
Thanks a million! I will try this tomorrow and post my results...
P.O.

Mike Green
04-18-2007, 09:29 AM
You should also try swapping the receive and transmit pins. I forget which way it is with the VMUSIC2, but sometimes these devices have TX and RX relative to the device itself and sometimes they have it relative to the controller.

P.O.
04-18-2007, 10:06 PM
Thak you all for your great response. I will keep you posted of the results, but it may take a while: the "Vmusic.bs2" that was proposed uses PBasic 2.5. What I use here to program my Stamps is an old portable PC running DOS. My version of the Stamp programmer does not parse the new commands such as DEBUGIN. I will have to find a way to make this work...

P.O.

P.O.
04-19-2007, 01:12 AM
Success!
I have made a program using bits of Vmusic.bs2 that plays 33 seconds of the five mp3s stored on my cart, named 1 to 5.


'RXd=pin 4

t VAR nib

DEBUG "Please Wait"
'*******************[INITIALISE]******************
SEROUT 4,84,["ipa",CR]
PAUSE 2 00
SEROUT 4,84,["scs",CR]
PAUSE 2000

for t=1 to 5
DEBUG CLS,"playing ",dec t
serout 4,84,[$1D,$20,dec t,".mp3",$0D]
pause 33000
serout 4,84,[$20,CR]
pause 10000
next
end



Problems I had: used 16468 for baudrate instead of 84; My version of Stamp program does not understand "ret". There was some confusion as to what to use (CR, $0D, dec 13)...; I did not use any initialisation...

So now I'm on to a good start. Warm thanks to all who responded!

P.O.

P.O.
04-19-2007, 01:15 AM
And oh yes, the documentation is exact for the jumper, and for the pinout also 5

Unsoundcode
04-19-2007, 05:40 AM
Good deal P.O, I am pleased you figured it out and filled in the missing spaces. Hopefully when you have finished your project you can post it here for the rest of us to learn by.

regards

Jeff T.

P.O.
04-19-2007, 09:10 AM
Well, yes... it may take a while: the final project is to have a troop of MP3 players that are controlled by a "central srutinizer". For that I'll ned adressable MP3 players, which means I'll need to make every player adressable. I might make a serial network which will each have a PICAXE controller to respond to their own address using the SERIN and "wait" commands.
I also communicated with the Rogue Mp3 player. Hell, I might even try to speak to the Olimex MOD-MP3 player that stubbornly refused any collaboration up to now...

anyways, I'll keep you posted.

P.O.,

uxorious
04-20-2007, 06:59 AM
I was tied up with another BS2 project using a test to speech module and forgot I posted this thread. First of all, thanks for all the input. Second, I now have a USB to TTL-232R-3.3V cable and confirmed that the Vmusic2 will play with my memory stick using the Vplay app from Vinculum. After that I tried to make up Unsoundcode's circuit on my homework board. I laid it out and it ran first shot. However, it seems to never receive the ">" that it should from the Vmusic after it runs the code to play all tracks or it comes back before the BS2 is ready for it. If I remove the SERIN lines it works. I also tried P.O.'s code and it played my five tracks perfectly. I'll upload code when I get it cleaned up and setup with the Powerwheels radio. Thanks!

Unsoundcode
04-20-2007, 07:41 AM
Thanks for the feedback &y. I dont have a Vmusic and was kind of working from the firmware docs. If you can run without the serin just leave it like that. I think what you and P.O really needed was probably the initialisation part of the code, I think the rest you both already knew. I threw in the play and stop routines·hoping it would be close enough for you guys to adjust to where it would work, and you did, nice job both.

As a side note now you have the 232 to ttl cable should you ever buy a Vdrive2 you can use a little app called V2eval that I used to get familiar with the Vdap commands, it·might also be good with the Vmusic2. At this link.

http://forums.parallax.com/showthread.php?p=637301

Jeff T.

amalt
04-25-2007, 09:51 AM
PO

Do you have a small code sample.· I have been trying this for several days and not having any luck.

I have a BS2P24

thanks

P.O.
04-25-2007, 08:07 PM
You just have to look up the thread: the only code i've got up to now is posted there...

P.O.

uxorious
04-29-2007, 03:05 PM
I will post my working code on Monday. (It's only on my work PC currently)

uxorious
05-01-2007, 12:12 AM
Here's my code for doing the same thing that PO is doing, but using my setup as in the previous picture. I am still tweaking my code for what could be called a "digital 8 track". I am setting this circuit up and it will play 16 songs, split it a sequence of 4 "tracks". You can jump to a specific track by means of a push button. When the 4 songs on a "track" is finished, it goes to the next track, just like the old 8 track players. I'll also have a switch that disables the next "track" feature so it will play 4 songs then shutdown.


' {$STAMP BS2}
' {$PBASIC 2.5}

stop_track CON $20
all_tracks CON $21
ret CON $0D
baud CON 84
tx CON 0
rx CON 1

key VAR Bit
t VAR Nib

DEBUG "Please Wait"
'*******************[INITIALISE]******************
SEROUT tx,baud,["ipa",ret]
PAUSE 200
SEROUT tx,baud,["scs",ret]
PAUSE 2000
'*************************************************
main:
FOR t=1 TO 5
DEBUG CLS,"playing ",DEC t
SEROUT tx,baud,[$1D,$20,DEC t,".mp3",$0D]
PAUSE 33000
SEROUT tx,baud,[$20,CR]
PAUSE 10000
NEXT

END

Alexander Dumas
05-01-2007, 09:03 PM
Cool... I've ordered VMUSIC2 and would really appreciate seeing the code.

Thanks in advance.

NerdicusMaximus
11-10-2007, 02:18 AM
I have the same issue. I have a Vmusic2 and a stamp BS2px with the development board on my desk. I am following the suggested program seen on this forum, but it won't play anything.

' {$STAMP BS2px}

'RXd=pin 0

t VAR Nib

DEBUG "Please Wait"
'*******************[INITIALISE]******************
SEROUT 0,,["ipa",CR]
PAUSE 2000
SEROUT 0,84,["scs",CR]
PAUSE 2000

t=1
DEBUG CLS,"playing ",DEC t
SEROUT 0,84,[$1D,$20,DEC t,".mp3",$0D]
PAUSE 5000
SEROUT 0,16468,[$20,CR]
PAUSE 2000
DEBUG "end"

my track is on a thumbdrive... called 1.mp3

It should play, right? What am I doing wrong?

B

Unsoundcode
11-10-2007, 02:44 AM
Hi, possibly the biggest thing you need to correct is the baud rate. The default baud for the Vmusic is 9600 which for the BS2px is 396. So all of the SEROUT statements need correcting to read SEROUT 0,396,[................

hope this helps

Jeff T.

uxorious
11-10-2007, 04:42 AM
Also, make sure your thumbdrive is compatible with the Vmusic2. When you plug it in, the light should come on red, blink, then go green after a few seconds showing the drive has initialized. Unfortunately, I lost my code and also can't get my vmusic to even come on right now, so I can't try anything else.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
~~ dRu ~~

NerdicusMaximus
11-14-2007, 07:37 AM
Jeff T. you are the man.

My bad, I can't believe I blew that one.

Thanks so much for the help.

B

PJMonty
12-08-2007, 10:05 AM
I just received my VMUSIC2 module, but I'm wondering if I got a bad one. When you apply 5V and ground (with no flash drive plugged into it), does the LED on the front light up to indicate power? Mine just stays turned off.

I have tried plugging in a flash drive, but that didn't make the LED light or blink. I also tried connecting it to my PC via a TTL->RS232 converter board, but I get no data coming into the PC when power is applied to the VMUSIC2 module.

I'm using a regulated 5v supply and can verify 3.3 volts on the SPI/UART selection header.

Thanks,
PeterM

Unsoundcode
12-09-2007, 05:10 AM
I think the drive reacts differently dependent on whether you have the jumper on SPI or UART. Whichever mode I think you should get a short blink when you apply power.

In SPI·mode the blink is all you get, even plugging the memstick in the LED remains unlit.

With UART the LED lights when you insert the stick and remains lit.

I have not compared the two modes recently but that is how I remember it.

Jeff T.

scary terry
05-16-2008, 03:55 AM
I've got a web page with some simplified info on using the VMusic2 with a BS1 or BS2 at: http://www.scary-terry.com/vm2/vm2.htm

wes thierry
08-05-2010, 11:05 PM
I have been trying to get my VMusic working with this code with no success. I tried updating the firmware with a 4 gb flash drive, but maybe the vmusic cant recognize a drive that big? Is there a way to take a USB cable or serial cable and wire an interface directly to the computer so I can re-flash it?

wes thierry
08-06-2010, 01:41 AM
guess most of the problems is with the flash drives. I found an old 32 mb flash drive, and it all works flawlessly