November 22, 2024, 07:55:54 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.


DC-16 Output control question

Started by jukingeo, February 15, 2008, 11:03:46 AM

Previous topic - Next topic

jukingeo

Hello All,

I am a bit unclear as to the operation capabilities of the DC-16 expander.  It says that it can expand the output control of a single Prop-1 or 2 output by 16 outputs via a serial connection.

The question is this:

Is the output control of the DC-16 1 of 16 outputs or can it fully turn on and off all the outputs at the same time.  In other words, can you or can't you have more than one output on at a time.

Another question I have is the current capabilities.  I am going to assume that since it is using the ULN out devices that it has the same current capacity as the Prop-1 and Prop-2 (the capacities were not listed in the PDF documentation for the DC-16).

Which in that case it would be 500ma for one output,  250ma each for four outputs,  and 125ma each for 8 outputs, correct?

Thank You,

Geo

gadget-evilusions

You can have mulitple outputs on at one time.      SEROUT Sio, Baud, ("!DC16", Addr, "S", %10010010, %00000000)  for example
Brian
Evilusions LLC
www.evilusions.com for all your pneumatic components

livinlowe

And you're correct on the current abilities; save for the fact that I believe it has 2 uln's on the board. So, the current would be for 8 outputs.

(Or, just what you said!   :D )
Shawn
Scaring someone with a prop you built -- priceless!

JonnyMac

Brian and Shawn are correct: you have the same ULN2803 so the same current limits on the output.  One thing to keep in mind that the switching rate of the DC-16 will never approach what you can do locally on a Prop-1 or Prop-2; this is due to the time required by the serial messaging.
Jon McPhalen
EFX-TEK Hollywood Office

jukingeo

Quote from: JonnyMac on February 15, 2008, 06:07:16 PM
Brian and Shawn are correct: you have the same ULN2803 so the same current limits on the output.  One thing to keep in mind that the switching rate of the DC-16 will never approach what you can do locally on a Prop-1 or Prop-2; this is due to the time required by the serial messaging.

Hello Jon,

Oh, so you CAN access more than one output at a time.   In terms of the switching rate, would a Prop-1 be able to drive the DC-16 for a light chaser application?  Or this is clearly too fast a task for the DC-16 to handle?  Would a chaser application be better with a Prop-2 due to the faster baud rate?

Still I think it is good piece because in the case of the Prop 1 you still could have a chaser on the first four to six channels and can have regular slow triggered event sequence run off the DC-16.

In terms of chasing, would the RC-4 be faster alternative or would that also suffer the same problem due to the serial connection?

Thanx,

Geo

JonnyMac

February 16, 2008, 03:01:17 PM #5 Last Edit: February 16, 2008, 03:05:35 PM by JonnyMac
If you're going to use more than four outputs then the DC-16 will give you the fastest speed because you're sending fewer bytes to update the same number of outputs.  Here's how the timing works:

At 2400 baud each bit is 417 microseconds (1/2400); each transmitted byte actually has 10 bits (start bit + eight data bits + stop bit) so it takes about 4.17 milliseconds.  The "S" command for the DC-16 requires nine bytes so the transmission delay is about 37.5 milliseconds -- so with no PAUSE instructions inserted in the loop you'll get 37.5 milliseconds plus a few hundred extra microseconds for normal instruction delays.  There are times when using the Prop-1 that we need to be aware of the time consumed by sending a serial command.

Here's a simple program that demos a triggered chaser on the DC-16:

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


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


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


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

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


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

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

SYMBOL  Baud            = OT2400


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

SYMBOL  timer           = B2

SYMBOL  chaseLEDs       = W5
SYMBOL   ledsLo         =  B10
SYMBOL   ledsHi         =  B11


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

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

  SEROUT Sio, Baud, ("!AP16", %00, "X")         ' clear chaser

  timer = 0                                     ' reset timer


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

Main:
  PAUSE 5                                       ' loop pad
  timer = timer + 5 * Trigger                   ' update timer
  IF timer < 200 THEN Main                      ' wait for 0.2 sec input

Reset_Chase:
  chaseLEDs = %0000000000000001                 ' just one LED

Chase_Again:
  SEROUT Sio, Baud, ("!AP16", %00, "S", ledsLo, ledsHi)
  chaseLEDs = chaseLEDs * 2
  IF chaseLEDs <> 0 THEN Chase_Again

Check_Trigger:
  IF Trigger = IsOn THEN Reset_Chase            ' continue?
    GOTO Reset                                  ' no


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


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


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

jukingeo

Hello Jon,

If the timing would be a delay of 37.5ms, how would that compare to using a Prop-2 instead?   Would an RC-4 be faster in either case?

Since I don't have a prop-1 as of yet, if I knew the timing difference between the two micro-controllers (based on what you written above), I could input the speed delay into my Prop-2 with a PAUSE command in one of my previously made chases.  This should give me a good idea of what I can expect in terms of maximum chase rate.

Thanx,

Geo

JonnyMac

At 38.4k baud, one bit is 26 microseconds (1/38400), so one full byte (10 bits) takes 260 microseconds; sending the nine-byte command to the DC-16 would take about 2.34 milliseconds (not counting any loop overhead).

The RC-4 "S" command, !RC4<address>S<outputs> is 7 bytes: at 2400 baud it takes about 29 milliseconds; at 38.4K it takes about 1.8 milliseconds.  That said... the relays on the RC-4 only switch at the zero-cross, so they will always switch on 8.3 millisecond boundaries.  Remember, too, that the RC-4 can only handle four outputs; so to update 16 RC-4 outputs would take 116 milliseconds at 2400 baud or 7.2 milliseconds at 38.4k.
Jon McPhalen
EFX-TEK Hollywood Office

jukingeo

Quote from: JonnyMac on February 18, 2008, 08:45:20 AM
At 38.4k baud, one bit is 26 microseconds (1/38400), so one full byte (10 bits) takes 260 microseconds; sending the nine-byte command to the DC-16 would take about 2.34 milliseconds (not counting any loop overhead).

The RC-4 "S" command, !RC4<address>S<outputs> is 7 bytes: at 2400 baud it takes about 29 milliseconds; at 38.4K it takes about 1.8 milliseconds.  That said... the relays on the RC-4 only switch at the zero-cross, so they will always switch on 8.3 millisecond boundaries.  Remember, too, that the RC-4 can only handle four outputs; so to update 16 RC-4 outputs would take 116 milliseconds at 2400 baud or 7.2 milliseconds at 38.4k.

Hello Jon,

Thank you for all that information, I can see now how the timing accumulates with the use of more RC-4's making the DC-16 a better bet for switching a lot of outputs at once (at a fast rate).   However, using the Prop-2 does speed things up tremendously.  I think when it comes to the Prop-1 it may be best to use something like the RC-4 or DC-16 for slower switching items on one output and delegate the rest of the outputs on the Prop-1 to drive a chase directly.  But with the Prop-2, the serial speed lag isn't too bad.  I believe it can do it either way in this case (using the DC-16 or 4 RC-4's) with the DC-16 still giving the better edge.   

But without even programming anything, comparing the difference between the Prop-1 running 4 RC-4s to the Prop-2, a difference of about 108ms between the two is pretty darn significant.

Geo