November 21, 2024, 10:12:13 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.


MIB with Sound AP-8

Started by jdccroad, October 21, 2007, 04:07:40 PM

Previous topic - Next topic

jdccroad

Reprogramed sound in AP-8 & updated Prop 1

Here is my out config.
0-LID
1-STROBE
2-FOG
3-SPARE relay. May use for sound with looping iPod.
OUT4
OUT5
( Reserved for future use )
Stop Show / Inter-show Delay



=========================================================================
'
'   File...... MIB with Sound.bs1
'   Purpose...
'   Author....
'   E-mail....
'   Created... 21 OCT 2007 - Generated by Vixen Prop-1 Sequencer Add-in
'   Updated...
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
'
' Triggered, table-drive sequencer capable of driving six control outputs.
' P6 is used as the trigger input, P7 is used for audio start when that
' option has been enabled.
'
' Note: When using the AP-8 you must replace ULN2803 with ULN2003 for
'       audio start on P7.
'
' Setup Jumpers:
'   -- P7 :: out
'   -- P6 :: DN for active-high; UP for active-low trigger


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


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

SYMBOL  AudioStart      = 7                     ' SETUP = out
SYMBOL  Trigger         = PIN6


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

SYMBOL  IsActive        = 1
SYMBOL  IsNotActive     = 0

SYMBOL  IsOn            = 1
SYMBOL  IsOff           = 0

SYMBOL  Started         = 1
SYMBOL  NotStarted      = 0

SYMBOL  EventDelay      = 250


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

SYMBOL  showBits        = B0                    ' output + control bits
SYMBOL  endOfShow       = BIT7                  ' 1 = stop when timer done

SYMBOL  pntr            = B2                    ' step pointer
SYMBOL  tix             = B3                    ' hold timing


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

Reset:
  PINS = %00000000                              ' clear pins
  DIRS = %00111111                              ' P0..P5 are outputs

Audio_Reset:
  ' kill audio if playing
  SEROUT AudioStart, OT2400, ("!!!!!!!AP8", %00, "X")


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

Main:
  pntr = 0                                      ' point to start of show
  IF Trigger = IsNotActive THEN Main            ' wait for trigger

Start_Audio:
  SEROUT AudioStart, OT2400, ("!AP8", %00, "P", 0)


Play_Show:
  READ pntr, showBits                           ' get step
  PINS = showBits & %00111111                   ' update outputs
  pntr = pntr + 1                               '   point to timing
  READ pntr, tix                                '   read it
  pntr = pntr + 1                               ' point to next step

Timer:
  IF tix = 0 THEN Next_Step                     ' timer expired?
    PAUSE EventDelay                            ' no, time on "tic"
    tix = tix - 1                               ' decrement timer
    GOTO Timer                                  ' check again

Next_Step:
  IF endOfShow = IsOn THEN Reset                ' done?
    GOTO Play_Show                              '   no, keep going


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


' -----[ EEPROM Data ]-----------------------------------------------------

Show_Data:
'          +------------ end of show bit
'          |
'          | +---------- OUT5
'          | |+--------- OUT4
'          | ||+-------- OUT3
'          | |||+------- OUT2
'          | ||||+------ OUT1
'          | |||||+----- OUT0
'          | ||||||
'          | ||||||  +-- timing multiplier (1 to 255)
'          | ||||||  |
  EEPROM (%00001000, 4)
  EEPROM (%00001100, 9)
  EEPROM (%00001000, 11)
  EEPROM (%00001001, 2)
  EEPROM (%00001000, 5)
  EEPROM (%00001100, 1)
  EEPROM (%00001110, 3)
  EEPROM (%00001101, 2)
  EEPROM (%00001110, 3)
  EEPROM (%00001111, 4)
  EEPROM (%00001100, 3)
  EEPROM (%00001111, 3)
  EEPROM (%00001110, 2)
  EEPROM (%00001100, 1)
  EEPROM (%00001101, 2)
  EEPROM (%00001111, 1)
  EEPROM (%00001011, 1)
  EEPROM (%00001010, 1)
  EEPROM (%00001000, 1)
  EEPROM (%00001001, 1)
  EEPROM (%00001011, 5)
  EEPROM (%00001010, 3)
  EEPROM (%10000000, 172)

JonnyMac

October 21, 2007, 04:30:29 PM #1 Last Edit: October 21, 2007, 04:49:50 PM by JonnyMac
Does it work the way you want?  I tested it on my Prop-1/AP-8 setup and it works as expected.
Jon McPhalen
EFX-TEK Hollywood Office

jdccroad

October 21, 2007, 05:31:47 PM #2 Last Edit: October 21, 2007, 05:33:37 PM by jdccroad
I think when I had the AP-8 connected to Prop1 using the direct connection option to OUT4 it did something to the AP-8.

Now I cannot get the AP-8 to play unless I cycle power. Even pressing the play button does not work. When I loaded the sounds last night it worked no problem.

Thanks Jon for answering the phone on a Sunday Night.

JonnyMac

How, exactly, did you have it connected -- that will help us with the analysis when we get the board back.
Jon McPhalen
EFX-TEK Hollywood Office