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.

master MCU to several slave MCUs using RS485

Status
Not open for further replies.

macer_0001

Member level 1
Joined
Aug 15, 2009
Messages
36
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Manila
Activity points
1,491
Please help me.

I would like to implement a project. Here is what the idea.

The one microcontroller(master) collects/monitors sixteen(16) switches. After scanning the status of the switches, this will be transmitted to the sixteen(16) slaves in the bus using rs485. Then, every slaves display the status of the switches.

My question is, what method will i'm going to use to implement this.

Thank you in advance.
 

Hello,

Well you already seem to have the concept of what you want to do. Now you need to determine what microcontrollers you will need based on the number of inputs and outputs you will have. You mentioned 16 inputs on the master sending the status of these inputs to the remote micros for display.

You can find an example of RS 485 communications on www.parallax.com site and an example of a remote serial output setup at www.rentron.com.

I use PICBasicPro for programming. Implementing RS485 communications in this language is relatively easy. You have a communications direction line and data out and data in lines. So your micro will need 3 port lines to setup your RS485 driver chip. So to send out data you would make the direction line HIGH then send out the data then return the direction line to low. If you wanted to verify that each of the remote boards received the data it was sent then you would poll each board one by one asking for a verification code such as sending back the information that was orignally sent out. Compare it in the master then send an ack signal back.

I am currently designing a data gathering system that will have 8 inputs on a board and can have up to 32 of these boards reporting to a Master. The Master will poll each board for status updates. The Master will display the status of the full system. The Master will have a real time clock that will send to a printer twice a day the status of the sensors at two specific times each day. The only items that get printed are the sensors that are not in their normal position at the specified time. It is a commercial product so I can't provide the code. I have designed and manufactured 160 zone annunciator panels for a client in the past and it has worked fine now for over 3 years. Even though that project works on a one-wire serial buss with a separate "busy" line for data control, I did put RS485 circuitry on the project for future implementation if so needed.

There is alot of information on the internet for RS485. There is also alot of information in the book SERIAL PORT COMPLETE. Google "RS485" for futher information. I can tell you from what I am currently working on that what you want to do is not hard if you have the basic knowledge of working/programming micros. I consider myself to be a hobbyist but I have done alot of custom design work for my customers. I have sold some very unique devices starting with a system that detects when trains are coming and causes message boards to light up on outlying intersections to warn motorists that the railroad crossings are currently block and you might consider a different direction of travel. The town I live in bought that from me in 2003 and it is still working great!

Imagination is a great tool. You just need to learn how to use it to make things happen!

Hope this helps.

BobK :D
 

    macer_0001

    Points: 2
    Helpful Answer Positive Rating
From what you have described it looks like traffic is going to go only one way ..
It also doesn't look like you need any way of acknowledgement of the received data ..
So, you don't need full master-slave protocol, but rather one-transmitter-to-16-receivers configuration ..
Of course you can use differential bus (even MAX485 transceivers) which is noise-immune and allows you to connect all 17 devices together, but as far as software is concerned a string with stage of switches and a check-sum sent every certain period of time (one way) should be sufficient ..

As far as hardware is concerned, I'd strongly advocate the use of PICAXE family, perhaps PICAXE-28 as transmitter and PICAXE-08 as receivers, all equipped with MAX-485 (or equivalent) differential bus transceiver ..

Rgds,
IanP
:|
 

    macer_0001

    Points: 2
    Helpful Answer Positive Rating
Ian and Bobk,

Thank you for the support you have given.

macer
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top