November 26, 2024, 03:40:20 PM

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.


can't get AP-8 to work with Prop-1

Started by dbauer1080, September 06, 2008, 12:58:46 AM

Previous topic - Next topic

dbauer1080

I am trying to test my Prop-1 with the PIR and AP-8. I have recorded sound(about 6 seconds) into slot 0 of the AP-8. I have copied the program Jon wrote for another individual which follows below. I have connected the devices as described, removed all jumpers from B/R, A1, A0 on the AP-8, and also P7 on the Prop-1. The  L,2,1,0 buttons are open. I can get the AP-8 to play with the play button, and get the PIR to work with the Prop-1 using a different program with a servo. But somehow the Prop-1 and AP-8 aren't talking to each other. Any help would be appreciated. Here's the program used from this thread:


Re: I need a Basic Prop-1, AP-8, PIR program?
« Reply #3 on: October 23, 2007, 04:12:41 PM » 

--------------------------------------------------------------------------------

Here you go:

' =========================================================================
'
'   File...... MPGOnline.BS1
'   Purpose...
'   Author.... Jon Williams, EFX-TEK
'              Copyright (c) 2007 EFX-TEK
'   E-mail.... jwilliams@efx-tek.com
'   Started...
'   Updated...
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


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


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


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

SYMBOL  Sio             = 7                     ' SETUP = out; no ULN
SYMBOL  PIR             = PIN6                  ' SETUP = DN


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

SYMBOL  Baud            = OT2400

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

SYMBOL  Yes             = 1
SYMBOL  No              = 0


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

SYMBOL  status          = B0
SYMBOL   playing        =  BIT7                 ' 1 when AP-8 is playing

SYMBOL  timer           = B2


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

Reset:
  SEROUT Sio, Baud, ("!!!!!!!AP8", %00, "X")    ' stop audio if playing

  PAUSE 20000                                   ' PIR warm-up


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

Main:
  timer = 0                                     ' clear for PIR debounce

Scan_Pir:
  PAUSE 5
  timer = timer + 5 * PIR                       ' advance/clear timer
  IF timer < 250 THEN Scan_Pir                  ' wait for valid signal

Start_Audio:
  SEROUT Sio, Baud, ("!AP8", %00, "P", 0)

Let_Audio_Finish:
  PAUSE 100
  SEROUT Sio, Baud, ("!AP8", %00, "G")
  SERIN  Sio, Baud, status
  IF playing = Yes THEN Let_Audio_Finish

  GOTO Main


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


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


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

What you have to do:
  -- Record your audio into slot 0 of the AP-8
     * close the 2, 1, 0 switches when recording
     * return all switches to open for Prop-1 control

  -- Connect the AP-8 to P7 of the Prop-1
     * replace Prop-1 ULN2803 with ULN2003, or see this post for "surgical" instructions: http://www.efx-tek.com/php/smf/index.php?topic=130.0
     * remove the P7 SETUP jumper on the Prop-1
     * remove the AP-8 B/R, A1, and A0 jumpers
     * make sure you connect to the Ap-8 Serial header, and follow the wiring color codes

  -- Connect the PIR to P6 of the Prop-1
     * This doc will help: http://www.efx-tek.com/downloads/pir_docs.pdf

« Last Edit: October 23, 2007, 04:16:28 PM by JonnyMac »  Report to moderator    Logged 


JonnyMac

September 06, 2008, 07:37:11 AM #1 Last Edit: September 06, 2008, 07:40:39 AM by JonnyMac
Well, I just copied the program from above, pasted it into my editor, downloaded it to my Prop-1/AP-8 setup and it works fine.  Things to consider:

1. There's a 20-second PAUSE at the beginning -- are you waiting for that to to finish?
2. Did you change the ULN2803 to a ULN2003 or clip of pin 1 of the ULN2803?
    -- see this thread for details: http://www.efx-tek.com/php/smf/index.php?topic=130.0
3. Is your extender cable oriented properly? 
4. Is your extender cable plugged into the serial connector (near the power switch) on the AP-8?

Here's how everything should be connected:

Jon McPhalen
EFX-TEK Hollywood Office

dbauer1080

Jon,

Thank you for your swift reply. I think somehow the serial connection on this Prop-1 is not working. I have two Prop-1's, hooked up the other one and it works fine. Also switched ULN2003's and it's not that. Any suggestions for this issue, or is my Prop-1 in need of replacement?

JonnyMac

If the Prop-1 is in warranty we'll replace it.  If not, let me suggest you simply mark it as not having P7 available.  Odd, though, that one pin would get damaged in this way....
Jon McPhalen
EFX-TEK Hollywood Office

dbauer1080

Is it possible to utilize another P output for serial control of AP-8 and RC-4? If so, how would I change the program to address this? Thanks.

JonnyMac

Sure, use P6 for serial and move your active-high trigger to P5.  For P6 you'll have to remove the ULN influence which means clipping a pin, no matter which chip you're using.  Leave the ULN connected to P5, though, because this acts like a pull-down for the trigger circuit.

Here's how you'd adjust the top part of the program:

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

SYMBOL  BadPin          = 7                     ' do not use
SYMBOL  Sio             = 6                     ' SETUP = out; no ULN
SYMBOL  PIR             = PIN5                  ' ULN acts as pull-down


Let me point out that is is precisely why we use SYMBOLs in our programs; it allows us to make changes in one place that migrate through the rest of the code.
Jon McPhalen
EFX-TEK Hollywood Office

dbauer1080

Thanks Jon. I'll get the scalpel out. Does this mean I clip only the left-side pin of the ULN that would plug into P6? I looked at the reference and they called it pin 1 (for the P7 slot) so I'm assuming I would just clip the pin below it on the left for P6.

livinlowe

Yes, Pin 2 would translate into I/O 6.

I think!   ;D

Cheers!
Shawn
Scaring someone with a prop you built -- priceless!

JonnyMac

You got it; it's pin 2 on a ULN2803, pin 1 on a ULN2003.
Jon McPhalen
EFX-TEK Hollywood Office

Spooky Dad

I have followed this thread and wanted to chime in that I am experiencing the same issue as dbauer1080.  My Prop-1 is surely out of warranty at this time, so I am taking a clipper to Pin2 on the ULN2803 that came with the Prop-1.  My question, assuming switching to Pin6 for serial communication works, is that hopefully PIN7 can still be utilized as an input, right?

Spooky Dad