Do It Yourself Christmas Forums  

Go Back   Do It Yourself Christmas Forums > Hardware > DMX
Home Page File Library Christmas Wiki Newsletter Live Chat Member Map

DMX DMX-512 theatrical lighting control

Reply
 
Thread Tools Display Modes
  #1  
Old 02-04-2009, 03:55 AM
srm srm is offline
Member
 
Join Date: Dec 2007
Location: Melbourne, Australia
Posts: 35
Default Hacked firmare for jec's DIY pixel

Hi All,

I've modified the firmware for JEC's DIY pixel
to allow for programming of the DMX Address via the DMX Stream and saves it
in the EEPROM.

see the File Library in the 'Other' Section for full details.
** it is a first cut of the code. **
but it is fully functional.

This may be useful for other projects involving a pic & DMX.

regards,

Stpehen.
__________________
no matter where you go,
there you are. BB
Reply With Quote
  #2  
Old 02-04-2009, 04:21 AM
awhaley awhaley is offline
Member
 
Join Date: Sep 2008
Posts: 188
Default Re: Hacked firmare for jec's DIY pixel

Nice work. Looks great, and very well commented.

If you can spare the 10 instruction cycles... you could probably just add a simple
Code:
     btfsc RCSTA, FERR   ;test for new break, or otherwise corrupted data
     goto WOOPS
into each of the 5 channel loops,

then somewhere after the receive code throw in :
Code:
WOOPS:   ; Jump point for when a framing error is detected while we're waiting for data
     movf RCREG,W  ; Discard the mangled packet and keep the buffer clear
     goto dmxcapture ;recheck Skipcounter and get ready for the next packet...

I'm throwing similar code into my DMX receive routines, just so they know to go back to the beginning if they get confused at any point. Anyway. Great work! Keep hacking this stuff and pushing us beyond what we think we can do.

Art
Reply With Quote
  #3  
Old 02-04-2009, 09:45 AM
ukewarrior's Avatar
ukewarrior ukewarrior is offline
Supporting Member
 
Join Date: Aug 2008
Location: Dayton, OH
Posts: 612
Default Re: Hacked firmare for jec's DIY pixel

Is THIS the unit you're talking about???

Reply With Quote
  #4  
Old 02-04-2009, 04:36 PM
srm srm is offline
Member
 
Join Date: Dec 2007
Location: Melbourne, Australia
Posts: 35
Default Re: Hacked firmare for jec's DIY pixel

yes this it the one.
__________________
no matter where you go,
there you are. BB
Reply With Quote
  #5  
Old 02-04-2009, 08:56 PM
ukewarrior's Avatar
ukewarrior ukewarrior is offline
Supporting Member
 
Join Date: Aug 2008
Location: Dayton, OH
Posts: 612
Default Re: Hacked firmare for jec's DIY pixel

Awesome!
Do you plan to incorporate the 'woops' code snippet shown in this thread?
If yes, I'll wait to download and burn this.

I think we should try to keep one set of code that has all the improvements in it.

Thanks again for sharing. Keep it up!
Reply With Quote
  #6  
Old 02-06-2009, 02:06 PM
JEC JEC is offline
Member
 
Join Date: Sep 2007
Location: Not far from Salt Lake City
Posts: 384
Default Re: Hacked firmare for jec's DIY pixel

I'm ordering a few hundred new boards of the DIY 5 channel design in about a week.

It would cost me a few dollars extra to have new board files run, but I could add this self-programming pullup resistor to the board without much hassle.

Worth it?
Reply With Quote
  #7  
Old 02-06-2009, 02:27 PM
rca rca is offline
Member
 
Join Date: Jun 2008
Location: Sugar Land, TX
Posts: 167
Default Re: Hacked firmare for jec's DIY pixel

I think it would be a worthwhile addition.

Ron
Reply With Quote
  #8  
Old 02-07-2009, 05:22 AM
srm srm is offline
Member
 
Join Date: Dec 2007
Location: Melbourne, Australia
Posts: 35
Default Re: Hacked firmare for jec's DIY pixel

Hi Jec,

and maybe remove the servo pins & replace with dmx programming, and may be a DMX termination header as well ?
or keep servo 1 + 2 remove servo 3 make dmx program header.

to UK: yes I'll add this section into the code, I'll post a new version, when I get a chance.

regards,

Stephen.
__________________
no matter where you go,
there you are. BB

Last edited by srm; 02-08-2009 at 12:11 AM. Reason: updated.
Reply With Quote
  #9  
Old 02-08-2009, 07:54 PM
awhaley awhaley is offline
Member
 
Join Date: Sep 2008
Posts: 188
Default Re: Hacked firmare for jec's DIY pixel

Hey all. I took a stab at adding the woops code to Stephen's work. I'm posting it here for him to test and make corrections to... I don't own any of JEC's pixels so my code additions are untested and should be treated as such until someone reports otherwise.

I did (not out of vanity, but out of assumption that I make mistakes) put my initials on each line I added so it should be easy to trace through. Basicly I check for a framing error in each receive loop after the RCIF flag gets set... if the framing error is detected I go to a WOOPS routine which clears the error, reloads the skipcounter variables then goes to waitforstart (since we've already detected a break, we skip that part of the receive code).

Oh, and a side question! Stephen, did you avoid testing for a zero start code because you weren't getting one? In my dmx receive code (also based on the Microchip app note, adapted to 16F assembly instead of 18F) I tried checking for the start code and wasn't getting a zero there... I just changed the code to discard the first byte and moved along, putting it on my to be figured out later list. Just wondering if you had the same experience, or had another reason not to check if it was zero.

EDIT: Just figured out that this part of the code came from JEC's original pixel code. Nevermind. I'll ask that question towards him at some point.

Anyway. Wait for Stephen to confirm it's working before you adding the woops code to your pixels... or you could find yourself saying woops. :P

Art
Attached Files
File Type: asm srm_5_dmx programming_1_woops.asm (28.9 KB, 66 views)

Last edited by awhaley; 02-08-2009 at 08:08 PM.
Reply With Quote
  #10  
Old 02-09-2009, 10:26 AM
JEC JEC is offline
Member
 
Join Date: Sep 2007
Location: Not far from Salt Lake City
Posts: 384
Default Re: Hacked firmare for jec's DIY pixel

Quote:
Originally Posted by srm View Post
Hi Jec,

and maybe remove the servo pins & replace with dmx programming, and may be a DMX termination header as well ?
or keep servo 1 + 2 remove servo 3 make dmx program header.
I'll post a schematic and board layout later today if I can.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:59 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.