May 08, 2024, 08:25:19 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.


Starting the Cowlacious CAR/P Sound Board from a Prop-1/2/SX

Started by JonnyMac, October 01, 2008, 11:57:05 AM

Previous topic - Next topic

JonnyMac

The Cowlacious CAR/P audio board can be started by the Prop-1/2/SX by using the OUTx terminals.  Using the trigger wire supplied by Cowlacious, connect the white wire to the OUTx terminal of your choice (I use OUT5) and the black wire to the GND terminal.  If you are providing power to the CAR/P through the Prop-1/2/SX V+ and GND terminals the the black trigger wire need not be connected (I folded it back and covered it with a piece of electrical tape.

The Trigger input on the CAP board is designed to mat switches and buttons hence it is debounced, and after a bit of testing I have found that to start reliably you need to pull the input low (through the OUTx terminal) for at least 250 milliseconds.

Here's my little Prop-1 demo:

' =========================================================================
'
'   File...... CAP_Audio.BS1
'   Purpose...
'   Author.... Jon Williams, EFX-TEK
'              Copyright (c) 2008 EFX-TEK
'              Some Rights Reserved
'              -- see http://creativecommons.org/licenses/by/3.0/
'   E-mail.... jwilliams@efx-tek.com
'   Started...
'   Updated... 01 OCT 2008
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


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


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


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

SYMBOL  Sio             = 7                     ' SETUP = out; no ULN
SYMBOL  Trigger         = PIN6                  ' SETUP = DN
SYMBOL  CapAudio        = PIN5                  ' white->OUT5, black->GND


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

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

SYMBOL  Baud            = OT2400


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

SYMBOL  timer           = B2


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

Reset:
  PINS = %00000000                              ' clear all outputs
  DIRS = %00111111                              ' make P0-P5 outputs

  PAUSE 1000                                    ' let CAP initialize


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

Main:
  DEBUG "Ready. "
  timer = 0                                     ' reset timer

Check_Trigger:
  PAUSE 5                                       ' loop pad
  timer = timer + 5 * Trigger                   ' update timer
  IF timer < 100 THEN Check_Trigger             ' wait for 0.1 sec input

  DEBUG "Playing...", CR

  GOSUB CAP_Start
  PAUSE 2000                                    ' adjust for sound

  GOTO Main


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

CAP_Start:
  CapAudio = IsOn                               ' pull OUTx low
  PAUSE 250                                     ' hold for CAP debounce
  CapAudio = IsOff                              ' release OUTx
  RETURN


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


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