Receiving DMX
rapscaLLion
Posts: 75
Hi all,
I'm sure I've made a silly oversight here, but I can't figure out where I've gone wrong so appreciate your input and guidance.
I have set up a simple DMX receiver on a demo board. I have sent DMX no problem with a similar setup, so I reconfigured the wiring to match the diagram in Timothy D Swieter's DMX_RX_Driver (except using the SN equivalent instead of the MAX chip). The circuit seems to "receive" the dmx stream just fine, however I've output to decimal values to a TV terminal similar to Timothy's DMX Object Demo. Regardless of which combination of various DMX RX objects and TV Text objects I try, I get the same results: Each channel returns "254" when it should be zero. Incrementing/decrementing a channel value by one (out of 255) changes the displayed channel level by seemingly random values from 2 - 200+. Additionally, at some points in the scale adjacent channels are affected as well. I hope this is clear... it doesn't make much sense to me.
Is this a problem with my setup, or in the code? I feel like there is a problem with the memory allocation or handling since changing one channel's level also affects adjacent channels at certain points, but I haven't been able to figure it out either way.
Code is as follows:
Any and all help greatly appreciated, before I start banging my head into the wall [noparse]:)[/noparse]
I'm sure I've made a silly oversight here, but I can't figure out where I've gone wrong so appreciate your input and guidance.
I have set up a simple DMX receiver on a demo board. I have sent DMX no problem with a similar setup, so I reconfigured the wiring to match the diagram in Timothy D Swieter's DMX_RX_Driver (except using the SN equivalent instead of the MAX chip). The circuit seems to "receive" the dmx stream just fine, however I've output to decimal values to a TV terminal similar to Timothy's DMX Object Demo. Regardless of which combination of various DMX RX objects and TV Text objects I try, I get the same results: Each channel returns "254" when it should be zero. Incrementing/decrementing a channel value by one (out of 255) changes the displayed channel level by seemingly random values from 2 - 200+. Additionally, at some points in the scale adjacent channels are affected as well. I hope this is clear... it doesn't make much sense to me.
Is this a problem with my setup, or in the code? I feel like there is a problem with the memory allocation or handling since changing one channel's level also affects adjacent channels at certain points, but I haven't been able to figure it out either way.
Code is as follows:
CON 'Constants to be located here '*************************************** ' Hardware related settings '*************************************** _clkmode = xtal1 + pll16x 'Use the PLL to multiple the external clock by 16 _xinfreq = 5_000_000 'An external clock of 5MHz. is used (80MHz. operation) '*************************************** ' System Definitions '*************************************** _OUTPUT = 1 'Sets pin to output in DIRA register _INPUT = 0 'Sets pin to input in DIRA register _HIGH = 1 'High=ON=1=3.3v DC _ON = 1 _LOW = 0 'Low=OFF=0=0v DC _OFF = 0 _ENABLE = 1 'Enable (turn on) function/mode _DISABLE = 0 'Disable (turn off) function/mode '*************************************** ' Program Definitions '*************************************** _channel = 1 'Channel to read VAR 'Variables to be located here byte myvariable 'a variable to be manipulated by DMX OBJ 'Object declaration to be located here DMX : "DMX_Rx_Driver_Ver014.spin" num : "Simple_Numbers" tv : "tv_text" PUB main | ch,temp,x,y tv.start(12) tv.str(string(13, 1," --This is the DMX Object Demo--",13)) 'Start the object (replace the pin numbers with the correct pins for your setup DMX.start(0, 20) repeat ch := 1 repeat y from 1 to 12 repeat x from 1 to 35 step 4 tv.out($0A) tv.out(x) tv.out($0B) tv.out(y) tv.dec(DMX.level(ch)) ch++
Any and all help greatly appreciated, before I start banging my head into the wall [noparse]:)[/noparse]
Comments
This article I wrote for Nuts & Volts may help, too: www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp3.pdf
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA
Help!?
Post Edited (rapscaLLion) : 6/10/2010 6:59:40 PM GMT
I hope this helps.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA
Congrats on tracking down your bug -- sometime the smallest bugs bite the hardest!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA
Thanks for all your effort. I'll take a look at your code anyhow to see where I might be able to improve.
I have successfully mated the DMX in code with BrillIdea's SPL output for the Allegro A6281 chip. Everything is beautiful, and now I get to spend the night soldering together 3 controllers [noparse]:)[/noparse]
Thanks again!
Sounds like you and I are on the same path of mating DMX with the A6281. I have a couple controllers I am cooking up for a new LED Painter II. In the process I hope to revise the A6281 code and the DMX code.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, P.E.
www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" 16:9 LCD Composite video display, eProto for SunSPOT, PropNET, PolkaDOT-51
www.tdswieter.com
For the current drier, I have had two people - both of whom I trust - tell me that there is an oddity in the buffer and displaying values on the A6281. There may be an off-by-one error. I haven't taken time to look at it yet because I know the new LED Painter II controllers will cause me to review the code when I need to. If you see the problem and can propose a simple solution, then I can quickly update the code in the OBEX.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, P.E.
www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" 16:9 LCD Composite video display, eProto for SunSPOT, PropNET, PolkaDOT-51
www.tdswieter.com