Renard Start Address Configuration Guide: Difference between revisions

From doityourselfchristmas.com
Jump to navigation Jump to search
Line 33: Line 33:


== How to calculate the start address ==
== How to calculate the start address ==
:The formula for the start address is A=(C-1)/8 where C is a channel number that you want the controller to start with. Examples: 9, 17, 25, 33, 41, 49, 57, etc. Do you notice that the channel number is always one more than a number evenly divisible by eight? This is because each PIC in a typical Renard controller controls 8 channels. Therefore, the last channel number in a Renard controller is always a factor of 8 and why the next channel number is 1 greater.
:The formula for the start address is '''A=(C-1)/8''' where C is a channel number that you want the controller to start with. Examples: 9, 17, 25, 33, 41, 49, 57, etc. Do you notice that the channel number is always one more than a number evenly divisible by eight? This is because each PIC in a typical Renard controller controls 8 channels. Therefore, the last channel number in a Renard controller is always a factor of 8 and why the next channel number is 1 greater.


== Multi-PIC Controllers ==
== Multi-PIC Controllers ==

Revision as of 20:35, 3 April 2010

Background

One of the main goals of the original Renard controller design was simplicity, and it was the original intent that all Renard controllers were identical, 8-channel units. Simplicity allowed for a person to expand a system simply by building and plugging in another 8-channel controller; 8 would then become 16, 16 would become 24, etc. Because the controllers were identical they were also interchangeable – it didn’t matter which was the first one and which the second or third one. There was no need for the user to set an address for this controller or that controller; it was simply “plug in and go.” However, with the advent of 16, 24, and even 64-channel Renard controllers, the concept has expanded over the years and has evolved into increasingly complex networks of controllers and thousands or even miles of wires. But the original firmware that has been used in the Renard system has remained simple and unaddressable. Until now.

What is the Start Address?

The start address is a new feature of Renard firmware that makes a single Renard controller addressable. Not in the purest sense such as an IP address or network name, but in a relative sense to the channel information that is sent to it. The feature allows a Renard controller to start decoding channels at a specific channel out of an entire range of channels. For example, instead of a controller automatically displaying channels 1-24, it can be set to skip channels 1-24 and start with channel 25 instead.
The feature is primarily designed to aid those who use wireless communications in their light displays (although it can also be used with wired RS-485 systems). With wireless, it’s easy to broadcast all channels; all receivers in range of the transmitter will then pick up the same signal simultaneously. The start address provides a way for a wireless controller to begin decoding data at a specific channel out of the entire broadcast set of channels.

Who should use it?

The Renard start address feature is considered to be an advanced concept and is very likely to be quite confusing to someone new to DIY lighting controls. To successfully implement the feature, a solid understanding of how Renard controllers function normally is extremely important. One must also know how to modify assembly language program code, how to compile the code into HEX format and flash a PIC with the updated firmware. It’s good to remember that if you make a mistake with the start address, you can always restore your Renard controller to normal operation by reflashing the PIC with the original Renard firmware.

Renard Start Address Concepts

For the sake of explanation, consider a typical 32-channel Renard system utilizing a computer and four identical 8-channel controllers where the computer’s control signal connects to the first controller and all the other controllers are in a daisy-chain configuration, such as the example below.
(graphic here)
Our example uses an 8-channel controller because it has only a single PIC16F688 chip, which will be critical to understanding how to set the starting address feature later on. Another helpful concept is to remember that many Renard controllers can be connected to a single serial port and that there’s a limit to the total number of channels a single port can handle, and this is generally based on the sequence timing you use in Vixen. This is important because the starting address pertains to all the channels that come from a single serial port. If you use both COM1 and COM2, the starting addresses for controllers on COM1 are independent from starting addresses for controllers on COM2.
Let’s change the normal Renard layout by connecting a 4-way splitter to the serial cable and then plugging each of the four 8-channel controllers into the splitter so that all four controllers can receive the same 32-channel signals simultaneously in a sort of “serial broadcast.” In this example, each controller uses the first eight channels of the 32-channel data and passes the remaining channels to the next controller – except the controllers aren’t connected to one another! Therefore, in this layout, each 8-channel controller gets only the first 8 channels and channels 9-32 don’t go anywhere because there is no “daisy chain” of controllers – each is an individual, standalone controller and has nowhere to pass the unused channel information along.
(graphic here)
Now let’s reflash the PIC in each controller with a “start address” that tells the PIC that instead of automatically taking the first channels it gets, to start decoding data at a different channel number instead.
(graphic here)
• Address 0 means normal operation.
• Address 1 means start with channel 9 (skip channels 1-8)
• Address 2 means start with channel 17 (skip channels 1-16)
• Address 3 means start with channel 25 (skip channels 1-24)
Now all 32 channels are in use again.
Let’s switch gears again and replace the 32-channel setup with a 64-channel wireless model where all 64-channels are broadcast wirelessly from the computer and each 8-channel wireless controller is configured using individual starting addresses from the full 64-channel broadcast. Using identical controllers makes it easy to calculate the starting address for each unit. (This particular design would also require that all Ren-W wireless adapters be configured with the same PAN ID and no individual XBee radio addressing would be used at all. This is the purest “global broadcast” mode possible and one of the simplest ways to implement a Ren-W network yet retain individual controller channel assignments.)
The start address concept is most effective when all channel information can be distributed to all controllers simultaneously and is a perfect fit for those who use Ren-W wireless adapters.

How to calculate the start address

The formula for the start address is A=(C-1)/8 where C is a channel number that you want the controller to start with. Examples: 9, 17, 25, 33, 41, 49, 57, etc. Do you notice that the channel number is always one more than a number evenly divisible by eight? This is because each PIC in a typical Renard controller controls 8 channels. Therefore, the last channel number in a Renard controller is always a factor of 8 and why the next channel number is 1 greater.

Multi-PIC Controllers

So far, the examples have used only 8-channel controllers that use a single PIC. When you use controllers that have multiple PICs, the formula works the same way. Let’s examine a 64-channel system using four 16-channel wireless Renards.
  • Apply the formula: A=(C-1)/8 for the first controller: 1 – 1 = 0, then 0/8 = 0 so the start address of the first controller is zero.
  • We want the 2nd controller to start with channel 17, so applying the A=(C-1)/8 formula, we get a start address 2 for the 2nd controller: 17-1= 16, divide 16/8 = 2.
  • We want the 3rd controller to start with channel 33, and applying the formula we get a start address of 4: (33 – 1 = 32, then 32/8 = 4).
  • The 4th controller will start with channel 49, and we calculate that start address at 6: (49 – 1 = 48, then 48/8 = 6).
Here’s an example of a 96-channel wireless design using four, 24-channel controllers. Applying the A=(C-1)/8 formula we arrive at start address 0, 3, 6 and 9 for the four controllers.
(graphic here)

Mixing controllers with different channel counts

When start addresses are used with controllers of varying channel counts, just use the formula to calculate the start address for each controller one controller at a time. In this 80-channel design with 5 controllers, in L-R order each controller’s channel counts are 24, 8, 16, 24 and 8. You can do the math yourself.
It’s obviously a good idea to pre-plan your display and assign controllers to various portions of your display depending on the number of channels you need in each location. As you do that, you’ll find it helpful to label each controller in some way to denote where in the display it will be, the expected channels it will use and its start address. This will make it easier later on when/if something isn’t working right. Without labeling the controller, there will be no outwardly visible way to know what it’s supposed to be doing except by watching its lights.

Which PIC gets the start address?

Only the first PIC in each controller. If you don’t know which PIC that is or it isn’t marked, follow the circuit board tracings from the channel 1 output back to its PIC.

Can I set the address in more than one PIC on a controller?

Technically yes, but in practice, don’t do it. It may make it very difficult for you to analyze what’s going on in your display afterward. Set the start address only on the first PIC and leave the others alone.


What if I need to replace a controller in my display?

Use another Renard controller of the same channel count that has the first PIC flashed with the same START_ADDR and simply plug it in.


Can I flash the PIC in my Renard controller in-circuit?

Unless you have added in-circuit programming capability to your controller, you will have to remove the first PIC and flash it with your PIC Programmer as you normally would. The concept of adding an in-circuit header to a Renard controller is a good one – perhaps someone will come up with a DIY solution in the future!


If I move a controller in my display, should I change the start address, too?

Maybe. It depends on what channels you want the controller to use.


Can I change my XBee modules’ PAN ID addresses, too?

es, and in some cases it may actually be required. For example, if you have two serial ports and plan to broadcast channel controls out on both, you will need to use two PAN IDs, one for each port. If you used the same PAN ID for both ports, the XBee receivers will get very confused when they get transmissions from two sources simultaneously! Remember, only XBee radios that use the same PAN ID can communicate with one another.