Shop OBEX P1 Docs P2 Docs Learn Events
rs485 — Parallax Forums

rs485

AHMET AKSUAHMET AKSU Posts: 62
edited 2008-04-30 23:28 in General Discussion
··

· can sx make rs485 comunication at 9600 bps·with internal 4 mhz osilator

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-01-15 17:52
    Hello,

    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
  • AHMET AKSUAHMET AKSU Posts: 62
    edited 2008-01-16 07:29
    thanks Chris
  • John CoutureJohn Couture Posts: 370
    edited 2008-01-17 17:38
    Ahmet,

    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
  • JonnyMacJonnyMac Posts: 9,216
    edited 2008-01-17 18:06
    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).
  • Shawn LoweShawn Lowe Posts: 635
    edited 2008-01-17 18:41
    Jon-
    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......
  • JonnyMacJonnyMac Posts: 9,216
    edited 2008-01-17 19:06
    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.
  • John CoutureJohn Couture Posts: 370
    edited 2008-01-17 20:33
    Jon,

    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
  • JonnyMacJonnyMac Posts: 9,216
    edited 2008-01-17 22:16
    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.
  • John CoutureJohn Couture Posts: 370
    edited 2008-01-19 00:08
    Jon,

    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)! smile.gif

    It is a great program though!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • JonnyMacJonnyMac Posts: 9,216
    edited 2008-01-19 01:17
    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. devil.gif

    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
  • DynamoBenDynamoBen Posts: 366
    edited 2008-04-29 21:55
    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?
  • sparky3sparky3 Posts: 3
    edited 2008-04-30 23:09
    look for the post "it must be a timing problem" C56 has a piece of code there.
  • DynamoBenDynamoBen Posts: 366
    edited 2008-04-30 23:28
Sign In or Register to comment.