June 23, 2024, 01:21:50 PM

News:

You can now use Vixen to program your Prop-1 and Prop-2 controllers!  Get started quickly and easily, without having to learn PBASIC.  Details in the Library forum.


Need help with prop1 and vmusic2

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

Previous topic - Next topic

tugman

I reloaded the program and the vm2 is powered up by the prop1 and still nothing.
I added the lines of code.  It did not play the first song.

JonnyMac

Well, then, there is a connection problem.  You said that it worked yesterday, so I'm baffled; I copied the [working] routines from the new VMUSIC program and added them into the button stuff.

Did you change the file names in the new program?
Jon McPhalen
EFX-TEK Hollywood Office

tugman


livinlowe

Keep at it Tugman! Soon you'll be the resident expert on Prop-1 to Vmusic connections!
Shawn
Scaring someone with a prop you built -- priceless!

JonnyMac

Well, heck... it's up to you, Tugman, you have all the hardware.  I think it's fair to say that we've demonstrated the [individually] working parts -- you just have to knit them together.  I don't have one of those button boards so there's nothing more I can do.
Jon McPhalen
EFX-TEK Hollywood Office

tugman

(Stern Mode on)  Yes we  have demonstrated that I have the switches wired correctly because in the debug it gives the proper outputs.
I have the vmusic wired correctly because it worked with a different program. So what is left- Oh! the code so now you are just going to leave me hanging.  After all this work and expense. Thanks for your ,as you call it, robust code.  (Stern mode off)

JonnyMac

The code works -- I just ran it again

Mind you, I have to use jumper wires to simulate the 2-pin inputs for buttons 5-8 but I have verified that that all files work.  Even then, I updated the code (having nothing to do with starting a file on the VMUSIC) to account for the chunkiness of the jumper wire inputs; this will prevent a file from restarting if you hold the button down too long.  Se the updated (just the Force_Release section and files list) program above.

If there's anything [reasonable] that you think I can do, please tell me.  Right now I'm at my whit's end.
Jon McPhalen
EFX-TEK Hollywood Office

gadget-evilusions

Quote from: tugman on May 29, 2009, 11:37:34 AM
(Stern Mode on)  Yes we  have demonstrated that I have the switches wired correctly because in the debug it gives the proper outputs.
I have the vmusic wired correctly because it worked with a different program. So what is left- Oh! the code so now you are just going to leave me hanging.  After all this work and expense. Thanks for your ,as you call it, robust code.  (Stern mode off)

It looks to me that Jon has been more than helpful in trying to get a product that EFX-TEK dosen't even produce, work with a product they do (something most companies wouldn't dream of doing for you). Making fun of Jon's code, when he obviously has it working himself on the exact same products you have, probably isn't the best thing to do to the most helpful support guys in any industry that I know of. Just saying. I can see where this would be most frustrating for you and Jon, but I don't exactly think he has left you hanging. I am sure you will get it to work. Everyone of Jon's programs, and I have 100's of them, work flawlessly. Anytime I have had a problem, it was my fault.
Brian
Evilusions LLC
www.evilusions.com for all your pneumatic components

tugman

Jon, I went back and ran Scarry terrys demo again and it worked.  He used serin and serout pins 0 & 1. so I thought since we were using 6 &7 I would change his program to those pins and it still worked. So I went  to your try this first program
    ' =========================================================================
'
'   File...... VMusic.BS1
'   Purpose...
'   Author.... Jon Williams, EFX-TEK (www.efx-tek.com)
'   E-mail.... jwilliams@efx-tek.com
'              Copyright (c) 2008-2009 EFX-TEK
'              Some Rights Reserved
'              see: http://creativecommons.org/licenses/by/3.0/us/
'   Started...
'   Updated... 28 MAY 2009
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
'
' Demo for VMUSIC2 player
' -- 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
' -- use P5 for Sio (no ULN) to EFX-TEK accessories
' -- use P4 for (active-high) trigger


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


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

SYMBOL  RX              = 7                     ' SETUP = UP, no ULN
SYMBOL  TX              = 6                     ' SETUP = UP, no ULN
SYMBOL  Sio             = 5                     ' no ULN
SYMBOL  Trigger         = 4


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

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

SYMBOL  Yes             = 1
SYMBOL  No              = 0

SYMBOL  VolMax          = 0
SYMBOL  VolMin          = $FE

SYMBOL  Baud            = OT2400


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

SYMBOL  theMP3          = B2                    ' MP3 file pointer
SYMBOL  eePntr          = B3                    ' EEPROM memory pointer
SYMBOL  char            = B4                    ' character value
SYMBOL  mute            = B5                    ' mute level (0 = loudest)
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 AHOY.MP3", CR
  theMP3 = 0
  GOSUB VM_Play
  GOSUB VM_Wait_Start
  DEBUG "-- file started", CR

  PAUSE 5000
  mute = 25
  GOSUB VM_Mute
  GOSUB VM_Wait_Prompt
  DEBUG "-- volume level reduced", CR

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

  mute = VolMax                                 ' restore full volume
  GOSUB VM_Mute
  GOSUB VM_Wait_Prompt
  DEBUG "-- volume reset to max", CR, CR

  DEBUG "Playing SHRTSONG.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 ]-----------------------------------------------------

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

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

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

VM_Play:
  SEROUT TX, Baud, ("VPF ")
  GOTO Play_MP3

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

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

VM_Repeat:
SEROUT TX, Baud, ("VRF ")

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

Play_MP3:
  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

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

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

VM_Mute:
  mute = mute MAX VolMin                        ' limit per spec
  SEROUT TX, Baud, ("VSV ", #mute, 13)
  RETURN


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

' File names are stored on 8-byte boundaries -- this is very important for
' correct program operation.  This strategy uses a little more EE space but
' is easier to update and maintain

Song_List:
  EEPROM $00, ("AHOY")                       ' theMP3 = 0
  EEPROM $08, ("SHRTSONG")                      ' theMP3 = 1
  EEPROM $10, ("FOGHORN")
  EEPROM $18, ("LNGSONG")
  EEPROM $20, ("POPLAUGH")
  EEPROM $28, ("POPTOOT")
  EEPROM $30, ("BLOWMEDN")
  EEPROM $38, ("SHIVRME")


It comes up in the debug screen that it is playing AHOY but it isn't really, can't hear a thing.  I noticed in the baud window it said 4800.  I had just ran the scarry terry file and it ran at 2400 and worked.  Could this be why this file won't play and if so how do I fix it.

I am sorry about the little tyrate earlier I just get so frustrated with this thing.  I just don't have the knowledge to debug this stuff.

JonnyMac

The communications between the Prop-1 and the Debug terminal is 4800 baud; this has nothing to do with comms to the VMUSIC.

If you can get Terry's demo to work then the code I provided -- which is working on my desk -- will work, too; it's a matter of connections and configuration.  I know we've gone over these things before but it's the smallest things that seem to bite hardest.

A) Make sure that you have the P6 and P7 SETUP jumpers moved to the UP position
B) Make sure that you have pins 1 and 2 of the ULN2803 clipped off -- the ULN will interfere in the serial mode I'm using
C) Make sure the pin called RX on the Prop-1 (P7) is connected to the TX pin of the VMUSIC
D) Make sure the pin called TX on the Prop-1 (P6) is connected to the RX pin of the VMUSIC

What cable are you using to connect between the Prop-1 and VMUSIC?  Ironically, I'm using a cable built by Scary Terry (he built them for a local haunt group and sent me one).

I won't bore you with the technical details as to why I code differently than Terry, but I'm asking you to trust that the reason is not willy-nilly.  I've been coding professionally for a long time and make deliberate decisions about every program I design/write.

Here's my test setup for your program; note that the P6 and P7 SETUP jumpers are in the UP position and I'm using "connectomundos" to simulate the switch inputs.

Jon McPhalen
EFX-TEK Hollywood Office

tugman

Jumpers are in the up position
the pins 1 and 2 are clipped
and the rx and tx are correct
The yellow wire from the vmusic is going to p7
The orange wire from vmusic is going to p6

The cable from prop 1 to vmusic I put together

JonnyMac

You say that you can use ST's demo on P6 and P7, right?  If that is the case then the only thing that I can think that would cause my code not to work on your setup is that the ULN on P6 or P7 is still connected.  Did you remove the ULN to clip pins 1 and 2?  From your picture it looks like the wires are going to the right places but I can't tell if the ULN pins are completely severed or not.  Let me suggest you pull the ULN from its socket and clip those pins completely and remove the severed legs from the socket if they are still there.
Jon McPhalen
EFX-TEK Hollywood Office

tugman

No, Jon I did pull the uln out and clipped them. The clipped ends are not in the socket and haven't been from the start

JonnyMac

May 30, 2009, 08:10:34 AM #58 Last Edit: May 30, 2009, 08:20:19 AM by JonnyMac
Well, I give.  While I don't think using True mode with the VMUSIC is a good idea you say that it's working for you (via Terry's demo), so let's change your program (note to other customers -- this is a desperate move on my part and NOT recommended) as a test.

Change the Baud constant to T2400

Right after the Reset label and before the PAUSE line add:

  HIGH TX

If this version of the code doesn't work then you have a bad connection in the RX line.  My code waits for a response from the player, Terry's doesn't.
Jon McPhalen
EFX-TEK Hollywood Office

tugman

You didn't specify which program to run this on so I tried it on the demo and the one using the buttons and neither one worked.
So your saying because this did not work I have a problem with the rx line.  Are you talking about the rx line on the vmusic or the prop1?  Anyway, I checked the rx and tx continuity from the actual solderpoints on the prop1 to the vmusic circuit boards just to make sure it wasn't getting lost in the connectors.  Everything checked good.

Is there a chance you could write a real simple program to play just one of the tracks over and over.  Maybe using button number one that has just one output.
This way we could temporarily eliminate the fancy button selection and song look up stuff just to get things talking to one another. It might reveal something.  Or if you have a better idea for test.  Just a thought.