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.

communication between PICs (nearly 10 meters)

Status
Not open for further replies.

nergiz87

Newbie level 4
Joined
Mar 29, 2010
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,341
Hello,
I am designing a smart home system. In this system I have Home controller with pic16F88 and 2 Room Controllers with pic16F877A

Home Controller behaves like router: send daha from PC (rs232) to correct Room Controller.
The distance between Home and Room Controller will be nearly 10m.
which type of communication will be the best in this situation?
1st I wanted to use SPI because its simple to program but I am not sure that it will work in 10 meters. Is there some IC which can help me in this situation? or ...

Thanks
 

google rs422 or rs485 protocol.
 

    nergiz87

    Points: 2
    Helpful Answer Positive Rating
2 wire duplex can be done using the SN75176 RS485 interface ICs. Though the hardware is simple, you will have to design a suitable protocol.
 

    nergiz87

    Points: 2
    Helpful Answer Positive Rating
10 meters apart ? but this all depends if you have to drill through walls and have some where to hide the cable, I would go RF nice and simple no need for wire's. It woudl only be the same has trying to write the code for protocol :)
 

    nergiz87

    Points: 2
    Helpful Answer Positive Rating
I agree with wizpic.
You can use Zigbee for wireless transmission,you can find low cost zigbee's.I have used Zigbee from CCS.
If not want to use wireless then go for rs485 option.
 

    nergiz87

    Points: 2
    Helpful Answer Positive Rating
First of all thank you for all your help

10 meters apart ? but this all depends if you have to drill through walls and have some where to hide the cable, I would go RF nice and simple no need for wire's. It woudl only be the same has trying to write the code for protocol

yes. in the real word implemention RF will be good solution. But this project is my graduation project and I wont use this in my own home. The reason why I choose the wired solution is because of cost. And there will be also many wire for connecting controls(like light, door-window, tv, temperature)

2 wire duplex can be done using the SN75176 RS485 interface ICs. Though the hardware is simple, you will have to design a suitable protocol

yes rs485 seems suitable for me. And I saw rs485 lib in CCS which will be very helpfull.
So my system will be like this

Master: PC>MAX232>PIC>MAX485
Slaves: MAX485>PIC>controls

in RS485: A, B >Bus : pic(RX)>RO, pic(TX)>DI
but problems with -RE and DE

in slaves -RE will be low when master wants to send message to that slave
in master -RE will be low when any of slaves want to send data to master
is it OK?

in Slave and Master: if someone wants to send the message it makes DE high
OK?

and the last one

earlier I planed to define rs232 and use TX, RX for communication with PC
but now I need RX, TX also to send data to bus
Can I define two RX, TX?
in master
1.I want to read message from PC and determine the destination(slave)
2.then to make enable the slave to read data from bus
3.send the message to bus

how can i do that. or is there another solution?
 

If possible then use EJNC260 ethernet controllers from Microchip. These chips are realy cheap and will solve all your problems. All chips can communicate with all chips or optionally you can define your own settings for communication. This ethernet solution may also save you the master controller as computer can directly communicate with the distant controllers.

Secondly, you can also go for USB solution. All the above merits also go USB bus too.

I suggest these solutions because now a days RS-485 and RS-232 are rapidly getting obsolete and being replaced by other protocols like ethernet, USB, Profibus (in wired) and quiet a few other wireless protocols. So why not work on something that is currently being used by industry.

But here is trade off, the protocols you want to use are far easier to implement then the rest. So its your choice. It all depends on how much time you have.

Cheers.
 

the chips may be cheap but they also need other passive components like, pulse transformers, ferrite cores etc. So the entire system may not be cheap.

Also you have to look into the cost of wiring the system, UTP cables require RJ45 connectors and also a crimping tool.

But with RS 485 you do not need any of this, besides for a master-slave topology RS 485 works out much better than Ethernet.

For RS 485 Protocols look into Modbus (the industry standard), or if price is not a issue Profibus. For small projects I think it may be better to develop a simple protocol.
 

    nergiz87

    Points: 2
    Helpful Answer Positive Rating
An easy protocol is HART too, if you go for RS232 /RS485.
It allows the frame to be set as slave/master, hence both sides can request something.

Good Luck
 

khansaab21 said:
If possible then use EJNC260 ethernet controllers from Microchip. These chips are realy cheap and will solve all your problems. All chips can communicate with all chips or optionally you can define your own settings for communication. This ethernet solution may also save you the master controller as computer can directly communicate with the distant controllers.

Secondly, you can also go for USB solution. All the above merits also go USB bus too.

I suggest these solutions because now a days RS-485 and RS-232 are rapidly getting obsolete and being replaced by other protocols like ethernet, USB, Profibus (in wired) and quiet a few other wireless protocols. So why not work on something that is currently being used by industry.

But here is trade off, the protocols you want to use are far easier to implement then the rest. So its your choice. It all depends on how much time you have.

Cheers.

Actually I dont have much time. There is lots of stuff to do and because of these communication problem I cant do anything.

An easy protocol is HART too, if you go for RS232 /RS485.
For RS 485 Protocols look into Modbus (the industry standard), or if price is not a issue Profibus. For small projects I think it may be better to develop a simple protocol.
OK. I will google these protocols

And about Max485
Did I correct understand these DE, RE pins? (I am beginner in electronics :( )
in slaves -RE will be low when master wants to send message to that slave
in master -RE will be low when any of slaves want to send data to master
is it OK?

in Slave and Master: if someone wants to send the message it makes DE high
OK?
 

cocoloco said:
Transmission via Power Line

**broken link removed**
thank you for suggession but its hardware is expensive and for my graduation project I must design my own system.
And I choose pics. now the protocol seems to be modbus. I found some code examples in CCS example folder. At the moment I am trying to understand it :(
 

The DE and RE pins are used to enable reception, transmission.

You need to study a working example, google RS 485 there should be many projects that could help you.
 

the enc28j60 solution really good buit has some interoperating problems why do u not think about microchip devices for an mcp2515 & mcp 2510 or other can interconnects the library is available in ccs or even in mplab itself. best for long distance wired sloution
 

Hi Guys,

I have a much simpler method of RS485 Communication. It requires no setting of the RE & DE PINs.
Just connect the RE & DE PINs together and connect them to the Microcontroller TX via simple transistor inverting circuit.
(Only invert the TX signal of the Microcontroller)
Connect the D (PIN 4 of SN75176) to the ground.
Connect the R (PIN 1 of SN75176) directly to the RX of the Microcontroller.

With this circuit you would not have to worry about setting the direction of data, for the RS485 communication.
This will save up both RAM and ROM on the micro controller.

Enjoy !!!
SS
 

I have a much simpler method of RS485 Communication.
The suggested "poor mans" RS485 enable control has the main disadvantage, that the positive signal edge has to be achieved by pull-up/pull-down resistors only. It won't work at higher bit rates with longer cables. As a better compromise with only slightly higher effort, you can drive DE+RE from the inverted TxD signal trough an RCD delay circuit with fast attack and e.g. one bit time delayed release. D connects to TxD as usual.
 

You can use wireless. There are many one-chip transceivers. I'm using nrf24l01 for example. The cost of one chip about 5$. And the whole module with RF Part and antenna about 7$ for 2 modules.
**broken link removed**
Very easy to programming, very low current consumption and e.t.c.
For home, I think it is a better choice.
If you will choose this way, I can share to you my code for them. It is nothing difficult.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top