November 26, 2024, 09:31:41 AM

News:

Got VSA?  Want to use your Prop-SX?  Now you can!  See the VSA section of the Library forum for Prop-SX code that works with VSA.


Problem AP8 With Prop2

Started by DougLowe, October 13, 2007, 02:22:17 AM

Previous topic - Next topic

DougLowe

I'm having a world of trouble playing sounds on an AP8 from a Prop-2. The AP8 will play sound 0 manually with no problem. I've reduced the code to what I think should be the simplest:

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

Sio CON 15
T38K4 CON 6
Open CON $8000
Baud CON Open + T384K
Addr CON %00

Main:
  SEROUT Sio, Baud, ["!AP8", Addr, "P", 0]
  PAUSE 5000
  GOTO Main


Nothing plays.
I removed Pin 15 from the ULN chip, and I've tried the SEROUT on other pins. The B, A1, and A0 jumpers are all out.

Am I using the wrong Baud value? Or am I overlooking something basic? Never had this kind of trouble on a Prop-1 :(

--Doug

JonnyMac

On the AP-8 put the B/R jumper back in -- this sets the baud rate to 38.4K to match what the Prop-2 can do.
Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

I wrote a Prop-1 tester for the AP-8 yesterday; here's the Prop-2 version. 

' =========================================================================
'
'   File...... AP-8_Cycler.BS2
'   Purpose...
'   Author.... Jon Williams, EFX-TEK
'              Copyright (c) 2007 EFX-TEK
'   E-mail.... jwilliams@efx-tek.com
'   Started...
'   Updated...
'
'   {$STAMP BS2}
'   {$PBASIC 2.5}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------

' Configuration
'
' -- remove SETUP jumper from P15
' -- replace upper ULN2803 with ULN2003 (or clip pin 1 on ULN2803)
' -- remove A1, and A0 jumpers from AP-8; install B/R
' -- move L, 2, 1, 0 switches on AP-8 to "off" or "open" position


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


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

Sio             PIN     15                      ' SETUP = out; no ULN


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

#SELECT $STAMP
  #CASE BS2, BS2E, BS2PE
    T2400       CON     396
    T38K4       CON     6
  #CASE BS2SX, BS2P
    T2400       CON     1021
    T38K4       CON     45
  #CASE BS2PX
    T2400       CON     1646
    T38K4       CON     84
#ENDSELECT

SevenBit        CON     $2000
Inverted        CON     $4000
Open            CON     $8000
Baud            CON     Open + T38K4            ' baud jumper installed


Yes             CON     1
No              CON     0


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

status          VAR     Byte
playing        VAR     status.BIT7

sfx             VAR     Byte


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

Reset:
  PAUSE 250                                     ' let AP-8 power-up
  SEROUT Sio, Baud, ["!!!!!!!AP8", %00, "X"]    ' stop on reset

  DEBUG CLS


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

Main:
  FOR sfx = 0 TO 7
    PAUSE 100                                   ' gap between sounds
    DEBUG "Playing #", DEC sfx, CR
    GOSUB Start_AP8
    GOSUB Let_AP8_Finish
  NEXT

  STOP


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

' Put segment number (0 to 7) into 'sfx' before calling

Start_AP8:
  SEROUT Sio, Baud, ["!AP8", %00, "P", sfx]     ' play segment
  RETURN

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

' Holds program until AP-8 is finished playing current segment

Let_AP8_Finish:
  DO
    SEROUT Sio, Baud, ["!AP8", %00, "G"]        ' get status
    SERIN  Sio, Baud, [status]
  LOOP UNTIL (playing = No)
  RETURN

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


' -----[ User Data ]-------------------------------------------------------
Jon McPhalen
EFX-TEK Hollywood Office

DougLowe

Thanks Jon! I tried that to no avail. I thought maybe I was getting hung up with all the complexities of setting the Baud mode for the Prop-2 -- it's a lot simpler with the Prop-1!  But I've tried every combination I can think of.

I'm under a real time crunch today, we have a film crew from fearnet.com coming tomorrow. So we're frantically setting things up and I probably won't get back to this project until late tonight. And if I don't get it done, so be it -- I'll resume work on it Monday. I'm not sure what else to try.

The prop is an antique ventriliquist doll whose mouth is controlled by a servo. I have the servo aspects working just fine, but can't get the sound card to play.

We recently decided to simplify the prop -- it was going to speak one of several short quotes, but in the environment where we will use it, it will be very difficult to make out distinct words. So I've recorded a 30-second laugh on the AP8, and that's all we want it to do. So I just need to be able to trigger sound 0, do the servo stuff for about 30 seconds, then repeat.

I see from the docs that you can wire it up on the AP-8's P header and trigger it by simply taking that pin high to simulate a manual key press. Would the code for that look like this -- assuming I connect on Pin 8:

Main:
HIGH 8
PAUSE 50
LOW 8
'Do the servo stuff
GOTO Main

If so, this would be fine for the application. But I can't quite tell from the docs how to wire it up. Just use a 3-pin cable to connect the correct prop-2 output header to the AP-8 P header? When I connect it in this way, the AP-8 plays its entire sound bank automatically when I power up the AP-8, but then doesn't repeat when I run a simple program like this:

Main:
HIGH 8
PAUSE 50
LOW 8
PAUSE 50
GOTO Main

Any suggestions there? I'm beginning to wonder if (A) the board is fried, or (B) I don't have a clue what I'm doing :)

--Doug

JonnyMac

I don't suggest using the "P" input -- the electrically noise environment of the haunt can, in some cases, cause false triggering.

Questions:
-- Can you make that AP-8 work with a Prop-1?  Let's make sure the AP-8 is square first.
-- Have you removed the P15 SETUP jumper?
-- Did you clip pin 1 of the upper group (P8..P15) ULN?
-- Did you cycle AP-8 power after reconfiguring?

If that AP-8 will work with a Prop-1 then there is no good reason it won't work with a Prop-2.  That said, if you really want to use the "P" input then follow this guidance:

-- ULN must be cleared on that trigger pin (just like with serial comms)
-- If using an I/O point with a SETUP jumper, move it to the UP position (this will stiffen the pull-up that is on the AP-8, improving noise immunity)
-- Code it like this:

Start_Audio:
  LOW SfxStart
  PAUSE 25
  INPUT SfxStart


No not use HIGH on the I/O pin that you're doing a push-button type start on.

Jon McPhalen
EFX-TEK Hollywood Office

DougLowe

D'oh!

I got the new AP8 today (thanks for the overnight John!) as well as a prop-1, and it didn't work either. So I figured I must be missing something somewhere. It turns out I wasn't resetting the segment switches back to segment 7 after recording. Once I did that the board worked. I don't think I knew that before -- with my previous AP-8 props, I used all eight segments so the switches were set to segment 7 after recording. For this one, I recorded just one long segment, hence the switches were left at segment zero.

Well now I have an extra Prop-1 & AP-8 to get started on my first prop for 2008 :)

My little home party haunt now has three Efx-Tek controlled props: a pop-up Frankenstein, a Jack-In-The-Box, and the laughing doll. Plus the band which is controlled by a laptop & a Kit-74. I'll probably add two or three more for next year. Can't wait until I can play with the FC4.

We're going to be on FearNet on the 27th, the Frankenstein & Jack-In-The-Box will probably be featured.

Thanks for the help!