can anyone giv algorithm for multimaster system using rs485 bus(SN75176 rs485 transreceiver). thanks a lot
you can't have a multimaster 485. For multimaster, have a look at J1708 (really peer to peer, but that should satisfy you) another option would be TIA 1939. If all devices are in the same box, then SPI or IIC would be options.
Erik
i am currently using P89LPC922 microcontroller with SN75176 rs485 transceiver(master-slave system...where master polling slave) using multi processor communication. now want to change to multimaster communication like ethernet(where need to check if bus idle then device communicates).any suggestions....thank u erik for replying.
While there are implementations of Ethernet and TCP/IP for 8051's, I think that Controller Area Network (CAN) would meet your needs quite well. There are quite a few 8051 parts with built-in CAN controllers and if you don't need the higher level protocols like CANOpen or DeviceNet (few people do), then you can communicate from one node to any other with good determinism. I learned CAN for 8051s using Silabs C8051040 micros running C compiled using the Keil tools. Worked well and I put CAN on just about every project I work on (using 8051, PIC, dsPIC, and now...ARM7 processors). No regrets whatsoever.
-=Rich=-
TIA 1939 (which is a CAN derivative) is much more multimaster oriented than CAN,
Yes, like Rich states, you do not need implement the whole kit and kaboodle, but for multimaster I would refer more to 1939 then CAN. The hardware for CAN and 1939 is identical, but 1939 has more multimaster 'hints' than CAN.
Thank u very much for ur suggestions.:))
is it a standard method to use master polling ...any other way by using rs485 itself?....thanks in advance....
Thank u very much for ur suggestions.:)) you try to thank us, but insult us instead by being too friggin lazy to type the words.
The thank you NOT ACCEPTRED
i am not lazy to type. Also i din mean to insult u all. I am using SN75176BN rs485 transciever as i told u before..how can i implement CAN or TIA 1939. I have some limitations in using other protocols.
As far as I know, you cannot implement CAN without a proper CAN controller and proper CAN transceiver. Put another way, you cannot use your TI RS-485 transceiver and create a CAN network no matter how much software you write.
As I understand the original question, you were trying to find out how to design an RS-485 system that would allow any device to communicate directly with another device so that each "node" was an equal (i.e, peer-to-peer) instead of the usual Master-Slave arrangement that RS-485 is used for. Yes?
So, we suggested moving to CAN or one of the other automobile networking schemes INSTEAD of using RS-485. That said, you would not have any use for the TI transceiver and you would either have to purchase an 8051 with an on-board CAN controller or you could purchase a separate CAN controller to add to your existing 8051. In either case, you would have to also add a CAN transceiver. Don't fret about it...were talking few dollars here...
Now....if you absolutely insist on trying to build a multi-master system based on RS-485, then I would imagine that it would be possible for a node to determine if another node were on the bus if that node could "test" a separate line shared by all the other nodes. For example, you could tie a pin on each microcontroller to that line. When a node wants to use the RS-485 "bus" (the line that is shared and held high by pull-up resistors), it would "read" the line to see if it is pulled low by another node. If not, it pulls the line low (it acquires the "token")and then proceeds to use the RS-485 bus. When finished, it releases the line (lets it go high) and other nodes are free to test the line and acquire the token. Realize of course, that it would require that your cable have an extra conductor added to it. Would that be a problem in your case? I don't know since you didn't specify whether you were trying to communicate across town (at one extreme) or across your PCB (at the other extreme). At the end of the day though, I think that your boss and your customer would be more impressed that you researched and implemented a proven solution (like CAN) rather than putting together a "kluge" like I just described.
DISCLAIMER: I have never tried to make such an idea work and I wouldn't be surprised at all if someone with more RS-485 experience than I could come up with one or more obvious reasons why it is implausible, impractical or just plain "stupid". It's just an idea. If anyone wants to flame me about it...knock yourself out...
Lastly: In the previous post by Erik, he was trying to impress upon you that it is frustrating for him to spend quality time responding to other peoples questions when those same individuals won't even take the time to spell the word "you" instead of "u". I share that sentiment. If you don't think it worth the time to spell...how can expect people to take the time to help? If you want to "IM" like a teenybopper, go buy a cheap cell phone and have at it. This forum is for adults. You'll get better response if you communicate like one.
Okay...now that I am done with my rant *** public service message...I bid you good luck. If you decide to try CAN or one of the schemes/standards/methods that Erik suggested, I'm sure people will only be too ready to help. Be ready to listen.
Try going to this website searching for RS485
tech.groups.yahoo.com/.../
if you are not too lazy to type, then why do you persist?
I do have some suggestions, but till you get rid of your laziness, i will withold them.
I can fully accept that someone used to the gibberish may use it without realizing how insulting it is in a forum for the first post, but stating "i am not lazy to type" and then persisting dramatically reduce my willingness to help.
Sorry. I realised my mistakes.
for multimaster, instead of "collision avoidance" you need "collision detection". You see that for J1708, CAN, Ethernet ....
Study J1708, it will give you insight into the issues, then come back with actual specific questions.