RS-485 provides the interface specification, but has nothing to do with the communication protocol or speed. Regardless of interface (RS-232, RS-422/485) you cannot get reliable serial communications from the internal OSC. You will need an external resonator or crystal for proper timing. As a note most of the lines drivers (such as RS-485) specify maximum transmission rate in their datasheet.· I hope this helps. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Tech Support
The January 2008 issue of Nuts & Volts (current issue) has an article by Jon Williams (one of the SX Demigods) on how to network the SX using a MAX489 (which is an RS-485 type chip). Good reading!
Thanks, John, but I am decidedly an SX goofball! The RS-485 interface circuitry is fun, and I've lately been doing DMX-512 relay control and LED PWMing with it (yes, that stuff will be in my book). In fact, we're (EFX-TEK) having so much fun with RS-485 and DMX that we've designed an add-on module for our Prop-SX controller. I've attached a schematic (note that as it's not in production the design could change).
I think so -- and you can blame my pal, PJMonty (a regular forums guru), for really getting me into this, and thank him for sharing all his hard work and the tricks and traps he discovered along the way. Want to seem some really neat control over an RS-485 network? Check out Peter's web site: www.socalhalloween.com. I've seen Peter's projects up-close and that *forced* me to jump in and try it myself.
Very Kool that you are getting into the DMX realm.· I look forward to seeing your design.·
Somehow it seems crazy to me that a large auditorium runs 12ga or higher wire all the way from the stage to the control room instead of having a little control box on the light fixture itself!· Knowing that it is going to be in your book I'll start collecting links and add·them to·my "resources" page for my course.· Thanks again Jon!
You're welcome, John. Of course, the DMX stuff will be toward the end of the book because it can get a little hairy if you're wanting to do PWM of outputs -- as a friend of mine asked for. You can see what I mean by "hairy" via the attached program. It uses SX/B as the framework but is mostly Assembly. This is a bit of a cheater program in that I'm only using 7-bits for the address (directly from RC); the next step is to fold the 74HC165 code into the foreground state machine so that I can put channel 1 on any address in the DMX universe.
If you just want to do on/off control, you don't need to use any Assembly, you can use straight SX/B to write the program. See the second program for that.
Funny. In looking at DMX-512-BG Fader I think I counted a total of 14 lines of SX/B in a 413 line program. (grin) Jon is slipping away and going to the OTHER side (assembler programmer)!
It just goes to show how useful SX/B really is -- it can be used as a framework to do the grunt stuff and one can fold in as much Assembly as desired. And, of course, you can "look under the hood" to see how BASIC functions translate, then you can grab that code and optimize as desired.
I did that with the latest version which is pretty close to "done". I consolidated a bunch of redundant states (receiving the channel bytes) and added the ability to read eight bits of the 9-bit DMX address using a 74HC165 shift register (see attached schematic). I looked at the code generated by SX/B for SHIFTIN, copied it, and then optimized it specifically for this program. I think that's pretty cool and I so appreciate the hard work Terry puts into the compiler because it's a great resource for those of us crossing to the dark side of the force.
Okay, I'm not crossing! I only went this far with this project for my friend, Brian, a DJ who's been hounding me for DMX stuff ever since we created SX/B.
And while I'm thanking friends, I really should thank [noparse][[/noparse]publicly, that is] Peter Montgomery for sharing his RS-485 experiences and Peter Van der Zee for posting code that helped me kind of make the transition to state-driven programming as a "norm."
Has anyone combined the "Dimming the Lights Fantastic" code from the Nov '07 issue of Nuts and Volts with the DMX code in this thread yet? If not I was thinking about tackling this as my next project. After reading the article I liked the dimmer but wanted DMX control instead of the serial protocol that was used. Any thoughts on the level of difficulty (I'm new to the SX) for a project like this?
Comments
RS-485 provides the interface specification, but has nothing to do with the communication protocol or speed. Regardless of interface (RS-232, RS-422/485) you cannot get reliable serial communications from the internal OSC. You will need an external resonator or crystal for proper timing. As a note most of the lines drivers (such as RS-485) specify maximum transmission rate in their datasheet.· I hope this helps. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
The January 2008 issue of Nuts & Volts (current issue) has an article by Jon Williams (one of the SX Demigods) on how to network the SX using a MAX489 (which is an RS-485 type chip). Good reading!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture
San Diego Miramar College
That does seem like it would help people have fun with RS485 projects! [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Shawn Lowe
Maybe I should have waited to do that......
Very Kool that you are getting into the DMX realm.· I look forward to seeing your design.·
Somehow it seems crazy to me that a large auditorium runs 12ga or higher wire all the way from the stage to the control room instead of having a little control box on the light fixture itself!· Knowing that it is going to be in your book I'll start collecting links and add·them to·my "resources" page for my course.· Thanks again Jon!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture
San Diego Miramar College
If you just want to do on/off control, you don't need to use any Assembly, you can use straight SX/B to write the program. See the second program for that.
Funny. In looking at DMX-512-BG Fader I think I counted a total of 14 lines of SX/B in a 413 line program. (grin) Jon is slipping away and going to the OTHER side (assembler programmer)!
It is a great program though!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture
San Diego Miramar College
I did that with the latest version which is pretty close to "done". I consolidated a bunch of redundant states (receiving the channel bytes) and added the ability to read eight bits of the 9-bit DMX address using a 74HC165 shift register (see attached schematic). I looked at the code generated by SX/B for SHIFTIN, copied it, and then optimized it specifically for this program. I think that's pretty cool and I so appreciate the hard work Terry puts into the compiler because it's a great resource for those of us crossing to the dark side of the force.
Okay, I'm not crossing! I only went this far with this project for my friend, Brian, a DJ who's been hounding me for DMX stuff ever since we created SX/B.
And while I'm thanking friends, I really should thank [noparse][[/noparse]publicly, that is] Peter Montgomery for sharing his RS-485 experiences and Peter Van der Zee for posting code that helped me kind of make the transition to state-driven programming as a "norm."
Post Edited (JonnyMac) : 1/20/2008 7:54:10 PM GMT
Here is the link for others: http://forums.parallax.com/forums/default.aspx?f=7&m=263685