RS485 Collision detection half duplex

R

Thread Starter

RT

Hello All,
I understand what is collision detection , I have set up with RS485 half duplex connections need to implement Collision detection from code

So for this I need to check what is transmitted same is received back. I mean char RX matches with Char Txed but the device I connected I can TX transmit 1 frame (16 bytes ). I receive response (16x5=80 Bytes) 5 Frames. so How can I do this that what is sent is received back ??

Do I need to have loop back connections
please help
Thanks
 
L

Lynn August Linse

Sounds like either you are sending multiple times, thus receive multiple times - or you don't have bias resisters and are receiving a lot of line noise (would see a lot of 0xFF's).
 
> Sounds like either you are sending multiple times, thus receive multiple times - or you don't have bias resisters and are receiving a lot of line noise (would see a lot of 0xFF's). <

thanks or reply , The device is such that it takes 1 frame 16bytes and in response gets 2, 3, 4, or 5 frames depending on the command sent , so how would i test in this case collision detection, that what is rx char == tx char then no collision else collision

Ex: if I want verison number o device I can send the Version cpommand frame in response I get version information in 5 frames i.e 80 bytes
hope I am clear

any help would be appreciated
 
Hello All ,

For collision detection in half duplex RS485 mode The device I have attached to RS485 network receives 1frame i.e 16 bytes and receives back 5,4, 3,2, 1, frames depending on the type of command request I send. So obviously what is send is not what is received at the other end. I mean char RX does not match with char TXed so always collision.

The device has an address is it fine if the Frame I sent after receiving. the frame I will check for address field if is same as what is send then no collision instead of whole frame verification?

Please reply I need help in resolving this
 
L

Lynn August Linse

Well, this isn't Modbus nor Modbus related.

However, why even bother detecting collision? If you see a response, then there was no collision. If you do not see a response, then either there was a collision or some other transmission error, so retry (perhaps with a random back-off).
 
Top