free 8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

Rickey's World :: Discussion Forums :: Discuss and Learn :: 8051 Discussion Forum
 
<< Previous thread | Next thread >>
How to link 89S52 to RS485 terminals of a DVR?
Go to page       >>  
Moderators: Ajay Bhargav, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph, ExperimenterUK, DavesGarage
Author Post
j37prakash
Fri Jun 26 2009, 05:44AM

 User Offline
Registered Member #19697
Joined: Fri Jun 26 2009, 05:06AM

Posts: 5
Thanked 0 times in 0 posts
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,,,,,



Thanks with Regards
G. Jayaprakash
Chennai, India
j37prakash@gmail.com
Back to top

shyam
Fri Jun 26 2009, 10:32PM

 User Offline

Registered Member #2984
Joined: Mon Aug 06 2007, 11:33AM

Posts: 847
Thanked 136 times in 125 posts
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/

lProgress is not made by early risers or hard workers, but by LAZY people, trying to find easier ways to do the same........
Back to top


This post has been thanked 1 time
j37prakash
Sun Jun 28 2009, 09:28PM

 User Offline
Registered Member #19697
Joined: Fri Jun 26 2009, 05:06AM

Posts: 5
Thanked 0 times in 0 posts
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.

Thanks with Regards
G. Jayaprakash
Chennai, India
j37prakash@gmail.com
Back to top

shyam
Thu Jul 02 2009, 12:51AM

 User Offline

Registered Member #2984
Joined: Mon Aug 06 2007, 11:33AM

Posts: 847
Thanked 136 times in 125 posts
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!


lProgress is not made by early risers or hard workers, but by LAZY people, trying to find easier ways to do the same........
Back to top

j37prakash
Thu Jul 02 2009, 04:55AM

 User Offline
Registered Member #19697
Joined: Fri Jun 26 2009, 05:06AM

Posts: 5
Thanked 0 times in 0 posts
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.

Thanks with Regards
G. Jayaprakash
Chennai, India
j37prakash@gmail.com
Back to top

shyam
Thu Jul 02 2009, 05:54AM

 User Offline

Registered Member #2984
Joined: Mon Aug 06 2007, 11:33AM

Posts: 847
Thanked 136 times in 125 posts
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.


lProgress is not made by early risers or hard workers, but by LAZY people, trying to find easier ways to do the same........
Back to top

j37prakash
Thu Jul 02 2009, 10:35PM

 User Offline
Registered Member #19697
Joined: Fri Jun 26 2009, 05:06AM

Posts: 5
Thanked 0 times in 0 posts
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.

Thanks with Regards
G. Jayaprakash
Chennai, India
j37prakash@gmail.com
Back to top

shyam
Fri Jul 03 2009, 01:56AM

 User Offline

Registered Member #2984
Joined: Mon Aug 06 2007, 11:33AM

Posts: 847
Thanked 136 times in 125 posts
if you are planning to use PC .. no use of uC.
if you are using uC you neednt use pC!
so decide first.

lProgress is not made by early risers or hard workers, but by LAZY people, trying to find easier ways to do the same........
Back to top


This post has been thanked 1 time
j37prakash
Fri Jul 03 2009, 05:27AM

 User Offline
Registered Member #19697
Joined: Fri Jun 26 2009, 05:06AM

Posts: 5
Thanked 0 times in 0 posts
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?

Thanks with Regards
G. Jayaprakash
Chennai, India
j37prakash@gmail.com
Back to top

Ajay Bhargav
Fri Jul 03 2009, 06:33AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 7484
Thanked 1323 times in 1247 posts
coding depends on the RS485 packet format or protocol of DVR. make sure you have RS485 converter connected to RS232 pins of 8051

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


This post has been thanked 1 time
Go to page       >>   

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems