May 18, 2024, 11:46:54 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.


FC4 Crossfade Problem

Started by zpenow, July 09, 2009, 09:36:35 PM

Previous topic - Next topic

zpenow

I cut my program down to only the following commands and I am still having a problem.
If all the crossfade commands compiled only the first crossfade from 4 to 3 works.
If I comment out the first crossfade from 4 to 3 THEN only the cross fade from 3 to 4 works
If I comment out the crossfade from 3 to 4 THEN the final cross fade from 4 to 3 works.

Another way of saying this is that only the first crossfade works.
What am I missing each crossfade works on its own but I can't get all of them to work.

                                CODE FOLLOWS
'=============================================================
'   File      FC-4_Demo.SXB
'   Purpose      
'   Author      Jon Williams, EFX-TEK
'   Modified By   John C. Brudvik
'
'   EFX-TEK Release   03 Sep 2008
'   Entered and modified starting 18 April 2009
'
'=============================================================

'-------------------------------------------------------------
'   Program Description
' Initially a Demo program.
' Became learning experience
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'-------------------------------------------------------------
' Conditional Compilation Symbols
'-------------------------------------------------------------

'-------------------------------------------------------------
' Device Settings
'-------------------------------------------------------------

DEVICE      SX28, OSCXT2, TURBO, STACKX, OPTIONX, BOR42
FREQ      20_000_000
ID      "FC-4"

'-----------------------------------------------------------
' I/O Pins
'-----------------------------------------------------------

Sio   PIN   RC.7   output      'P15; no ULN, no SETUP


'-----------------------------------------------------------
' Constants
'-----------------------------------------------------------

Baud   CON   "OT38400"

IsOn   CON   1
IsOff   Con   0

'-----------------------------------------------------------
' Variables
'-----------------------------------------------------------

level   VAR   Byte
idx   VAR   Byte

tmpW1   VAR   Word   ' for subs/funcs
tmpB1   VAR   Byte
tmpB2   VAR   Byte
tmpB3   VAR   Byte
tmpB4   VAR   Byte
tmpB5   VAR Byte
tmpB6   VAR Byte

' ===========================================================
  PROGRAM Start
' ===========================================================

'-----------------------------------------------------------
' Subroutine/Function Declarations
'-----------------------------------------------------------

DELAY_MS   SUB   1, 2      ' shell for PAUSE

TX_BYTE      SUB   1      ' shell for SEROUT
TX_STR      SUB   2      ' transmit a string

FC4_RESET   SUB   0      ' kill FC-4 outputs
FC4_LEVEL   SUB   2      ' set channel to level
FC4_SET      SUB   4      ' set all channels
FC4_PRESET   SUB   1      ' preset to level
FC4_ALLON   SUB   0      ' all on
FC4_DIGITAL   SUB   1      ' digital control
FC4_FADE   SUB   4      ' fade one channel
FC4_CROSSFADE0   SUB   3      ' full cross fade, uses current light levels
FC4_CROSSFADE1   SUB 5      ' full cross fade, initial and end light levels
                            ' are included in subroutine call
'*************************** NOTE for FC4_CROSSFADE2 tmpB6 must be set with stepTm prior to being called.
FC4_CROSSFADE2   SUB 5      ' full cross fade, initial and end light levels
'                            ' are included in subroutine call. Number of
'                            ' steps is also provided. stepTm is set using tmpB6

RC4_RESETALL   SUB   0      ' Reset all relays on RC4
RC4_SETRESET   SUB   2      ' Set or Reset individual relay


'-----------------------------------------------------------
' Program Code
'-----------------------------------------------------------

Start:
  PLP_A = %0000_0000         ' pull-ups on unused pins
  PLP_B = %0000_0000
  PLP_C = %1000_0000
  FC4_RESET
  DELAY_MS 20
  RC4_RESETALL

Main:
  FC4_RESET

  DELAY_MS   1_000



  FC4_CROSSFADE0 4, 3, 30         ' cross-fade, ch4 to ch3
  FC4_RESET
  DELAY_MS 200
  FC4_CROSSFADE0 3, 4, 30         ' cross-fade, ch3 to ch4
  FC4_RESET
  FC4_CROSSFADE0 4, 3, 30         ' cross-fade, ch4 to ch3



  DELAY_MS 5_000

GOTO Main

JonnyMac

Keep in mind that timing is in steps and a full crossfade is 256 steps; if the step delay is 30ms then you need a delay of 7680ms before sending another commands -- you have 200ms delays which means the FC-4 is busy and ignoring the command.
Jon McPhalen
EFX-TEK Hollywood Office

zpenow

Thanks

I new I was missing something but didn't know what.


Thanks again
John