May 11, 2024, 02:17:53 AM

News:

Be sure to checkout our Vixen interfaces in the Library forum -- if you want PC automation at near zero cost, EFX-TEK and Vixen is a great combination of tools.


Need help with prop1 and vmusic2

Started by tugman, April 09, 2009, 04:59:03 PM

Previous topic - Next topic

JonnyMac

For the record, I think the VMUSIC is a great big pain in the backside -- I really don't like it and frequently recommend the Rogue uMP3. 

Just to make sure my code was working I dragged out my VMUSIC and tried to get it to reflash from the USB stick -- no luck, and this is no surprise; Scary Terry discusses it here: http://www.scary-terry.com/vm2/vm2_trouble.htm

Luckily, I have all the correct cables and after a couple tries was finally able to reflash the VMUSIC from the PC; I think I will just leave it set at 2400 and forget about it.  I went ahead and updated my code to make it easier to add more files; this uses a few more bytes of EE space but it means you don't to manually find the address of the first character of your file names, all you have to do is pass a song # (0 to n) in "theMP3".

' =========================================================================
'
'   File...... VMusic.BS1
'   Purpose...
'   Author.... Jon Williams, EFX-TEK (www.efx-tek.com)
'   E-mail.... jwilliams@efx-tek.com
'   Started...
'   Updated... 14 APR 2009
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
'
' Demo for VMUSIC2 player; based on work by "Scary" Terry Simmons
' -- P7 and P6 SETUP jumpers need to be in the UP position
' -- clip pins 1 and 2 from ULN2803, or pin 1 from the ULN2003
' -- trigger on P5 must be active-high; ULN acts as pull-down


' -----[ Revision History ]------------------------------------------------


' -----[ I/O Definitions ]-------------------------------------------------

SYMBOL  RX              = 7                     ' SETUP = UP, no ULN
SYMBOL  TX              = 6                     ' SETUP = UP, no ULN
SYMBOL  Trigger         = PIN5                  ' active-high input


' -----[ Constants ]-------------------------------------------------------

SYMBOL  Baud            = OT2400

SYMBOL  IsOn            = 1                     ' for active-high in/out
SYMBOL  IsOff           = 0

SYMBOL  Yes             = 1
SYMBOL  No              = 0


' -----[ Variables ]-------------------------------------------------------

SYMBOL  theMP3          = B2                    ' MP3 file pointer
SYMBOL  char            = B3                    ' character value
SYMBOL  eePntr          = B4                    ' EEPROM memory pointer
SYMBOL  volume          = B5

SYMBOL  idx             = B6                    ' loop controller


' -----[ Initialization ]--------------------------------------------------

Reset:
  PAUSE 2250                                    ' let VMUSIC power up
  GOSUB VM_Stop                                 ' stop if playing
  GOSUB VM_Wait_Prompt


' -----[ Program Code ]----------------------------------------------------

Main:
  DEBUG CLS, "Playing FIREFLY.MP3", CR
  theMP3 = 0
  GOSUB VM_Play
  GOSUB VM_Wait_Start
  DEBUG "-- file started", CR

  PAUSE 5000
  volume = 25
  GOSUB VM_Volume
  GOSUB VM_Wait_Prompt
  DEBUG "-- volume reduced", CR

  GOSUB VM_Wait_Prompt
  DEBUG "-- ready for new song", CR

  volume = 0
  GOSUB VM_Volume
  GOSUB VM_Wait_Prompt
  DEBUG "-- volume reset to max", CR, CR

  DEBUG "Playing SERENITY.MP3", CR
  theMP3 = 1
  GOSUB VM_Play
  GOSUB VM_Wait_Start
  DEBUG "-- file started", CR, CR

  GOSUB VM_Wait_Prompt
  DEBUG "VMUSIC demo done", CR, CR

  PAUSE 5000
  GOTO Main


' -----[ Subroutines ]-----------------------------------------------------

' Pass file # (index in EEPROM table) to play in "theMP3"

VM_Play:
  SEROUT TX, Baud, ("VPF ")                     ' start of commands
  eePntr = theMP3 * 8                           ' calc address of name

Send_Name:                                      ' send file title
  FOR idx = 1 TO 8                              ' max is 8 characters
    READ eePntr, char                           ' get a character
    IF char = 0 THEN Finish_Cmd                 ' if 0, we're at end
    SEROUT TX, Baud, (char)
    eePntr = eePntr + 1
  NEXT

Finish_Cmd:
  SEROUT TX, Baud, (".MP3", 13)                 ' send extention + CR
  RETURN

' -------------------------------------------------------------------------

VM_Wait_Start :
  SERIN RX, Baud, ("T $")
  RETURN

' -------------------------------------------------------------------------

VM_Stop:
  SEROUT TX, Baud, ("VST", 13)
  RETURN

' -------------------------------------------------------------------------

VM_Pause:
  SEROUT TX, Baud, ("VP", 13)
  RETURN

' -------------------------------------------------------------------------

VM_Resume:
  GOTO VM_Pause

' -------------------------------------------------------------------------

' Pass volume (0 = loudest, 254 = muted) in "volume"

VM_Volume:
  volume = volume MAX $FE                       ' limit per spec
  SEROUT TX, Baud, ("VSV ", #volume, 13)
  RETURN

' -------------------------------------------------------------------------

VM_Wait_Prompt:
  SERIN RX, Baud, (">")
  RETURN

' -------------------------------------------------------------------------


' -------------------------------------------------------------------------


' -----[ User Data ]-------------------------------------------------------

' File names are stored on 8-byte boundaries - be sure to add 0 (zero) to
' EEPROM statement to ensure end-of-string indicated when name is less than
' eight characters.
'
' This strategy uses a little more EE space but is easier to maintain

Song_List:
  EEPROM $00, ("firefly", 0)                    ' file 0
  EEPROM $08, ("serenity", 0)
  EEPROM $10, ("spalding", 0)
  EEPROM $18, ("file3", 0)
  EEPROM $20, ("file4", 0)
  EEPROM $28, ("file5", 0)
  EEPROM $30, ("file6", 0)
  EEPROM $38, ("file7", 0)

Jon McPhalen
EFX-TEK Hollywood Office

tugman

     OK, I now have the correct usb adapter and can now download the program.  I have the files loaded into the thumbdrive and it seems to load correctly.  It flashes then the led on the vmusic goes from red to green.  It appears that this is working? 
     I have wired the vmusic to the prop 1 per your instructions.  I have 5 volts on the common of the push button switches (checked it with a meter).  When I push each button I have voltage on the correct w pins corresponding to the correct pb switch.
     One thing I'm not totally sure about is the setup jumpers on the prop 1.  I have the p7 jumper set to up and p6 jumper set to low.
     I am using a headset plugged into the vmusic to listen for the sounds.  When I push the bottons I get no sounds and the thumbdrive doesn't flash.
Got any ideas?

JonnyMac

You'll note that in the programs I written for this it says for TX and RX that SETUP = UP.  If you move the jumpers things should start working -- so long as the VMUSIC is set to the correct baud.  I got mine working again last week (at 2400, had been using it at 38.4K) but it was a big hassle that required re-flashing the VMUSIC via the PC.  Oi....
Jon McPhalen
EFX-TEK Hollywood Office

tugman

I have changed the jumper and still nothing.  If I need to reflash and do the baud rate change do I need to buy that special TTL cable from the vmusic folks or can I make one and plug it into the efx-tek usb adapter? Will this work?  I have their pinout.

JonnyMac

*Theoretically* you can re-flash the VMUSIC by dropping the updated firmware file onto you memory stick, then powering up the VMUSIC.  I've had this work in the past, but not recently which is what forced me to re-flash using the PC.  Did you put the 2400 baud file on the thumb drive and rename it as required?

Our friend, Scary Terry, did a big write up on the VMUSIC -- there's lots of good information on his site and I check it out quite frequently.
-- http://www.scary-terry.com/vm2/vm2_bs1.htm

Just note that my program uses different connections than Terry's.
Jon McPhalen
EFX-TEK Hollywood Office

tugman

Yes, I did put the file in the thumbdrive and renamed it and wired it according to your print.  They talk about a special ttl cable to re flash from the computer.  I have the pinout for their rear connector and I would like to know if I can make my own cable from their rear connector to a female 9 pin and plug that into the efx-tek usb adapter to do the reflash. Or do I need to buy that special cable, or do you have a better idea?

JonnyMac

I happened to have one of those cables so I was able to re-flash my VMUSIC.  The problem with that cable is that it has 0.1" (2.54mm) pin sockets and the pins on the VMUSIC are spaced at 2.0mm -- honestly, I'm not impressed with the VMUSIC at all.  What I did was clip one of the connectors from the cable that came with VMUSIC and solder mail pin headers to it; this allowed me to plug into the other cable.

I don't know what signals are required for re-flashing so the safest thing is to have their cable.
Jon McPhalen
EFX-TEK Hollywood Office

tugman

Quote from: JonnyMac on April 22, 2009, 04:13:54 PM
I happened to have one of those cables so I was able to re-flash my VMUSIC.  The problem with that cable is that it has 0.1" (2.54mm) pin sockets and the pins on the VMUSIC are spaced at 2.0mm -- honestly, I'm not impressed with the VMUSIC at all.  What I did was clip one of the connectors from the cable that came with VMUSIC and solder mail pin headers to it; this allowed me to plug into the other cable.

I don't know what signals are required for re-flashing so the safest thing is to have their cable.

Jon I have been out of town for a while and waiting on parts. So here is where I am.  I have music player connected with the 8 sw's wired as you described.  I have wired the vmusic per your instructions.
I have reflashed the vmusic with the special cable and it seemed to work.  The baud is set at 2400.  When I push any of the buttons nothing happens.  I put a scope on the tx and rx pins to see if anything was being sent to the vmusic and I see nothing there but there is a high signal from the individual sw's to the inputs on the prop 1 when each button is pressed.  I have both setup jumpers in the up position and I have cut the  pins 6&7off of the chip as described. I reloaded the program into the prop 1 and it went through just fine, still nothing. any ideas?  Tugman

JonnyMac

Test things one step at a time -- the first thing you need to do is get the VMUSIC working with the Prop-1; after that, everything should be easy.
Jon McPhalen
EFX-TEK Hollywood Office

tugman

Jon,  I am new to all of this and am not sure what to do next.  The program is in the prop 1.  The inputs from the switches are being sent to the prop1 but there seems to be  no output from the prop1 to the vmusic. I checked it with a o-scope. At first I thought the vmusic was the problem but then I saw that there was no signal being sent to the vmusic  from the prop1 tx pin when the buttons are pushed.  I disconnected the vmusic to make sure nothing was being loaded down, still nothing at the tx.  I'm stuck.  Could it be that the prop1 program isn't processing the switch closures.  That's what it looks like to me but I'm no programmer that's for sure.  I've checked everthing 2 or three times.  When the buttons are pressed I should see something on the tx pin shouldn't I ?  Thanks for any ideas of things I can do next.

JonnyMac

I have posted a program that demonstrates the Prop-1/VMUSIC -- get it working first, then we'll tackle the switches.  Like a building, we often have to build a program one "brick" at a time.

Jon McPhalen
EFX-TEK Hollywood Office

tugman

OK, could you tell me where to find this  " program that demonstrates the Prop-1/VMUSIC" I just want to make sure I get the right one so we are on the the same page.

JonnyMac

I posted it in this thread!  ;D -- look back a few messages to where I start off by saying the VMUSIC is a big pain in the backside.  You will need to change the file names in the program to match what you have on your memory stick.
Jon McPhalen
EFX-TEK Hollywood Office

tugman

Well I tried the thread you posted and it didn't work. I then tried a vmusic trainer board and the sample program that blinks the lights.  I just wanted to make sure I was downloading the programs the correct way and to see if I could anything at all to work.  That worked just fine.  Then I tried the Scarry Terry demo program for the vmusic.  That did not work.  I reflashed the vmusic again, with the proper ttl cable, still nothing.  I'm beginning to wonder if the vmusic is bad.  I think it was Scarry Terry or Big Rez that wrote that his experience was 10 percent of them are bad from the start.  Thoughts or ideas.  Help!  Tugman

JonnyMac

I don't know what else to suggest except another VMUSIC.  I know that my code an Terry's code works, and that others have used the program successfully.
Jon McPhalen
EFX-TEK Hollywood Office