16 to 2 wire communication via RS485 communication

Thread Starter

NIKHILMER

Joined Sep 14, 2017
11
hello
I have a project where I take 16 wires as inputs and convert it into 2 wires Rs485 communication and again decode it from Rs485 2 wires into same 16 wires.

I am thinking of giving 16 inputs to pic via relay and then to communication IC MAX485.
Also if someone can give hints on programming this on PIC as I am new to PIC.

Thank you
 

Picbuster

Joined Dec 2, 2013
1,027
We need more information;
speed of signal(s) change.
rs485 is a layer one definition ( hardware signals it does not say anything about full/half duplex handshake.
Please specify the other layers.
What do you want with the signal received? ( save it, calculate, modify, delete or send it to display, cpu , internet ,air)
question: why relays? (expensive, slow and huge in size)

We like to help you but your question is like 'how long is a piece of rope".
Please do understand that I do not want to be offensive whit this remark.
Picbuster
 

Thread Starter

NIKHILMER

Joined Sep 14, 2017
11
We need more information;
speed of signal(s) change.
rs485 is a layer one definition ( hardware signals it does not say anything about full/half duplex handshake.
Please specify the other layers.
What do you want with the signal received? ( save it, calculate, modify, delete or send it to display, cpu , internet ,air)
question: why relays? (expensive, slow and huge in size)

We like to help you but your question is like 'how long is a piece of rope".
Please do understand that I do not want to be offensive whit this remark.
Picbuster
Relays are because there are some 230v
signals too
Minimum speed change is 2 sec
The Signal received is given to controller
 

shteii01

Joined Feb 19, 2010
4,644
Some of the inputs are 230v?
So when 230v is present, it will energize relay coil, which will then connect PIC input to 5v. When 230v turns off, energy removed from the relay coil, the 5v disconnected from the PIC input.
Am I understanding the process correctly?
 

Thread Starter

NIKHILMER

Joined Sep 14, 2017
11
Some of the inputs are 230v?
So when 230v is present, it will energize relay coil, which will then connect PIC input to 5v. When 230v turns off, energy removed from the relay coil, the 5v disconnected from the PIC input.
Am I understanding the process correctly?
Yes
 

Picbuster

Joined Dec 2, 2013
1,027
Use opto couplers, and a pic with 16 inputs and one serial output.
write a simple rs485 1/2 duplex protocol allowing to communicate with an other processor.
Use C (xc8 from Micro chip) program will take a few hours to write.
But you need a signal to indicate that reading relays(opto's ) are ready to read.
Expect hard- and software design plus a working unit one working day.(8H)
Unless you want to do more than reading 16 lines.

Picbuster.
 

Thread Starter

NIKHILMER

Joined Sep 14, 2017
11
Use opto couplers, and a pic with 16 inputs and one serial output.
write a simple rs485 1/2 duplex protocol allowing to communicate with an other processor.
Use C (xc8 from Micro chip) program will take a few hours to write.
But you need a signal to indicate that reading relays(opto's ) are ready to read.
Expect hard- and software design plus a working unit one working day.(8H)
Unless you want to do more than reading 16 lines.

Picbuster.
Can you please elaborate on signal to indicate optos are ready part
 

Picbuster

Joined Dec 2, 2013
1,027
Ok I understand.
Do you want to transfer on a input change ( a specific one) and read them all?
Or transfer at any change of an input (1 of 16)?
Or do you want to read as function of time ( each n seconds or a part thereof?)
This is the signal I talked about.
Picbuster
 

Thread Starter

NIKHILMER

Joined Sep 14, 2017
11
yes i want to transfer a specific input change.
Also I want to know that is it possible to make pic ports to be both input and output so that it can read as well write at same port through RS485 communication
 

Picbuster

Joined Dec 2, 2013
1,027
use it at the pic port you are allowed to change tris on the fly but that is not easy.
use a rs485 1/2 duplex chip and switch between TX and RX the slave should listen and master ask.
when line is free send. (btw your device could be the master line free transmit).
using an address will allow you to put a few hundred rs485 parallel ( depending on chip 64 will always work. gives you, in your case 64 x 16 inputs).
I hope that you now understand why I asked so many questions in my first reply.

Picbuster
 

Thread Starter

NIKHILMER

Joined Sep 14, 2017
11
use it at the pic port you are allowed to change tris on the fly but that is not easy.
use a rs485 1/2 duplex chip and switch between TX and RX the slave should listen and master ask.
when line is free send. (btw your device could be the master line free transmit).
using an address will allow you to put a few hundred rs485 parallel ( depending on chip 64 will always work. gives you, in your case 64 x 16 inputs).
I hope that you now understand why I asked so many questions in my first reply.

Picbuster
Thank you picbuster for the response.I will try to stimulate now with the information you provided.I will get back if I have doubts
 
Top