PDA

View Full Version : Run a Renard without a computer



bcstuff
10-09-2011, 05:43 PM
Anybody have some generic PIC code that would allow me to run a Renard controller without a computer. I would be interested in either regular renard or DMX code.

What ideally I want to happen is kind of like the cheap 3ch DMX controllers. You know where it will start to cycle through colors when their is no signal but I will take anything you might have.

I have 12 pumpkins with some basic RGB modules i just want to blink or fade in out without the computer, so I can do other sequenced show stuff while they are just doing their thing.

If I had a better understanding of code I'm sure I could figure it out, but I don't. The beta diagnostic code looks like it might be able to be modified since it will turn on and off all channels but I am at a loss for this.

Any help, or even directions to point me in to write my own code would be appreciated.

Thanks,
Brian

P. Short
10-09-2011, 07:31 PM
It's not clear what you are trying to do. Do you want the firmware to be solely standalone (never responding to serial input), or do you want it to do some sort of background stuff when it isn't receiving any data? Do you want each PIC to be completely independent, or do you want some sort of server-client setup?

At the moment I have a firmware that I created for another forum member that does a cylon-eyes thing, and another one that does some sort of bicycle-spokes sort of thingy. Both are for LEDs only (all of the AC support has been removed).

bcstuff
10-09-2011, 07:45 PM
Phil,
I would be OK with either never responding to serial but the doing background when not receiving data would be better.

Ideally if the first Pic could tell the others what to do that would be best, so I would only have to pull one pic and reprogram it to change the controller but I am not opposed to pulling all the pics and reprogramming them.

I have a Ren48 running 12 sets of RGB LED modules. I just want the RGB modules to be independent and fade or blink a simple pattern, so I don't have to run the computer all the time. I would just put it on a plug timer and have it come on and go off.

I am game for whatever you have to play around with, like both firmwares you have mentioned although they are not exactly what I want them to do, I could look and learn and possibly modify them to fit my needs.

Thanks,
Brian

P. Short
10-09-2011, 07:57 PM
That was quick.

Anyway, I was hoping that it was the simplest situation (DC, each PIC is completely independent, and does not have to respond to serial input).

The code for those other modules that I mentioned was created from the Renard firmware, stripping out all of the serial communications stuff, and adding some simple sequencing logic. I'd have to think about how easy (or hard) it would be to add a 'hook' to the start-address firmware that you could add your own logic (either called all of the time, or only when nothing has been received for a while). I'm hoping that you are able to do the rest yourself.

bcstuff
10-09-2011, 08:08 PM
Phil,
Simple sequence logic that sounds like that would work.
How hard would it be for me to figure out what command did what and just build a simple fade up fade down or for a channel then the next and so on. Repeat forever and start when power is applied.

I would be willing to run with this on my own. My plan was if I got the code you already had, clyon/spokes, I would compare them and tinker to try to figure it out.

I am game for learning as long as you don't mind me asking a few questions during the learning process.

Thanks,
Brian

P. Short
10-09-2011, 08:24 PM
Like I said, I have to think about how to do something that would be of slightly more use than just for this. It might be a couple of days.

bcstuff
10-09-2011, 09:22 PM
No problem,
Thanks for looking into this Phil.

Brian

gdyrdave
10-09-2011, 09:26 PM
I personally would like the cylon firmware.

jboyles7
10-10-2011, 12:59 PM
You could step back one level and have a "driver board" in between the PC and the first renard in the chain. The driver would simply have a 50ms clock that sends a very simply looping vixen data stream out or passes serial along.

P. Short
10-10-2011, 01:18 PM
You could step back one level and have a "driver board" in between the PC and the first renard in the chain. The driver would simply have a 50ms clock that sends a very simply looping vixen data stream out or passes serial along.

Either way, code has to be written.

ErnieHorning
10-10-2011, 01:43 PM
Here’s a perfect example of the Renard player that you’ve mentioned a few times. Just an external PIC micro that plugs into the beginning of a Renard serial chain and just sends commands without a computer.

There was talk about one that used a plug-in to program external memory. There was also a discussion about one that listened to the standard Renard plug-in and recorded the values and timing of a sequence from a PC. The discussions seem to end when someone suggests playing an actual sequence file and emulating Vixen.

kychristmas
10-10-2011, 01:55 PM
Here’s a perfect example of the Renard player that you’ve mentioned a few times...

Hmm, do I need a DIYC secret decode ring to see it? Or were you saying this is an "example of need"?

budude
10-10-2011, 02:00 PM
I swear I have seen a post or two about someone creating a player for wireframes on here somewhere... There is also joeytx's Renard tester that could be modified to be a player into a normal Renard.

ErnieHorning
10-10-2011, 02:17 PM
Or were you saying this is an "example of need"?It seemed to make sense when I typed it though typically instead of speaking, I just grunt.

AFAIK, there has never been a physical device made. Just talk of how it would be nice.

kychristmas
10-10-2011, 02:30 PM
I have code that works thought I can't remember where I got it. It's only for 8 channels. There was definitely a nice Renard Tester who's PIC code would be a great place to start.

jboyles7
10-10-2011, 02:35 PM
agreed...

bcstuff
10-10-2011, 03:49 PM
When searching I originally found and read this thread.

http://doityourselfchristmas.com/forums/showthread.php?10483-stand-alone-Renard-card-code

barbotte
10-10-2011, 03:57 PM
is it the same as mr cristmas 6 or 12 chanell ??? i do have a mr christmas 12 chanel here but only play christmas music ,,i know there is one that also play haloweem stuff ,,just a though..
cheer

P. Short
10-10-2011, 03:57 PM
OK, I've got some sample code here that flashes all of the lights on and off at about a two-second pace (don't time me...) when there isn't any incoming data. It doesn't send data downstream, although code could be added to do so at the spot where new code is hooked in.

I'm not sure if I want to upload the code for general use yet, for fear that it would be confused with the regular Renard start_address firmware. Any suggestions (or volunteers) for avoiding a general mess at this point?

PS By 'here', I mean on my computer.

kychristmas
10-10-2011, 04:17 PM
Here is the "Ren Tester" http://doityourselfchristmas.com/forums/showthread.php?8146-Ren-Tester-LCD from Joeytx. I think this would be the best basis for turning a Ren Controller into standalone. Simply customize the PIC code, remove the buttons and LCD Panel (maybe not). I say this half jokingly because I was not really smart enough to modify the Assembler version.

Ideally, I would like to shrink this down to a board similar to Dirk's "Xbee Snap-in"

Mactayl
10-10-2011, 06:04 PM
OK, I've got some sample code here that flashes all of the lights on and off at about a two-second pace (don't time me...) when there isn't any incoming data. It doesn't send data downstream, although code could be added to do so at the spot where new code is hooked in.

I'm not sure if I want to upload the code for general use yet, for fear that it would be confused with the regular Renard start_address firmware. Any suggestions (or volunteers) for avoiding a general mess at this point?

PS By 'here', I mean on my computer.


I'd like to try it an modify it for the PIC18Fxxxx stuff if thats OK with you.

P. Short
10-10-2011, 06:47 PM
I'd like to try it an modify it for the PIC18Fxxxx stuff if thats OK with you.

Sent. Not that there is much to it. It's just a counter that is incremented at the end of each PWM cycle (120 times/sec for 60 Hz, 100 times/sec for 50 Hz), and is reset whenever a character is received. When that counter overflows the user code is called.

Mactayl
10-10-2011, 06:50 PM
I will try it tonight.:)

Thanks Phil,

Mactayl
10-10-2011, 07:41 PM
Took a quick look at it and as for other controllers down the line if they had the firmware installed they would also start running there own sequence and you would not need to transmit any data from the first controller to the other controllers as the they would respond to the Renard data stream as soon as they receive Renard data correct

P. Short
10-10-2011, 07:55 PM
Yes. It could be done either way - each controller could run independently when the data stops coming, or the lead PIC could start sending data when it stops receiving data. In the latter case all of the downstream PICs would see a one or two second gap in incoming data before the first PIC starts sending, so they would need to be programmed to ignore that gap (i.e. use current, unmodified firmware). At the moment that duration of that gap is hard-coded, but it would be fairly easy to make it configurable.

Mactayl
10-10-2011, 08:07 PM
I really think a lot of folks would like this option during a break in the show where there lights could just flash independently of there show or run them in a random sequence before of after there show or just about anything else.

erm213
10-10-2011, 08:17 PM
How many bits of sequece data could be stored on the PIC16F688? It would not be too hard for me to write a plugin to output the bits representing the data into a .asm file that could be compiled. Or maye another PIC16 that has the same pinout and more data? Just a thought.

Erik

tjetzer
10-10-2011, 09:12 PM
This would interest me greatly for my Ren48 with Super Strips. I leave them up all year but don't run them due to them needing a PC. I would run them all night long in fading patterns if it were possible to do it without a PC.

budude
10-10-2011, 09:19 PM
I want to implement the code on the Ren4Flood at some point so I'd be interested...

djulien
10-10-2011, 09:20 PM
How many bits of sequece data could be stored on the PIC16F688?

I think that depends on what format you store them in. If you use 1 byte per channel per interval, you could use up the available flash memory ((4K words - what is used for the firmware)/#channels/#intervals you want), or if you stored them as bitmaps or threaded function codes, you could get potentially a lot more in there.

don

nuelemma
10-10-2011, 09:21 PM
This sounds like an interesting project. http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2680&dDocName=en537999

http://ww1.microchip.com/downloads/en/AppNotes/01045b.pdf

P. Short
10-10-2011, 09:23 PM
@erm213 - Not a lot - the eeprom is only 256 bytes, the data RAM is similarly limited, and the program memory is not writable. The data patterns would have to be algorithmically generated with a small amount of custom code, it's not really practical IMO to download part of a vixen sequence into the part (besides, there isn't an interpreter available for Renard now).

@tjetzer - that's possible, if someone is up to writing the code for that. Are you more interested in having each PIC run independently, or have server/client type of setup? Bear in mind that the clocks are not perfectly synchronized, so even if the patterns will end up out of phase, even if they started out in sync.

P. Short
10-10-2011, 09:25 PM
@budude - while it isn't there now, I intend to incorporate the ren4flood changes into this code. It's only a few lines of code to do the r4f changes.

tjetzer
10-10-2011, 09:27 PM
@erm213 - Not a lot - the eeprom is only 256 bytes, the data RAM is similarly limited, and the program memory is not writable. The data patterns would have to be algorithmically generated with a small amount of custom code, it's not really practical IMO to download part of a vixen sequence into the part (besides, there isn't an interpreter available for Renard now).

@tjetzer - that's possible, if someone is up to writing the code for that. Are you more interested in having each PIC run independently, or have server/client type of setup? Bear in mind that the clocks are not perfectly synchronized, so even if the patterns will end up out of phase, even if they started out in sync.

Phil,

Quite honestly in my case I don't really care. A server/client setup would be fine if could swap the first PIC and leave the existing PICs in place w/o modifying their code. If not, swapping all 6 PICs would be fine. I guess it's easiest to say, whatever the solution is I would be happy.

P. Short
10-10-2011, 09:30 PM
@nuelemma,

That product description only mentions PIC18 and up, not the PIC16 family. And, unfortunately, I don't think that the PIC16F688 socket is compatible with anything from those part families. To use that product would probably require an approach like joeytx used.

P. Short
10-10-2011, 09:36 PM
The thing that worries me about the server/client approach (although master/slave or primary/secondary terminology is more accurate) is that the amount of processor horsepower is limited, which in turn limits both the complexity of the display pattern and the number of downstream nodes on the network. I'm thinking that the firmware complexity increases if the outgoing packet takes longer than 1/120 sec to transmit (for 60Hz AC line frequency).

budude
10-10-2011, 09:36 PM
@budude - while it isn't there now, I intend to incorporate the ren4flood changes into this code. It's only a few lines of code to do the r4f changes.

Awesomeness -- many thanks Phil!

erm213
10-10-2011, 09:41 PM
@erm213 - Not a lot - the eeprom is only 256 bytes, the data RAM is similarly limited, and the program memory is not writable. The data patterns would have to be algorithmically generated with a small amount of custom code, it's not really practical IMO to download part of a vixen sequence into the part (besides, there isn't an interpreter available for Renard now).

@tjetzer - that's possible, if someone is up to writing the code for that. Are you more interested in having each PIC run independently, or have server/client type of setup? Bear in mind that the clocks are not perfectly synchronized, so even if the patterns will end up out of phase, even if they started out in sync.

Not a lot of room, except for a very small sequence. Oh well. Thanks for the reply.

Erik

P. Short
10-10-2011, 09:42 PM
I suspect that Mac or bcstuff will request some change, and I'll add the r4f change at that time.

relewis
01-13-2012, 05:38 PM
Just a thought on this one. It would be good to have either a standalone pic with serial in and out, or and option in the base renard firmware that when no serial is received for a period (say of over 1 minute) that all outputs are turned on, so that if the PC crashes or is not available for other reasons I can still see my lights.
Rob

rjchu
01-13-2012, 06:33 PM
Just a thought on this one. It would be good to have either a standalone pic with serial in and out, or and option in the base renard firmware that when no serial is received for a period (say of over 1 minute) that all outputs are turned on, so that if the PC crashes or is not available for other reasons I can still see my lights.
Rob

What about during the day when, presumably, no signals are sent out from Vixen to the Renard controllers?

-joni-

CaptKirk
01-13-2012, 07:43 PM
Ok, so it needs a real time clock that is automatically updated from the web that knows when daylight and nighttime are and turns it off at sunup. It should then make coffee and some toast- light brown, lightly buttered - oh and a bagel - with cream cheese - and maybe some fresh squeezed orange juice.... and for lunch....

Lets not get TOO out of control on this... ;-)

WireWrap
01-14-2012, 05:00 AM
Just a thought on this one. It would be good to have either a standalone pic with serial in and out, or and option in the base renard firmware that when no serial is received for a period (say of over 1 minute) that all outputs are turned on, so that if the PC crashes or is not available for other reasons I can still see my lights.
Rob

One other disadvantage of this is where you may have x number of mini-trees each wrapped with R,G,B, &W -- you might overload your power input if you had only planned for one color to be on at once. All-on might be a bad choice; perhaps 30% or less might be better...

But I'm not sure if there's enough room in the PICs for that much more code -- I'll defer to Phil (Guru Extrordinaire) on that score...



:)