EFX-TEK

TEK Talk => Audio => Rogue Robotics uMP3 Player => Topic started by: Ryanm0085 on July 27, 2010, 04:25:08 PM

Title: Prop-2 Test Code for uMP3
Post by: Ryanm0085 on July 27, 2010, 04:25:08 PM
i am just looking for a basic code to make sure my uMP3 is communicating with my Prop-2.  My uMP3 is right out of the box.  i havent made any changes.  i tried a few codes on other topics but couldn't get anything out of the uMP3
Title: Re: Prop-2 Test Code for uMP3
Post by: BigRez on July 27, 2010, 04:49:28 PM
There are several threads out here with code for a BS2 and uMP3.  Have a look at this one:  ump3 with the prop-2 (http://www.efx-tek.com/php/smf/index.php?topic=748.msg4156#msg4156)

Beyond that, you need to make sure the setup is correct betwen the uMP3 and the BS2 including the baud rate.  Have a look through the Using the BS1-SA to Setup the uMP3 -- Yes, You Can!  (http://www.efx-tek.com/php/smf/index.php?topic=1250.msg7015#msg7015)  thread for some info on that. 

Other setup info can be found here:  UMP3 with the Prop-1 (http://www.efx-tek.com/php/smf/index.php?topic=255.msg1063#msg1063). It refers to the Prop-1 but connections are similar for the prop-2.
Title: Re: Prop-2 Test Code for uMP3
Post by: Ryanm0085 on July 27, 2010, 04:58:22 PM
thanks bigrez.  ive been reading them but im still having some problems with the communication.  ive tried several different test codes i found but nothing yet.  im gonna work on it a little bit more.  i guess i have to get the BS1-SA adapter...
Title: Re: Prop-2 Test Code for uMP3
Post by: JonnyMac on July 27, 2010, 09:28:40 PM
Get the docs for the uMP3 and check the default baud rate -- you may not have to change it.  The only thing that may need changing is the response delay, if you need to use that.  If you don't need to know when a file is finished then you can live without the response delay and you'll not be waiting for any responses from the player.
Title: Re: Prop-2 Test Code for uMP3
Post by: Ryanm0085 on July 28, 2010, 01:26:16 PM
got ya...just incase i ordered a bunch of adapters from parallax...i couldnt find my adapter so better to be safe than sorry.  im pretty sure im gonna need them anyway...i did check and it says the default is 9600.  im pretty sure most of the demos i checked were 2400 and i was unsure how to change them.  also, im not too worried about when the song is finished.  basically i just want my program to start a song on initialization.  then when a trigger is pressed, it quickly switches to another song.  or fade in and out but i think just a fast switch will be great.   
Title: Re: Prop-2 Test Code for uMP3
Post by: JonnyMac on July 28, 2010, 02:19:18 PM
I added a Prop-2 demo to this thread: http://www.efx-tek.com/php/smf/index.php?topic=1251.0
Title: Re: Prop-2 Test Code for uMP3
Post by: Ryanm0085 on July 29, 2010, 04:18:21 PM
it may be this part im getting stuck on...

' Put file # to play in "theMP3"
' -- add DATA label entries to LOOKUP as required

Play_MP3:
  LOOKUP SFX01, [SFX0, SFX1, SFX2,
                  SFX3, SFX4, SFX5], eePntr     ' get base address

i changed "theMP3" to SFX01 and wasn't sure about the DATA label...

not sure if this is right...

Title: Re: Prop-2 Test Code for uMP3
Post by: JonnyMac on July 29, 2010, 04:44:51 PM
Swing and a miss!  ;D

What you need to do is assign a value to "theMP3" that indicates which file in the list you're playing.  The LOOKUP table points to the beginning of the file name which is stored in a DATA table (you need to edit that list). 

You do note need edit the subroutine -- in fact, you broke it.  If you're going to play more than six files then I'll make that change for you.
Title: Re: Prop-2 Test Code for uMP3
Post by: Ryanm0085 on July 29, 2010, 06:24:00 PM
I never was good at baseball darn it...im only playing 2 files so it should be okay. as soon as i make it home ill try again.  thanks
Title: Re: Prop-2 Test Code for uMP3
Post by: JonnyMac on July 29, 2010, 06:25:04 PM
Just edit the list of names in the DATA table.  Assign theMP3 a value of 0 to play the first, 1 to play the second.
Title: Re: Prop-2 Test Code for uMP3
Post by: Ryanm0085 on July 29, 2010, 06:31:46 PM
It is working perfect... :D  I am very excited
Title: Re: Prop-2 Test Code for uMP3
Post by: Ryanm0085 on July 29, 2010, 08:20:39 PM
to me it looks like after the mp3 is done playing, i should be able to hit the trigger again for another song.  if this is true, the uMP3 will play one song and then not respond to another trigger...but m very happy to hear music
Title: Re: Prop-2 Test Code for uMP3
Post by: BigRez on July 29, 2010, 08:35:07 PM
Yes it should but without seeing your exact code as changed, we can't be sure there isn't something wrong with it.  If you're using the demo program without modification other than your file names, then it's set up to play THREE files as posted.   Either change the line

theMP3 = lottery // 3                         ' make 0 - 2

into

theMP3 = lottery // 2                         ' make 0 - 1

or put a third file on the card and at EEPROM location SFX2.
Title: Re: Prop-2 Test Code for uMP3
Post by: Ryanm0085 on July 29, 2010, 08:38:41 PM
i didnt change a thing on the demo...i changed my mp3s and named them the same as what the demo used...
Title: Re: Prop-2 Test Code for uMP3
Post by: JonnyMac on July 29, 2010, 09:20:30 PM
Check you file names; they MUST conform to DOS 8.3 standards -- this usually throws a few folks off as it's an easy miss.
Title: Re: Prop-2 Test Code for uMP3
Post by: Ryanm0085 on July 29, 2010, 10:03:07 PM
i used the same name examples as u did in the demo code...it plays all the mp3's but between each i have to shut the prop 2 off and restart it...
Title: Re: Prop-2 Test Code for uMP3
Post by: JonnyMac on July 30, 2010, 06:03:33 AM
Okay, let's stay on track here and not turn this into an unproductive, multi-page thread. 

You don't need to play random files, you want to play one of two specific files.  The purpose of running the test was to check the HARDWARE connection between your Prop-2 and the uMP3.  Success!  In your final code you will use straight SEROUTs instead of the demo routine as that will be easier and use less code.

Time to move on to the next hardware test.  Once you've validated all of your hardware, you can start working on the application.  This is the way John Barrowman and I develop every EFX-TEK product (the test code for the AP-16+ was a doozy! -- but now we can use it in production for testing units before they ship).