j37prakash
Jun 26 2009, 5:44 AM
Hi all. I am new to the forum. I have a task in hand to make communication between a DVR and my 89S52 circuit. The DVR basically sends out RS485 signals for pan-tilt-zoom control of a video camera. Can you please help me out how to make the 89S52 read the RS485 signals from the DVR? I will be grateful to anybody who helps me out. I want information about the probable circuit diagram and Assembly codes for the same.
Expecting your kind response friends,,,,,
Expecting your kind response friends,,,,,
shyam
Jun 26 2009, 10:32 PM
u need to get a rs232-rs485 adapter.
either buy it or you can make an hobby circuit as in
http://freecircuitdiagram.com/2009/03/24/rs232-to-rs485-converter/
either buy it or you can make an hobby circuit as in
http://freecircuitdiagram.com/2009/03/24/rs232-to-rs485-converter/
j37prakash
Jun 28 2009, 9:28 PM
Thanks a lot Shyam. Since i am a fresher, I want you to elaborate your explanation. I have acquired a RS232-RS485 adapter. Please tell me how I should proceed, in simple steps.
shyam
Jul 2 2009, 12:51 AM
j37prakash
can you give the description of the interface you acquired.. because in most cases writing a rs485 is the same as writing to a rs232 port!
can you give the description of the interface you acquired.. because in most cases writing a rs485 is the same as writing to a rs232 port!
j37prakash
Jul 2 2009, 4:55 AM
Dear Shyam, the converter came in two parts. The first part (at the RS485 end) has a 2-way terminal for RS485 connection on one side directly connected to a 9 pin female D type connector at the other end. The second part has a 9 pin male D type connector linked to a 9 pin female D type connector through a circuitry with ICs HEF4093BT, 7660, MAX485, around 7 transistors and a few other components. I herewith attach the snapshots of the converter for your reference. Please help me ASAP. If you provide me with your contact number I can call you up and get my doubts cleared faster.
shyam
Jul 2 2009, 5:54 AM
j37prakash,
well that is almost the exactly the adapter i thought..
now it is easy..
all you need is a software runnng on your uC that would take/read data @ 9600 bps.
read
hope you have already downloaded the "D_Pelco" protocol details.
else read here:
http://www.232analyzer.com/RS232_Examples/CCTV/Pelco_D_Pelco_P_Examples_Tutorial.HTM
all you need to do is to compare the data received with the protocol(all to be done on the uC software.
well that is almost the exactly the adapter i thought..
now it is easy..
all you need is a software runnng on your uC that would take/read data @ 9600 bps.
read
hope you have already downloaded the "D_Pelco" protocol details.
else read here:
http://www.232analyzer.com/RS232_Examples/CCTV/Pelco_D_Pelco_P_Examples_Tutorial.HTM
all you need to do is to compare the data received with the protocol(all to be done on the uC software.
j37prakash
Jul 2 2009, 10:35 PM
Thanks a lot Shyam for the timely help and guidance you gave, especially the link address you provided for Pelco-D protocol details. I am currently going through the stuff. In case I get another doubt, I will get back to you soon.
I also have another humble doubt, but please do not mistake me. I am not going to connect the uC to a PC. I want to connect the uC only to a Digital Video Recorder that already gives out RS485 + and - terminals. So should I connect the RS232 end to the uC and the RS485 end to the DVR? Kindly mail me any sample code for the uC serial data reception.
I also have another humble doubt, but please do not mistake me. I am not going to connect the uC to a PC. I want to connect the uC only to a Digital Video Recorder that already gives out RS485 + and - terminals. So should I connect the RS232 end to the uC and the RS485 end to the DVR? Kindly mail me any sample code for the uC serial data reception.
shyam
Jul 3 2009, 1:56 AM
if you are planning to use PC .. no use of uC.
if you are using uC you neednt use pC!
so decide first.
if you are using uC you neednt use pC!
so decide first.
j37prakash
Jul 3 2009, 5:27 AM
Dear Shyam, the usage of a PC is completely ruled out. There is no confusion about it. My doubt was that if you had meant to connect the 232 end to the uC and the 485 end to the DVR. What will be the rough idea of the coding for the uC?
Ajay Bhargav
Jul 3 2009, 6:33 AM
coding depends on the RS485 packet format or protocol of DVR. make sure you have RS485 converter connected to RS232 pins of 8051 

shyam
Jul 3 2009, 10:08 PM
connect DVR term to rs485 and uC to rs232 end..
just compare the data u get from the link i mentioned earlier..
keep the baud @ 9600 bps.
just compare the data u get from the link i mentioned earlier..
keep the baud @ 9600 bps.
pcuser01
Dec 6 2009, 4:07 AM
j37prakash wrote ...
Thanks a lot Shyam. Since i am a fresher, I want you to elaborate your explanation. I have acquired a RS232-RS485 adapter. Please tell me how I should proceed, in simple steps.
You can find more details for RS232 RS485 adapter from here: http://www.sintech.cn/en/rs232%20rs485%20converter/rs232%20rs485%20converter.htm or http://www.shopsintech.com/index.php?cPath=3&osCsid=433ac6dd26d2c115a7610a39a74fc0df .