Shop OBEX P1 Docs P2 Docs Learn Events
New b SX52BD — Parallax Forums

New b SX52BD

kirkkirk Posts: 3
edited 2005-03-08 03:24 in General Discussion
Hi I new to this game and I need some advice.· I am trying to build a 48x12 rs485 router.· I looked at the specs on the SX52BD, it seems this chip could work,· My questions is will this chip pass RS 485 with out messing with the data? And any pitfalls to look out for?· Any help or insite would be great.· Thanks in advanced.


Kirk

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2005-03-07 16:32
    What's a 48x12 router? 48 inputs, 12 outputs? RS485 is a 'party-line' system -- lots of parties on two lines. You're making a router for this?

    The SX52 is a micro-processor. It doesn't know 485, you have to program it to know 485, and add transciever chips to do the hardware signalling. Most 485 installations actually use RS-232 bit-protocols -- you know, start bit, 8 data bits, stop bit, that sort of thing. The SX/B language available from Parallax for the SX52 chip does have SEROUT/SERIN commands which DO know the RS-232 bit-protocol, and have been used for this.

    So the question becomes what architecture are you trying to implement? Are you having a microprocessor control a switching matrix made of multiplexors? Do you want the SX52 to BE the switching matrix, implementing stuff in software?
  • kirkkirk Posts: 3
    edited 2005-03-07 16:54
    Ok big picture. I have 48 devices 12 control proceesors. They will be switched(ie Control pro 1 switched to device 2,4,6. control pro 2 switched to devices 1,2,3,,,etc) I have build a smaller version with relays. I just want to know if this chip can pass the data thu. I am not controling these devcies with it just switching path ways. If I am not clear on what I need please excues me, I am new
    tanks
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-03-07 18:29
    You are still a little confusing. You say you want "the chip to pass the data thru", yet you are not "controling the devices, just switching path ways".

    You have 48 "devices", of which 12 are control processors, or you have 48 devices PLUS 12 control processors. And what a 'device' is, compared to a 'control processor', is not clear. I assume a 'device' is a 'slave' device, like a thermocouple tied to a PIC chip?

    You've built a "smaller version with relays", which says to me that you've used relays to switch the signal paths in the past. Do you want to use relays in the future? Or a "multiplexer chip" to select the signals?

    I've seen a 16x16 'switch' created, which allowed 16 inputs to be 'selected' by 16 to 1 multiplexers on the output. In that case, the microprocessor's only job is to latch to each of the 16 outputs the input channel the output should be routing. The SX can do that easily.

    The other interpretation of what you are trying to do is to use the microprocessor's I/O pins AS the input AND output pins. That COULD work, but ONLY if you know, or can control, the timing of both the input and output signals. MUCH harder job, and much harder to specify if the SX (or ANY microprocessor) can do it.
  • kirkkirk Posts: 3
    edited 2005-03-07 18:48
    "I've seen a 16x16 'switch' created, which allowed 16 inputs to be 'selected' by 16 to 1 multiplexers on the output. In that case, the microprocessor's only job is to latch to each of the 16 outputs the input channel the output should be routing. The SX can do that easily."

    This is close I Have 48 "slave" devices and 12 "masters" 4 slaves per chip 12 ouputs bused to the masters. I want the sx52bd to replace the 578 relays I would need. The pins would just pass voltage for rs485 One pin for "+" the other "-" ground is shared thu out. The sx52bd will be controled rs232 all bussed to geather a dipswitches to ID them. I hope this is clear with out a picture.
    Thanks for the help
  • Jim PalmerJim Palmer Posts: 23
    edited 2005-03-07 20:05
    Don't know about anyone else, but I could REALLY use a picture [noparse]:)[/noparse]
  • SteveWSteveW Posts: 246
    edited 2005-03-07 23:21
    Is there no way at all you could use an addressing scheme, so that all the slaves could see all the messages, on a common bus, but disregard all the messages not intended for them (that had non-matching addresses)?
    That would be a more conventional use of an RS485 bus, and would avoid all this switching / relays.
    You _could_ build an enormous switch bank out of an SX52, but witout at least knowing your required baud rate, it's impossible to gve a useful answer.
    The SX would have to poll all its input pins, and copy the data onto appropriate output pins - I assume while taking routing instructions from somewhere...
    It's definitely possible, but a very odd way of going about things, in an RS485 world... Are you expecting it to update the routing based on headers of packet data? More information will get you better answers...

    Steve
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-07 23:46
    RS485 supports multiple masters, read the lower part of http://www.ibrtses.com/embedded/rs485mpp.html·its done by token passing (think hot potato where the controller that's "it" gets to communicate with the slaves). At first it may seem this is a problem because a controller that wants the RS485, needs the token, but it cant communicate on RS485 to request the token, your standard catch 22. But using round robin gets around this, controller 1 gives the token to controller 2 when its done and so on and so forth until controller 12 is done and hands the token back to controller 1. If a controller receives the token but doesn't want to communicate with the slaves, it just hands it to the next controller.

    There is a problem when a controller hangs up and misses noticing the token was passed to it. In this case you can have a controller that keeps tabs on the bus (a master of the masters if you will), if it notices the last communication was a long time ago (you set what this timeout value is) it assumes that the controller·that last recieved the token·is "lost in space" and creates a new token and passes it to the controller that was next in the chain.

    Post Edited (Paul Baker) : 3/7/2005 11:52:28 PM GMT
  • SteveWSteveW Posts: 246
    edited 2005-03-08 01:08
    I don't think that RS485 knows (or cares) anything about such high levels communication - it's just a differential pair signalling method. It's entirely up to you whether you want to run token ring, master polling, collision detection, or any other higher layer of access control.
    The original poster needs to provide more information, one way or another, before e gets a definitive answer. RS485 just isn't enough. (for instance - I've seen RS485 systems from 1200 baud to 20MBaud. One's trivial to deal with on an SX, the other would be extremely tricky)

    Steve
  • kjennejohnkjennejohn Posts: 171
    edited 2005-03-08 03:24
    This better be one processor per device, master and slave. One chip will never do it.

    You have a matrix that is 24 x 12. That is 288 cross points. There's a lot of traffic there. The nearest serial-related Virtual Peripheral Ubicom offers is an octal (8-channel) USART. The USART does bidirectional serial traffic. I read the specs some time ago, and I'm not sure this will do more than 9.6k or 19.2k. And it is _only_ eight channels.
    You need one line (not counting ground)·per device (12 masters and 24 slaves), for 36 pins. The SX52 has 40 pins, so at least you have the pins, after reset and 'token-passing' pins, if used.
    Internal RAM on the SX52 is only 262 bytes. In this you would have to store comms setup data, assignment data (which master has which slaves), and the actual traffic being sent around.

    So, what works is one processor per device. Each 'master' device deals with serial traffic with some 'master' device in the outside world. Every 'slave' device has his own processor, and services an external 'slave' device. In fact, the SX52 may be overkill. An SX48 (36 pins, 262 bytes of RAM) may be adequate for the masters processor. The SX28 (20 pins, 136 bytes of RAM) would suffice for the slaves.
    Each processor (master and slave) handles outside traffic using RS485 chips, like the LTC485, as the level translator. Internally each 'master' SX uses a pin for half duplex (single-line, one direction at a time) serial communications to the slave processor. I.e., each master SX has 24 pins·connected to one pin on the slave processors (one master can literally talk to all slaves, if needed!). These can only talk to one slave at a time, so a master SX talking to several slaves will be slow in updating data. Of course, each slave has one pin per master, 12 pins.

    And a PC program talks to everything through one MASTER PROCESSOR to hand out assignments, using a serial port, right after you write Visual Basic routines to allow human intervention.
    Or not.·You could have the one serial port talk to all master processors at once.·Just use HyperTerminal to pass simple commands to the project and recieve simple messages, like status and errors.Now you·build an address into the messages so the proper processor will know the command/data is his.

    Gets a tad complicated, doesn't it?

    Well, that was fun. Later!
    kenjj
Sign In or Register to comment.