November 21, 2024, 06:25:06 PM

News:

Be sure to checkout our Vixen interfaces in the Library forum -- if you want PC automation at near zero cost, EFX-TEK and Vixen is a great combination of tools.


prop2 jumper settings using an ap8 and trigger

Started by jeffh, November 15, 2008, 11:06:42 PM

Previous topic - Next topic

jeffh

do i use pin 14 for switch and 15 for ap8 trigger

set 14 to down
set 15 to up
bend pin 1 up on second chip, or replace chip

like using a prop1

pins 6 for switch and pins for ap8
bend pin 1 up on chip or replace chip

JonnyMac

Sounds like you've got it correct, Jeff.

P15: Sio (SETUP = UP; ULN = out)
P14: Trigger (SETUP = DN)

Remember to put the Baud jumper in on the AP-8 so that you can use the fast baud rate (38.4k) of the Prop-2.
Jon McPhalen
EFX-TEK Hollywood Office

jeffh

now i am using this code below for a prop2.

i have 0 through 13 relays

pin 14 with a trigger,  jumper in the DN position
pin 1 pulled out on IC number 2

the show is not starting.

please help

do i have to jumper all V+ together?


' =========================================================================
'
'   File...... Boyette_Prop-1_Sound.BS2
'   Purpose...
'   Author.... Jon Williams, EFX-TEK (www.efx-tek.com)
'   E-mail.... jwilliams@efx-tek.com
'   Started... 04 MAY 2007
'   Updated... 29 JUL 2008
'
'   {$STAMP BS2}
'   {$PBASIC 2.5}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
'
' Triggered, table-drive sequencer capable of driving six control outputs.
' P6 is used as the trigger input.
'
' Note: Replace ULN2803 with ULN2003 to allow serial comms with AP-8
' (on P7).


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


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

Sio                     CON 15                    ' SETUP = out; no ULN
Trigger                 VAR IN14                  ' SETUP = DN


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

T2400                   CON 396
IsOn                    CON 1                     ' for active-high input
IsOff                   CON 0
Open                    CON $8000
Baud                    CON Open + T2400          ' baud jumper out
TicTiming               CON 100                   ' 0.1 sec per step


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

showBits                VAR Word
showBitsHi              VAR showBits.HIGHBYTE
showBitsLo              VAR showBits.LOWBYTE
endOfShow               VAR showBits.BIT15
playAudio               VAR showBits.BIT14

pntr                    VAR Word
tix                     VAR Byte


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

Reset:
  OUTS = %0000000000000000                      ' clear pins
  DIRS = %0001111111111111                      ' P0..P12 are outputs

  SEROUT Sio, Baud, ["!!!!!!!AP8", %00, "X"]    ' kill sound if reset
  pntr = 0                                      ' point to start of show


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

Main:
  IF Trigger = IsOff THEN Main                  ' wait for trigger

Play_Show:
  READ pntr+0, showBits.HIGHBYTE                ' get step (high part)
  READ pntr+1, showBits.LOWBYTE                 ' get step (low part)
  READ pntr+2, tix                              ' get step (time part)

Check_Sound:
  IF playAudio = IsOff THEN Engine
    SEROUT Sio, Baud, ["!AP8", %00, "P", 0]     ' start the sound

Engine:
  OUTS = showBits & %0001111111111111           ' update outputs
  GOSUB Timer                                   '   run the timer
  pntr = pntr + 3                               '   point to next step

  IF endofShow = IsOn THEN Reset                ' done?
    GOTO Play_Show


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

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

Timer_Done:
  RETURN

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

Show_Data:
'          +---------------------- end of show bit
'          |+--------------------- start audio player
'          ||+-------------------- unused
'          |||+------------------- valve 12
'          ||||+------------------ valve 11
'          |||||+----------------- valve 10
'          ||||||+---------------- valve 9
'          |||||||+--------------- valve 8
'          ||||||||  |+----------- valve 7
'          ||||||||  ||+---------- valve 6
'          ||||||||  |||+--------- valve 5
'          ||||||||  ||||+-------- valve 4
'          ||||||||  |||||+------- valve 3
'          ||||||||  ||||||+------ valve 2
'          ||||||||  |||||||+----- valve 1
'          ||||||||  ||||||||
'          ||||||||  ||||||||  +-- timing multiplier (1 to 255)

  DATA %01000000,%00000000, 4          ' start audio
  DATA %00000000,%00000011, 4
  DATA %00000000,%00000111, 4
  DATA %00000000,%00001111, 4
  DATA %00000000,%00011111, 4
  DATA %00000000,%00111111, 4
  DATA %00000000,%01111111, 4
  DATA %00000000,%11111111, 4
  DATA %00000001,%11111111, 4
  DATA %00000011,%11111111, 4
  DATA %00000111,%11111111, 4
  DATA %00001111,%11111111, 4
  DATA %00011111,%11111111, 4
  DATA %00111111,%11111111, 4
  DATA %00011111,%11111111, 8
  DATA %00001111,%11111111, 8
  DATA %00000111,%11111111, 8
  DATA %00000011,%11111111, 8
  DATA %00000001,%11111111, 8
  DATA %00000000,%11111111, 8
  DATA %00000000,%01111111, 8
  DATA %00000000,%00111111, 8
  DATA %00000000,%00011111, 8
  DATA %00000000,%00001111, 8
  DATA %00000000,%00001111, 8
  DATA %00000000,%00000111, 8
  DATA %00000000,%00000011, 8
  DATA %00000000,%00000001, 8
  DATA %00000000,%00000000, 8
  DATA %10000000,%00000000, 0          'end of show

JonnyMac

November 16, 2008, 11:13:45 AM #3 Last Edit: November 16, 2008, 11:15:26 AM by JonnyMac
Here's an update that works on my Prop-2.  I've also added debouncing to this program so make sure you give the button a nice stiff press.  Note that you'll need to insert the Baud jumper on your AP-8

' =========================================================================
'
'   File...... Boyette_Prop-1_Sound.BS2
'   Purpose...
'   Author.... Jon Williams, EFX-TEK (www.efx-tek.com)
'   E-mail.... jwilliams@efx-tek.com
'   Started... 04 MAY 2007
'   Updated... 16 NOV 2008
'
'   {$STAMP BS2}
'   {$PBASIC 2.5}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
'
' Triggered, table-drive sequencer capable of driving up to 14 control
' outputs.  P14 is used as the trigger input.
'
' Note: Replace ULN2803 with ULN2003 to allow serial comms with AP-8
' (on P15).


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


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

Sio             PIN     15                      ' SETUP = UP; no ULN
Trigger         PIN     14                      ' SETUP = DN


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

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

Yes             CON     1
No              CON     0

T2400           CON     396
T9600           CON     84
T19K2           CON     32
T38K4           CON     6

Inverted        CON     $4000
Open            CON     $8000
Baud            CON     Open + T38K4            ' B/R jumper installed

TicTiming       CON 100                         ' 0.1 sec per step


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

showBits        VAR     Word
showBitsHi     VAR     showBits.HIGHBYTE
showBitsLo     VAR     showBits.LOWBYTE
endOfShow      VAR     showBits.BIT15
playAudio      VAR     showBits.BIT14

played          VAR     Bit                     ' mark audio played

timer           VAR     Byte                    ' debounce timer
pntr            VAR     Word                    ' table pointer
tix             VAR     Byte                    ' step timing "ticks"


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

Reset:
  OUTH = %00000000 : OUTL = %00000000           ' clear all
  DIRH = %00111111 : DIRL = %11111111           ' set outputs (P0..P13)

  SEROUT Sio, Baud, ["!!!!!AP8", %00, "X"]      ' kill sound if reset


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

Main:
  timer = 0                                     ' reset timer
  DO WHILE (timer < 100)                        ' wait for 0.1 sec input
    PAUSE 5                                     ' loop pad
    timer = timer + 5 * Trigger                 ' update timer
  LOOP

  played = No                                   ' allow audio
  pntr = 0                                      ' point to start of show

Play_Show:
  READ pntr, showBitsHi, showBitsLo, tix        ' read step record
  pntr = pntr + 3                               ' point to next record

Check_Sound:
  IF (playAudio = Yes) THEN
    IF (played = No) THEN
      SEROUT Sio, Baud, ["!AP8", %00, "P", 0]   ' start the sound
      played = Yes
    ENDIF
  ENDIF

Update_Outputs:
  OUTS = showBits & %0011111111111111           ' update outputs
  IF (endofShow = IsOn) THEN Reset              ' done?

Run_Timer:
  DO WHILE (tix > 0)                            ' timer expired?
    PAUSE TicTiming                             ' no, time on "tic"
    tix = tix - 1                               ' decrement timer
  LOOP
  GOTO Play_Show


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


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

Show_Data:
'        +---------------------- end of show bit
'        |+--------------------- start audio player
'        ||+-------------------- valve 13
'        |||+------------------- valve 12
'        ||||+------------------ valve 11
'        |||||+----------------- valve 10
'        ||||||+---------------- valve 9
'        |||||||+--------------- valve 8
'        ||||||||   +----------- valve 7
'        ||||||||   |+---------- valve 6
'        ||||||||   ||+--------- valve 5
'        ||||||||   |||+-------- valve 4
'        ||||||||   ||||+------- valve 3
'        ||||||||   |||||+------ valve 2
'        ||||||||   ||||||+----- valve 1
'        ||||||||   |||||||+---- valve 0
'        ||||||||   ||||||||
'        ||||||||   ||||||||  +-- timing multiplier (1 to 255)
'        ||||||||   ||||||||  |
  DATA  %01000000, %00000000, 4                 ' start audio
  DATA  %00000000, %00000011, 4
  DATA  %00000000, %00000111, 4
  DATA  %00000000, %00001111, 4
  DATA  %00000000, %00011111, 4
  DATA  %00000000, %00111111, 4
  DATA  %00000000, %01111111, 4
  DATA  %00000000, %11111111, 4
  DATA  %00000001, %11111111, 4
  DATA  %00000011, %11111111, 4
  DATA  %00000111, %11111111, 4
  DATA  %00001111, %11111111, 4
  DATA  %00011111, %11111111, 4
  DATA  %00111111, %11111111, 4
  DATA  %00011111, %11111111, 8
  DATA  %00001111, %11111111, 8
  DATA  %00000111, %11111111, 8
  DATA  %00000011, %11111111, 8
  DATA  %00000001, %11111111, 8
  DATA  %00000000, %11111111, 8
  DATA  %00000000, %01111111, 8
  DATA  %00000000, %00111111, 8
  DATA  %00000000, %00011111, 8
  DATA  %00000000, %00001111, 8
  DATA  %00000000, %00001111, 8
  DATA  %00000000, %00000111, 8
  DATA  %00000000, %00000011, 8
  DATA  %00000000, %00000001, 8
  DATA  %00000000, %00000000, 8
  DATA  %10000000, %00000000, 0          'end of show
Jon McPhalen
EFX-TEK Hollywood Office

jeffh

i am on my way to test it, thanks
i am greatful for your promptness

i know i am over my head with this programming.

jeffh

i am a bone head sometimes
the trigger wire was not making contact.

livinlowe

Yeah, Its funny, when your not 100% with programming like me (and it sounds like you too),  I tend to think in terms of the program not being right instead of looking elsewhere. I've had plenty of moments like this where you feel dumb, but really you just learn to trust programming a little more. Glad you found the problem!   :)
Shawn
Scaring someone with a prop you built -- priceless!