Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Related to RS-485 Communication

Status
Not open for further replies.

jignesh doshi

Full Member level 2
Joined
Aug 11, 2011
Messages
131
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
2,112
hey guys...

i want to interface my microcontroller(8051) with PC using RS-485 bus and in that i want to connect my 4-5 other microcontroller as my slaves so how can i interface?

i want information about how to send data to slaves and how to get data from them?

is there any fixed format to send and receive data?

please give me help...
 

hey tpetar...

thanks for the reply...


btw i want only flow sequence that how can it work?????


if is there possible to give any example program then i want it in assembly language...
 

You have C source that means you have ASM. MikroE compilers can generate ASM code.

You can search EDABoard there is lots threads for RS485.

:wink:
 

ya i know there are so many threads for RS-485 but those can't fulfill my wishes...

i want just work instructions that how can RS-485 n/w works...


i want when will i send data from slaves?????
how can slave know that master ask about data with them and which slave called by the master??
what is the command sequence for programming???????


i want that in wording not in program sequence....
 

You should read first some basic material for this, this is described in RS-485 Protocol, search threads.

The master station selects a slave station by sending the slaves’ one-byte address, 0 to 255, as a 9-bit transmission. All slaves are interrupted by a 9-bit transmission and compare the received address to their own address. If the addresses do not match, any following communication is ignored. When the addresses do match, then that slave stays on the line and replies to the master by sending back its address as an 8-bit transmission. The master and the selected slave then continue communicating using 8-bit bytes. The non-selected slaves ignore the communication until the master station issues the next 9-bit address byte. The master stations can initiate a transmission but the slave stations can not, they can only respond.


**broken link removed**
https://www.datadog.com/rs485.pdf
**broken link removed**
.
.
.
 

ok thanks a lot..i got some ideas from your details...

and get some other queries related to your details...

1) Slaves continues in scanning process??????

2) At any time master and one of the slave is continues connect till the master next 9-bit transmission?????

3) what is the actually flow of sending and receiving of data at both the side???
 

i found very much times in Google but till i m not satisfied with my questions...

please give me help...
 

Hi Jignesh,

Try to read this article for interfacing use RS485, maybe useful.

For send data from Computer (as SERVER) to Microcontrollers (as SLAVE), you can use the your own protocol. Each microcontrollers must have a DIFFERENT SLAVE ID. The principle works like this: When a Computer sending data to the Microcontrollers, all the slave will received data, but only one slave who has the SAME ID with intended by the server, which will give an answered, another slave silent. In your protocol could be like this:
STX DATA ETX CRC.

STX = start of text (control char 2)
DATA can contain: SLAVE ID + REQUEST THE COMMAND OF SERVER.
ETX = end of text (control char 3)
CRC = you have to make the same crc function on the pc and all microcontrollers, in order to check whether the packet you received is valid or not on both (server or slaves). If you believe the CRC of data is correct and whether SLAVE ID(from server) in DATA same with your id(store in each microcontroller), if yes then read "requests from the server" and give reply to server.
 

hey erwin yudha..

thanks for reply....

can u please give me some more details regarding QUOTE????

Is CRC or LRC must require in modbus?????

CRC = you have to make the same crc function on the pc and all microcontrollers, in order to check whether the packet you received is valid or not on both (server or slaves). If you believe the CRC of data is correct and whether SLAVE ID(from server) in DATA same with your id(store in each microcontroller), if yes then read "requests from the server" and give reply to server.
 

hey erwin yudha..

thanks for reply....

can u please give me some more details regarding QUOTE????

Is CRC or LRC must require in modbus?????


@jignesh,

LRC word at the end of a block of data is very similar to Checksum and CRC

Please read here for CRC and here for LRC.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top