Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

CCTV ptz over RS485

Status
Not open for further replies.

hackableFM

New Member
Can anyone advise if its possible to use a PIC to control a PTZ camera using RS485 and the Pelco-P or Pelco-D protocol.

I already have a dome camera connected to a DVR and all is working well although the DVR isn't capable of controlling things like focus, Infra red filter etc etc. I don't really want to buy a ready made controller as I intent to mount this in a wall next to the LCD monitor which currently views the DVR.

I have seen a simple circuit somewhere that uses a PC RS232 port to control the camera using a MAX485 chip but ideally what I eventually build will be self contained and not rely on a PC.

I have experience at PIC's but it is really limited to the basics, Flashing LED's & printing text onto an LCD etc. I would like some direction to a circuit which has already been designed for the purpose of controlling a PTZ using Pelco-P or D which I can modify to suit my needs.

Thanks for reading...

Paul.
 
Bump...

Sorry to seem persistant but can I ask if this hasn't been aswered because nobody knows or is it that I seem like I want it all done for me? Or just some other reason?

I've looked around since posting this and cannot find a way to do this with a PIC, it seems there's plenty of software out there to run it from a PC and a RS232 port though.

Thanks for any info!
 
It is probably because nobody is familiar with the protocol. A link to the protocol specification would be handy.

The electrical interface to an RS-485 bus is no real problem. Assuming the protocol is suited to using a UART, the only remaining issues are does the PIC have enough code space in the flash memory to run the protocol, and is there enough space in the register file for the data required for the application and the protocol.
 
Last edited:
here is the link to pelco-p protocol

**broken link removed**

I think a PIC can easily handle this protocol, in any case you could always use 18F series instead of a 16F series...

thanks
aa
 
That wouldn't be too difficult to do in a PIC. In assembler it could be done in something like a 12F629. The limit would be the number of spare pins for buttons.

Using a USART would make life a bit easier, but there is a warning here when using a USART with RS485. The USART produces a stop bit which is a high level, and if there is nothing more to transmit, the output remains high. There is no level change at the end of the stop bit. However, the RS485 driver has to be disabled at the end of transmission, and there is nothing within the PIC that tell you when the stop bit has finished. On some more advanced PICs there is a bit that says when the stop bit finishes, but it happens too early. (3/4 or 15/16ths of the way through the stop bit).

The result is that you have to time the stop bit in software and then disable the RS485 driver.

You could look on PIClist, Microchip PIC for code that could help you but I think that you will have to do some programming yourself. If you can print text onto an LCD, then implementing the protocol won't be much more difficult.
 
Yes. You can control PTZ Cameras using PCI RS 485.
I was a Pelco engineer on control system. If you need to know detail. I would like to help you.

Ning
 
Status
Not open for further replies.

Latest threads

Back
Top