November 23, 2024, 04:31:17 AM

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.


Small HC-8+ Demo with Prop-1

Started by JonnyMac, March 06, 2012, 03:03:00 PM

Previous topic - Next topic

JonnyMac

March 06, 2012, 03:03:00 PM Last Edit: March 07, 2012, 06:52:10 AM by JonnyMac
Oi vey, it took a looonng time to get the HC-8+ done!  I won't bore you with the details, but there is good news: the firmware is done, we have a small production run in house, and we can start selling them to the public (thus far only OEM customers have had access).

The firmware was a beast! (1500+ lines of code, but who's counting!)  That said, the same code will roll into the FC-4+ (we just got prototypes) and RC-4+ (in design) with very few modifications, and if you're using these new products (the "+" series) you'll have a unified command set (the RC-4+ won't, of course, be able to do fading and levels outputs, but it will do all the rest).

The HC-8+ firmware combines features from the DC-16 and from the FC-4, though the outputs are DC (it's a great product for LED lighting control).  The best part is that you can do multiple fades and cross-fades at the same time -- no more waiting on one fade to finish before starting another.  And there are commands that allow you to modify some channels without bother others.

We completely re-built the command set and think it's a lot better, espeically as it will be integrated across multiple products. 

Here's a little demo that I wrote to use as a test base.  All the features are explained in the comments but there's not enough room in the Prop-1 to test them (I did test all with a Prop-1, and then removed the boring stuff).

We know you've waited a long time for this product -- we hope that like it as much as we do.  I'm smiling like a wild man right this second!

' =========================================================================
'
'   File....... HC-8_Test.BS1
'   Purpose.... HC-8 Features Test
'   Author..... EFX-TEK
'   E-mail..... teamefx@efx-tek.com
'   Started....
'   Updated.... 06 MAR 2012
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
'
' Demonstration program for the HC-8+ IO Control Board.  All commands are
' sent to the HC-8+ through a serial link at 2400 baud (OT2400 baudmode).
' The use of the open baudmode allows boards to be daisy-chained for up to
' 32 fader outputs from one I/O pin.
'
' Configuration swtich settings
'  -- BR = off (2400 baud for Prop-1)
'  -- A1 = high bit of address
'  -- A0 = low bit of address
'  -- SM = off (for EFX-TEK serial mode)
'
' Command syntax: "!HC8", address, cmd {, data ... }
' -- where "address" is %00 (0) to %11 (3), or $FF (255) for all
' -- "cmd" is a single character
' -- optional "data" is one or more bytes
'
' Valid commands:
'
'   "!HC8", address, "X"
'     -- sets all channels to 0% (off)
'
'   "!HC8", address, "V"
'     -- requests version string from HC-8+
'     -- should be followed by SERIN to receive three-byte string
'     -- does not work with global address
'
'   "!HC8", address, "L", channel, level
'     -- sets "channel" to "level" 0 (0%) to 255 (100%)
'        * channel is 0 to 7 (one channel) or "A" (all channels)
'
'   "!HC8", address, "L", "I", level0, level1, level2, ... level7
'     -- sets all channels individually
'     -- transmit up to eight levels
'        * if less than 8 last byte must be followed by 50ms PAUSE
'
'   "!HC8", address, "L", "R", mask
'     -- randomize channel levels between 0 and 255 (0% to 100%)
'     -- only channels with "1" in "mask" bit are modified
'        * e.g., mask = %00001111 (only OUT0 to OUT3 updated)
'
'   "!HC8", address, "D", channel, state
'     -- sets output in "channel" to state.bit0
'        * channel is 0 to 7 (one channel) or "A" (all channels)
'
'   "!HC8", address, "D", "S", states, mask
'     -- sets select outputs (defined by "mask") digitally (off or on) to "states"
'     -- only channels with "1" in "mask" bit are modified
'
'   "!HC8", address, "D", "R", mask
'     -- digitally randomizes outputs (on or off)
'     -- only channels with "1" in "mask" bit are modified
'
'   "!HC8", address, "F", "L", channel, start, stop, seconds
'     -- fade channel from start to stop
'        * channel is 0 to 7 (one channel) or "A" (all channels)
'     -- duration of fade is seconds
'
'   "!HC8", address, "F", "M", channel, start, stop, tenths
'     -- fade channel from start to stop
'        * channel is 0 to 7 (one) or "A" (all channels)
'     -- duration of fade is tenths x 100ms
'
'   "!HC8", address, "F", "H", channel, start, stop, msLow, msHigh
'     -- fade channel from start to stop
'        * channel is 0 to 7 (one) or "A" (all channels)
'     -- duration of fade is milliseconds
'
'   "!HC8", address, "F", "X", chA, chB, tenths
'     -- cross fades from "chA" and "chB"
'     -- "chA" starts at 100%
'     -- "chB" starts at 0%
'     -- duration of fade is tenths x 100ms
'
'   "!HC8", address, "G", channel
'     -- retrieves present dimmer level of single channel (0 to 7)
'     -- should be followed by SERIN to receive level
'     -- does not work with global address
'
'   "!HC8", address, "I"
'     -- retrieves TTL inputs
'     -- should be followed by SERIN to receive inputs byte
'     -- does not work with global address
'
'
' Note: The ULN2803A interferes with serial transmission to HC-8+; remove
'       and replace with ULN2003A (7 channels), leaving P7 contacts open.


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


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

SYMBOL  Sio             = 7                     ' SETUP = out, no ULN


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


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

SYMBOL  id0             = B0                    ' version string
SYMBOL  id1             = B1
SYMBOL  id2             = B2

SYMBOL  ch              = B3
SYMBOL  level           = B4

SYMBOL  timing          = W5
SYMBOL   tmLo           =  B10
SYMBOL   tmHi           =  B11


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

Reset:
  PAUSE 1500                                    ' let HC-8+ boot up
  SEROUT Sio, OT2400, ("!HC8", %00, "X")        ' reset HC-8+


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

Main:
  SEROUT Sio, OT2400, ("!HC8", %00, "V")        ' get version
  SERIN  Sio, OT2400, id0, id1, id2

  DEBUG CLS
  DEBUG "HC-8+ Version ", #@id0, #@id1, #@id2, CR
  PAUSE 500


  ' digital control of single channel
  FOR ch = 0 TO 7
    SEROUT Sio, OT2400, ("!HC8", %00, "D", ch, 1)
    PAUSE 50
  NEXT
  FOR ch = 0 TO 7
    SEROUT Sio, OT2400, ("!HC8", %00, "D", ch, 0)
    PAUSE 50
  NEXT

  PAUSE 500


Test:
  ' cross-fade from OUT0 to OUT1 in 3 seconds
  SEROUT Sio, OT2400, ("!HC8", %00, "F", "X", 0, 1, 30)

Wait1:
  ' digital random value on OUT7..OUT4
  SEROUT Sio, OT2400, ("!HC8", %00, "D", "R", %11110000)

  ' check status of channel 0
  ' -- wait for x-fade to finish
  SEROUT Sio, OT2400, ("!HC8", %00, "G", 0)
  SERIN  Sio, OT2400, level
  IF level > 0 THEN Wait1

  ' cross-fade from OUT1 to OUT0 in 3 seconds
  SEROUT Sio, OT2400, ("!HC8", %00, "F", "X", 1, 0, 30)

Wait2:
  ' random levels on OUT7..OUT4
  SEROUT Sio, OT2400, ("!HC8", %00, "L", "R", %11110000)

  ' check status of channel 1
  ' -- wait for x-fade to finish
  SEROUT Sio, OT2400, ("!HC8", %00, "G", 1)
  SERIN  Sio, OT2400, level
  IF level > 0 THEN Wait2

  GOTO Test


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


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

HauntedWolf

What will the price be on this beauty?
Robert

Haunted Wolf Hollow - http://www.hauntedwolfhollow.com

JonnyMac

March 21, 2012, 03:18:30 PM #2 Last Edit: March 21, 2012, 03:21:31 PM by JonnyMac
$129.95 with the usual discounts for 5 and 10.  Docs and sales pages will be up by the weekend.

I'm also creating a video series called "Hacking the HC-8+" to show people how with a $15 programming adapter and the Propeller Tool software from Parallax (free)  they can unleash the power of eight 32-bit processors (yes, we will share our libraries for dimming, servos, RS-485, DMX in and out, etc.).


Sneak peek: Yesterday I tested a uSD card adapter prototype (hence purple and unmarked) for the HC-8+ (in stand-alone apps) -- works great.  Hmmm... now I can run VSA shows right from this device with audio coming from the AP-16+.  Working up a demo for HauntCon.
Jon McPhalen
EFX-TEK Hollywood Office

HauntedWolf

Quote from: JonnyMac on March 21, 2012, 03:18:30 PM
Sneak peek: Yesterday I tested a uSD card adapter prototype (hence purple and unmarked) for the HC-8+ (in stand-alone apps) -- works great.  Hmmm... now I can run VSA shows right from this device with audio coming from the AP-16+.  Working up a demo for HauntCon.

Does this replace the RAPU from Brookshire?  Interesting!  Now the HC-8+ replaces the AP-16+, right?  Does it have audio too?
Robert

Haunted Wolf Hollow - http://www.hauntedwolfhollow.com

JonnyMac

The idea is that the HC-8+ will play the servo/dimmer sequences (eight total channels) and the AP-16+ will play the audio -- you will need both to replace the RAPU.  With eight trigger inputs you can have eight shows, or... you can set it to use one trigger input and randomize the shows you have on the card (up to 16).

This is all a work in progress and I fear I should have kept my mouth shut....
Jon McPhalen
EFX-TEK Hollywood Office

HauntedWolf

Quote from: JonnyMac on March 21, 2012, 04:40:24 PM
This is all a work in progress and I fear I should have kept my mouth shut....

I won't tell a soul....sounds like a lot of possibilities. 

Now, was I mistaken, isn't the AP-16+ a thing of the past?
Robert

Haunted Wolf Hollow - http://www.hauntedwolfhollow.com

bsnut

QuoteNow, was I mistaken, isn't the AP-16+ a thing of the past?
No. The AP-16+ is also a new product that has been around for over a year that replaced the AP-8.
William Stefan
The Basic Stamp Nut

livinlowe

Quote from: HauntedWolf on March 21, 2012, 03:36:43 PM
Quote from: JonnyMac on March 21, 2012, 03:18:30 PM
Sneak peek: Yesterday I tested a uSD card adapter prototype (hence purple and unmarked) for the HC-8+ (in stand-alone apps) -- works great.  Hmmm... now I can run VSA shows right from this device with audio coming from the AP-16+.  Working up a demo for HauntCon.

Does this replace the RAPU from Brookshire?  Interesting!  Now the HC-8+ replaces the AP-16+, right?  Does it have audio too?

Wow! Even with the purchase of both the HC-8+ and a AP-16+, the price is a $100 less than a RAPU! That's pretty amazing!
Shawn
Scaring someone with a prop you built -- priceless!

HauntedWolf

Quote from: bsnut on March 21, 2012, 11:34:08 PM
QuoteNow, was I mistaken, isn't the AP-16+ a thing of the past?
No. The AP-16+ is also a new product that has been around for over a year that replaced the AP-8.
I actually have an AP-16+ already, that a bought almost 2 years ago, but I thought there was an announcement that the AP-16+ was dead:

http://www.efx-tek.com/php/smf/index.php?topic=1538.0

That's why I was surprised to see it mentioned here....
Robert

Haunted Wolf Hollow - http://www.hauntedwolfhollow.com

bsnut

Robert,

You must be getting a little confused which is OK. The HC-8+ replaces the DC-16, which was a 16 channel output board. And the AP-16+ is an audio board that replaced the AP-8
William Stefan
The Basic Stamp Nut

HauntedWolf

Quote from: bsnut on March 22, 2012, 08:43:31 AM
Robert,

You must be getting a little confused which is OK. The HC-8+ replaces the DC-16, which was a 16 channel output board. And the AP-16+ is an audio board that replaced the AP-8

DOH!!!!!  I've read that thing a couple of times and I TOTALLY missed it...I must have focused on the "16".  Thanks for pointing that out...

I thought I was going crazy there for a minute (even more than normal).    ;D
Robert

Haunted Wolf Hollow - http://www.hauntedwolfhollow.com

JonnyMac

March 23, 2012, 11:29:46 AM #11 Last Edit: March 23, 2012, 11:35:14 AM by JonnyMac
Yes, for clarification, the HC-8+ replaces the DC-16 and for all intents and purposes, the Prop-SX as well. 

Why?

On the DC-16... most users told us they needed more current, not so many outputs.  Remote inputs was also a request.  The HC-8+ gives us eight of each.

On the Prop-SX... like the DC-16, it used the SX microcontroller which has gone EOL (end of life) so it's not suggested for new designs.  Many love all the features we packed in the the AP-16+ (AP = Audio Player) and we were able to do this due to the awesome horsepower of the Parallax P8X32A ("Propeller") processor. 

We will support and encourage anyone that wants to "hack" (this is not a derogatory term) the HC-8+, in fact, we've posted a template that has all the pin assignments and several methods (what subroutines are called in Spin, the default language of the P8X32A) for basic IO.  Advanced features (e.g., basic serial IO, advanced serial like DMX and MODBUS, dimming, etc.) are handled by special software modules called objects.  We have a variety of objects coded over the years that we will share with the EFX-TEK community; this will allow you to focus on your application as the "gritty details" have been handled by us.
Jon McPhalen
EFX-TEK Hollywood Office