May 09, 2024, 01:37:10 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.


The built in functions on the HC-8+

Started by jukingeo, August 25, 2012, 09:42:26 AM

Previous topic - Next topic

jukingeo

Hello,

Basically from looking briefly at the demo program using the HC-8+ with the Prop-1, I am getting the gist that out of the box the HC-8+ handles the memory intensive dimming or PWM of servo motors.  I am curious as to what else you can do with the HC-8+ as is without any hacking.

Is it possible to do a full show out of the box with a Prop-1, or would you still need the higher capacity of the Prop-2?

Thank You,

Geo

JonnyMac

Out-of-the-box the HC-8+ is a slave co-processor. With a master (Prop-1, Prop-2, or other compatible controller) you can:

-- turn the HC-8+ outputs on and off
-- set any HC-8+ output to a DMX-compatible level (0 [off] to 255 [on])
-- fade any channel up or down
-- do a cross fade between two channels
-- read the inputs from the HC-8+ TTL port

All of these commands require serial messages which consume memory, so you won't be able to create a very big show with the Prop-1.  This is why we created and uSD adapter for the HC-8+; it allows us to create very long shows with Vixen and play them back on command.  It also means we can store multiple shows. The memory on the Prop-1 is 256 bytes. The smallest uSD card I have is 512 Mbytes.

I understand that the Prop-1 may be housing additional program logic; one could move that logic to the HC-8+ -- so long as the  eight inputs, one IO, and eight outputs would satisfy the requirement for the prop.
Jon McPhalen
EFX-TEK Hollywood Office

bsnut

August 25, 2012, 12:19:06 PM #2 Last Edit: August 25, 2012, 12:27:24 PM by bsnut
Here's a small program to show you what HC-8 is able to do Out-of-the-box.

' =========================================================================
'
'   File......3_Stooges_HC8.bs1
'   Purpose...Do three different 3Stooges shows using the power of the HC-8+
'             and AP-16
'   Author....
'   E-mail....
'   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  ch              = B3

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

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


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

Main:
  timer = 0                                     ' reset timer

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

Show1:
  SEROUT Sio, OT2400, ("!AP16", %11, "PW", "HELLO", 13, 1)
  SEROUT Sio, OT2400, ("!HC8", %00, "LR", %11100000)
  SEROUT Sio, OT2400, ("!HC8", %00, "LR", %00000111)
  PAUSE 2280
  SEROUT Sio, OT2400, ("!HC8", %00, "LR", %00000111)
  GOTO Main

Show2:
  SEROUT Sio, OT2400, ("!AP16", %11, "PW", "HELLO2", 13, 1)
  FOR ch = 0 TO 2
    SEROUT Sio, OT2400, ("!HC8", %00, "D", ch, 1)
    PAUSE 1000
  NEXT
  FOR ch = 0 TO 2
    SEROUT Sio, OT2400, ("!HC8", %00, "D", ch, 0)
    PAUSE 1000
  NEXT

Show3:
  SEROUT Sio, OT2400, ("!AP16", %11, "PW", "HELLO3", 13, 1)
  SEROUT Sio, OT2400, ("!HC8", %00, "LR", %11100000)
  SEROUT Sio, OT2400, ("!HC8", %00, "LR", %00000111)
' -----[ Subroutines ]-----------------------------------------------------


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


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


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


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


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


' -----[ User Data ]-------------------------------------------------------

As you can see it uses a lot of serial commands, which takes up 86% of memory on the Prop-1. Now, if we move this program to the HC-8 like Jon is talking about in his first post of this thread, then you will have more memory to play with and you can call this program and many other programs that you may have.

BTW, take a look at this thread
http://www.efx-tek.com/php/smf/index.php?topic=1851.msg10976#msg10976
which gives you a test program that shows you the different Out-of-the-box features of the HC-8.
William Stefan
The Basic Stamp Nut

jukingeo

August 26, 2012, 07:39:31 AM #3 Last Edit: August 26, 2012, 07:54:55 AM by jukingeo
Quote from: JonnyMac on August 25, 2012, 10:51:41 AM
Out-of-the-box the HC-8+ is a slave co-processor. With a master (Prop-1, Prop-2, or other compatible controller) you can:

-- turn the HC-8+ outputs on and off
-- set any HC-8+ output to a DMX-compatible level (0 [off] to 255 [on])
-- fade any channel up or down
-- do a cross fade between two channels
-- read the inputs from the HC-8+ TTL port

I definitely like the DMX, and multichannel dimming.  Given the price of the FC-4, the HC-8+ already trumps it, but when you mentioned I can use my Renard controllers with this that is a HUGE "+" (pun intended).

Quote
All of these commands require serial messages which consume memory, so you won't be able to create a very big show with the Prop-1.  This is why we created and uSD adapter for the HC-8+; it allows us to create very long shows with Vixen and play them back on command.  It also means we can store multiple shows. The memory on the Prop-1 is 256 bytes. The smallest uSD card I have is 512 Mbytes.

Ok, so in a case like this a Vixen program on an uSD card would control the HC-8+ and you wouldn't need a Prop controller attached to it?

Quote
I understand that the Prop-1 may be housing additional program logic; one could move that logic to the HC-8+ -- so long as the  eight inputs, one IO, and eight outputs would satisfy the requirement for the prop.

This could be done with the built in functions (sans hacking)?

Thank You

Quote from: bsnut on August 25, 2012, 12:19:06 PM
As you can see it uses a lot of serial commands, which takes up 86% of memory on the Prop-1. Now, if we move this program to the HC-8 like Jon is talking about in his first post of this thread, then you will have more memory to play with and you can call this program and many other programs that you may have.

Would you use the uSD card to store the program on?

Quote
BTW, take a look at this thread
http://www.efx-tek.com/php/smf/index.php?topic=1851.msg10976#msg10976
which gives you a test program that shows you the different Out-of-the-box features of the HC-8.

Yes, I did look at that thread before, in fact looking at the program made it clearer for me as to what the main purpose of the HC-8+ is.  That and when it was mentioned that the HC-8+ out of the box replaces the DC-16 and has functions of the FC-4 rolled into one.

I could see how a command is sent to the HC-8+ to call for a dim.  The HC-8+ then acts on that command while the program running on the Prop-1 continues to run.  By examining the program I can see that a tremendous load is removed from the Prop-1.

One thing is certain is that I know I can really make some elaborate fade chases now  (as you probably know that is what I am most famous for around here :) ).

Ok so far I am getting the gist.    Thinking things over, I would even go as far to say that the HC-8+ with a uSD card could even replace the Prop2.  Given the price is so close AND the board is the same size the HC-8+ seems to be the way to go.

Then on top of everything is the re-purposing of the HC-8+ by hacking.

Except for having to learn Spin, I don't see a downside!

Thanx for the info,

Geo

JonnyMac

August 26, 2012, 01:58:48 PM #4 Last Edit: August 26, 2012, 02:04:42 PM by JonnyMac
QuoteOk, so in a case like this a Vixen program on an uSD card would control the HC-8+ and you wouldn't need a Prop controller attached to it?

That is correct. Your program logic simply calls the "play" routine with the name of the Vixen file that it wants to play. If there is audio with it, the program would send the start command to the AP-16+ and then play the Vixen file.

QuoteThis could be done with the built in functions (sans hacking)?

By "hacking" I mean you're putting your program logic inside the HC-8+.  What this means is that you have access to the code and routines used by the standard program so you can mimic them, though you would do it manually.  For example, to send a 3-second cross-fade from the Prop-1 to the [unmodified] HC-8+ you need this serial command.

  SEROUT Sio, OT2400, ("!HC8", %00, "F", "X", 0, 1, 30)

Inside the HC-8+ you have direct control of the fade manager and would do it like this:

  fader.cross_fade(0, 1, 3000)

Now, that's not hard, is it? The .cross_fade method in the fader manager takes the channels (the first starts at 100%, the other at 0%) and the timing in milliseconds.  I don't know how I could make it any easier.  All the hard work having to do with timing and the mechanics of the fade are happening behind-the-scenes (that's tricky code, but you don't even have to look at it). BTW, once that line runs the fade is in action and your code can move on to do other things -- you do not have to wait for the fade to finish before proceeding.

QuoteWould you use the uSD card to store the program on?

Your program will run inside the memory of the HC-8+. The uSD card is used to store files created by Vixen (or other software that produces files you can read). The point is that you don't have to use the uSD, it just makes things easy by allowing you to test live by connecting Vixen to the HC-8+ and running a "streamer" program that understands your outputs.

If, however, your content to just write the code manually, you can do that, too.  In many cases this will be preferable when your code needs to do logic checks before proceeding.
Jon McPhalen
EFX-TEK Hollywood Office

jukingeo

Quote from: JonnyMac on August 26, 2012, 01:58:48 PM

That is correct. Your program logic simply calls the "play" routine with the name of the Vixen file that it wants to play. If there is audio with it, the program would send the start command to the AP-16+ and then play the Vixen file.

NICE!  Now if I could get it to sync to VIDEO, then that certainly would be a deal sealer.

QuoteWhat this means is that you have access to the code and routines used by the standard program so you can mimic them, though you would do it manually.  For example, to send a 3-second cross-fade from the Prop-1 to the [unmodified] HC-8+ you need this serial command.

  SEROUT Sio, OT2400, ("!HC8", %00, "F", "X", 0, 1, 30)

Inside the HC-8+ you have direct control of the fade manager and would do it like this:

  fader.cross_fade(0, 1, 3000)

Now, that's not hard, is it?

No, not at all.

Quote
The .cross_fade method in the fader manager takes the channels (the first starts at 100%, the other at 0%) and the timing in milliseconds.  I don't know how I could make it any easier.  All the hard work having to do with timing and the mechanics of the fade are happening behind-the-scenes (that's tricky code, but you don't even have to look at it). BTW, once that line runs the fade is in action and your code can move on to do other things -- you do not have to wait for the fade to finish before proceeding.

Send the instruction, move on, and let the HC-8+ do all the work.  Multitasking bliss!

Quote
Your program will run inside the memory of the HC-8+. The uSD card is used to store files created by Vixen (or other software that produces files you can read). The point is that you don't have to use the uSD, it just makes things easy by allowing you to test live by connecting Vixen to the HC-8+ and running a "streamer" program that understands your outputs.

If, however, your content to just write the code manually, you can do that, too.  In many cases this will be preferable when your code needs to do logic checks before proceeding.

Ok,it all sounds really cool.  I am starting to get the overall picture.  I am still fuzzy on the details, but I am certain that will clear up as I go along.

Thanx for the info,

Geo

JonnyMac

QuoteNICE!  Now if I could get it to sync to VIDEO, then that certainly would be a deal sealer.

If you can start a video player with the HC-8+ then you can.  All you have to do is take your video into a simple video editor and note the times where you want output events to happen.  Kip Polley does this now for his video-based props and he's using the EZ-8 programmed with Vixen (which allows him to ensure his outputs happen at a specific time).

QuoteMultitasking bliss!

It's easy when you can divide your tasks between processor cores.  Most PCs today have four to eight cores.  It just make sense to divide the load.
Jon McPhalen
EFX-TEK Hollywood Office

jukingeo

Quote from: JonnyMac on August 26, 2012, 06:53:14 PM

If you can start a video player with the HC-8+ then you can.  All you have to do is take your video into a simple video editor and note the times where you want output events to happen.  Kip Polley does this now for his video-based props and he's using the EZ-8 programmed with Vixen (which allows him to ensure his outputs happen at a specific time).

Hmmmm, that might work for triggered events that would be near the point desired.  I was thinking more about having lights move to the beat of a music video, on the beat...that kind of accuracy.   Could that be done?

Quote
It's easy when you can divide your tasks between processor cores.  Most PCs today have four to eight cores.  It just make sense to divide the load.

Yeah, my machine is an i5 quad core, but I really don't know how it divides the load.  It is a pretty fast machine though.

Thank you,

Geo

JonnyMac

QuoteCould that be done?

It is being done. Pale Night Productions does this in their props with the EZ-8 which is not as accurate as the HC-8+.
Jon McPhalen
EFX-TEK Hollywood Office

jukingeo

Quote from: JonnyMac on August 28, 2012, 09:25:43 PM
QuoteCould that be done?

It is being done. Pale Night Productions does this in their props with the EZ-8 which is not as accurate as the HC-8+.

Sweet!  If that can be done, then I am game.

JonnyMac

I'll be watching the order basket for your purchase. :)
Jon McPhalen
EFX-TEK Hollywood Office