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.

Programing master slave 8051 network

Status
Not open for further replies.

tommy666

Newbie level 2
Joined
Apr 15, 2005
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,313
how to connect 485 to 8051

Hello

I am beginer and i want to ask if smb have any clue how can i program 8051 microchips to work in master slave network. Could you post fragment of program that realize this operation on master 8051 and slave 8051 chip:
I intend to program ds89c450 chip in C so please give me clues for c or assembly that i can implement in my programs:)
 

8051 with rs485

You have't specify which bus you would like to use to build a network with master(s) and slave(s).
There is plenty of material on I2C bus which is supported by many microcontrollers, not only 8051-core.
The ds89c450 also supports I2C bus.

There is planty of example codes for master-slave, multi-master etc I2C bus.
You can easily find them here:
https://www.google.com.au/search?hl=en&q=Master+slave+I2C+philips&meta=

Other option is the RS-485 bus, but here you would rather used so called command-response protocol and usually there is only one master and several slaves ..

So first have a look at the I2C bus ..
 

    tommy666

    Points: 2
    Helpful Answer Positive Rating
network 8051 on 485

Yep i'm going to use rs485 becouse i will have network of 5 slaves and 1 master that gathers information acquired by sensors connected to slaves.
So i need to find out how to assign addresses to the slaves and how to acquire data from them 1 or 2 variables. I find out that i have to use SIO=2 protocol but only that for using master slave function.
Also there is another problem my master must have 2 serial busses. RS232C will send data from master to pc and rs 485 connects master to slaves.

If you could please give me example how to connect my chip with rs485 . I know how to connect it with rs232 using max232. But i havent found any schematics showing how to connect rs485 with 8051 using rest of pins in 8051. My ds89c450 have second rX and Tx pins under port P3. So i can use it to transmit to rs485 but i dont know how to connect it with 8051, when i already use rs232c.

Please give me some links to schematics how to connect my mastert 8051 with 8051 slaves. :)
 

8051 network

tommy666 said:
Please give me some links to schematics how to connect my mastert 8051 with 8051 slaves. :)

Read first this nice introduction:
**broken link removed**

But i havent found any schematics showing how to connect rs485 with 8051 using rest of pins in 8051

then go to :
**broken link removed**
and scroll down to Application Example #2
RS-485 Networking Using Asynchronous Serial Mode 3

**broken link removed**

Also there is another problem my master must have 2 serial busses. RS232C will send data from master to pc and rs 485 connects master to slaves

No need for two serial bus.

**broken link removed**

**broken link removed**
 
master slave networks

First of all, I would rather connect the RS-485 to the second UART (Port3) then trying to mix/multiplex both serial strings.
I assume that communication with PC will be controllerd within 89C450 by serial port interrupt with some kind of Rx buffer and Tx buffer (examples of code on this are available).

To communicate with SLAVES address them at your wish, for example 1, 2 ,3 ,4 and 5.
You can create a command string which may look like this: <address, command data, XOR checksum>,
where:
< is left delimiter 3Ch treated as the START character ..
address of slave 1 =01h, slave 2=02h ...
command data is a series of bytes required to ask for data
XOR checksum is juts XOR of all bytes in this string excluding/including itself

In response each slave will send a string which again may start with < (delimiter 3Ch, followed by its addres (01h, 02h, ..) , followed by data, followed by XOR checksum of all characters in this string ..
 

    tommy666

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top