Schematics soon - think of a Renard 24ss - remove 3 pics replace with one S08 - less one RS232 Transceiver also.
Can't do 10 bit dimming - not with a 8 bit micro to keep the cost down ... here's why.
Zero Crossing PWM occurs every half AC cycle - or 120 Hz (where I live) - that gives a total dimming window of 8333 usecs. Round that to 8000 because we need time to reset the process at the time of zero-cross.
Divide that 8000 into 1024 slots --- each slot is a unique dimming value and ALL Channels must be processed within that window --- we get a 1/1024 slot time of 7.8 usec.
Your illumination values are no longer 8 bits - they are 16. Each channel goes from 11 cpu processing cycles (when illumination was max 255) to 21 cycles because of the additional overhead of 8/16 bit math.
Each cpu cycle is 50 nsec or .05 usecs.
24 channels of dimming consumes .05 * 21 * 24 = 25.2 usec ... longer than the 7.8 usec window required.
Using this 8 bit micro - you can get 7 channels at 10 bit illumination levels - little cpu headroom left.
I originally was going to use a Star12x micro - 16 bit - same cycle time. You can do 12 channels of 10 bit illumination - but the micro cost $10 to $13.
That's one of the reasons I made this post so I could get your comments before I lock it down.
Is 12 channels with 1024 levels of illumination and a $10 adder better in the long term than a 24 channel with 256 levels?
There are other ways to design the firmware that would allow you to get at least 10-bit dimming. One way is to create a 16-entry (or 24-entry) table, where each entry holds two values. One value is a 24-bit mask of channels active (or becoming active) at the given time, and the other is a delay value from the previous update event. So during each event interrupt all that you need to do is read the active-channel mask, output it to the IO ports, and start a timer to expire on the next activity event. It's a bit of work to create/update that table, but with at most 24 dimming interrupts and a 20MHz instruction rate you have lots of time. This is for AC operation. For DC operation the task is even easier if you are using a BAM technique.
Thank you very much Phil. I can tell you have been looking at ways to count PIC cycles.
You sparked another thought.
Build the table in the Vixen output module and ship it. Protocol changes to be variable length (multiple channels changing on the same time slot) - (5 bytes per channel - 2 for the timer count and 3 for the channel mask).
Nice idea - now the dimmer time slot processing is very small.
1024 illumination values gives a processing window of 7.8 usec. As you said - lots of time!
12 bit dimming - or 4096 levels - requires a processing window of 1.95 usec or 39 cpu cycles. That's now in the same time period as processing a RS485 character. That needs looking into so as not to loose one.
With a little work - 24 channels at 4096 illumination levels may even be possible.
Thanks again for the input Phil.
What is the BAM technique?
Perhaps look at 10-bit and possibly implement some type of dimming curve look-up. You may not need a unique curve for all 24 channels (to save space) since you tend to use similar light strings on multiple channels. I've seen the effect of this with some of the pixel strings (3001 type) and it's just a night and day difference (at least with LED strings).
Thanks.
I was thinking of non-linear dimming curves myself - but I was going to put them as part of the Vixen Output module processing.
It becomes just a simple table look up on the PC and no overhead on the little controller.
You can do THAT today with your existing controller.
