Shop OBEX P1 Docs P2 Docs Learn Events
Vinculum VMUSIC2 connections to BS2 — Parallax Forums

Vinculum VMUSIC2 connections to BS2

uxoriousuxorious Posts: 126
edited 2010-08-05 18:41 in BASIC Stamp
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-
«1

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-12 16:13
    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.P.O. Posts: 10
    edited 2007-04-17 18:39
    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 SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-04-17 19:08
    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
  • FranklinFranklin Posts: 4,747
    edited 2007-04-17 19:10
    What format are your files in and can you play them on a PC?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-17 19:19
    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.
  • FranklinFranklin Posts: 4,747
    edited 2007-04-17 19:23
    Thanks Mike. (I knew that I was just checking to see if P.O. was using the correct files)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • P.O.P.O. Posts: 10
    edited 2007-04-17 20:11
    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.P.O. Posts: 10
    edited 2007-04-17 20:23
    PS Of course they are legal MP3...
  • T ChapT Chap Posts: 4,223
    edited 2007-04-17 20:40
    PO Did you try the jumpers in any other position? If not, give that a shot and test the results.
  • P.O.P.O. Posts: 10
    edited 2007-04-17 21:32
    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 ChapT Chap Posts: 4,223
    edited 2007-04-17 21:44
    What I mean is try it in SPI jumper mode and see what happens even though you are using serial uart.
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-04-18 00:39
    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.P.O. Posts: 10
    edited 2007-04-18 02:21
    Thanks a million! I will try this tomorrow and post my results...
    P.O.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-18 02:29
    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.P.O. Posts: 10
    edited 2007-04-18 15:06
    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.P.O. Posts: 10
    edited 2007-04-18 18:12
    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"
    '*******************[noparse][[/noparse]INITIALISE]******************
    SEROUT 4,84,[noparse][[/noparse]"ipa",CR]
    PAUSE 2 00
    SEROUT 4,84,[noparse][[/noparse]"scs",CR]
    PAUSE 2000

    for t=1 to 5
    DEBUG CLS,"playing ",dec t
    serout 4,84,[noparse][[/noparse]$1D,$20,dec t,".mp3",$0D]
    pause 33000
    serout 4,84,[noparse][[/noparse]$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.P.O. Posts: 10
    edited 2007-04-18 18:15
    And oh yes, the documentation is exact for the jumper, and for the pinout also 5
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-04-18 22:40
    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.P.O. Posts: 10
    edited 2007-04-19 02:10
    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.,
  • uxoriousuxorious Posts: 126
    edited 2007-04-19 23:59
    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!
    542 x 311 - 48K
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-04-20 00:41
    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.
  • amaltamalt Posts: 1
    edited 2007-04-25 02:51
    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.P.O. Posts: 10
    edited 2007-04-25 13:07
    You just have to look up the thread: the only code i've got up to now is posted there...

    P.O.
  • uxoriousuxorious Posts: 126
    edited 2007-04-29 08:05
    I will post my working code on Monday. (It's only on my work PC currently)
  • uxoriousuxorious Posts: 126
    edited 2007-04-30 17:12
    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"
    '*******************[noparse][[/noparse]INITIALISE]******************
    SEROUT tx,baud,[noparse][[/noparse]"ipa",ret]
    PAUSE 200
    SEROUT tx,baud,[noparse][[/noparse]"scs",ret]
    PAUSE 2000
    '*************************************************
    main:
    FOR t=1 TO 5
    DEBUG CLS,"playing ",DEC t
    SEROUT tx,baud,[noparse][[/noparse]$1D,$20,DEC t,".mp3",$0D]
    PAUSE 33000
    SEROUT tx,baud,[noparse][[/noparse]$20,CR]
    PAUSE 10000
    NEXT

    END
  • Alexander DumasAlexander Dumas Posts: 9
    edited 2007-05-01 14:03
    Cool... I've ordered VMUSIC2 and would really appreciate seeing the code.

    Thanks in advance.
  • NerdicusMaximusNerdicusMaximus Posts: 11
    edited 2007-11-09 19:18
    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"
    '*******************[noparse][[/noparse]INITIALISE]******************
    SEROUT 0,,[noparse][[/noparse]"ipa",CR]
    PAUSE 2000
    SEROUT 0,84,[noparse][[/noparse]"scs",CR]
    PAUSE 2000

    t=1
    DEBUG CLS,"playing ",DEC t
    SEROUT 0,84,[noparse][[/noparse]$1D,$20,DEC t,".mp3",$0D]
    PAUSE 5000
    SEROUT 0,16468,[noparse][[/noparse]$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
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-11-09 19:44
    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,[noparse][[/noparse]................

    hope this helps

    Jeff T.
  • uxoriousuxorious Posts: 126
    edited 2007-11-09 21:42
    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 ~~
  • NerdicusMaximusNerdicusMaximus Posts: 11
    edited 2007-11-14 00:37
    Jeff T. you are the man.

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

    Thanks so much for the help.

    B
Sign In or Register to comment.