Log in

View Full Version : How can I read an RS485 stream?



ngeronikolos
- 19th July 2005, 15:22
Hello guys,

I hope you are all well.

A simple question.How can I read an RS485 stream from a device(MASTER) using 16f628(SLAVE).Do I need to convert the stream to rs232 protocol?
I have MAX1482 low power transeiver for rs485 communication.
Please send any usefull info,schematic.

Best Regards
Nikos Geronikolos

BobK
- 20th July 2005, 02:55
Hello ngeronikolos,

Rs485 is simply the transmission means to send serial data from one device to many. You use a RS485 transceiver connected to the same pins on the PIC that you would connect a RS232 interface and then you can send and receive your data as you would regular RS232. You will need to create the software that will talk to the individual slaves. Search this forum as there have been articles written about RS485. You can also get Jan Axelson's great book on the SERIAL PORT. It has alot of examples of RS485 communications.

BobK

DynamoBen
- 20th July 2005, 04:07
One tip: You have to place the chip in either transmit or receive mode. If your planning on doing some type of bidirectional communication you will need to use one pin on your PIC for this task AND write your commands to toggle it when needed.

ngeronikolos
- 20th July 2005, 09:54
Thanks guys,
I understand.I have to use the same commands as in RS232 interface?
If it is that correct,I have to replace the max232 with the MAX1482. My chip I want to be in receive mode!!

Before I connect the master device with my pic,how can I read the data using my COM1 of my PC?

Thanks
Nikos Geronikolos

DynamoBen
- 20th July 2005, 14:26
To receive via your PC you would need to connect the RS-485 transceiver to a RS-232 converter. You would then either pull RX TX enable lines high or low. Alternatively, you could tie the enable line to RS on the serial port...your call.