Introduction

I got hold of a second-hand Bosch Divar DVR6E1082 6-channel digital video recorder. These units are very robust and have plenty of features. One feature is the camera control which uses the Bosch biphase signalling and protocol. I have a few cameras with zoom and focus motors in the lenses which I thought would be worth hooking up to the Divar.

Unfortunately I could find very little detail about the biphase signalling and message protocol after seraching on the Internet, so I decided to have a close look at it and work it out myself. One useful document that I did find gave details about the message structure used to control the cameras. This can be found here. Now we had a good idea what the message bytes should be, all that remained was to examine the bitstream and match it up.

Message Protocol

Length byte. The message is a short sequence of bytes, with the first byte having the MSB set (0x80). This is the length byte and indicates both the start of the message and the length of the packet (in bytes) not including the length byte. It is usually 0x86 or 0x87 depending on the number of data bytes in the message.

High Order Address Byte. Since the MSB must be zero for all bytes except the length byte, this byte contains the top 7-bits of a 14-bit camera address (that's a lot of cameras).

Low Order Address Byte. This byte contains the lower 7-bits of the camera address. Camera 1 would be encoded as all 0's, camera 2 as 0000000 0000001 etc.

Opcode. This byte is the operation code, which allows interprestation of the following data bytes in context with the operation being requested/performed.

Data Bytes. There are usually 2 or 3 data bytes whose meaning depends on the opcode.

Checksum. The checksum byte is the sum of all the other bytes in the packet and'ed with 0x7F.

Below are the opcodes for controlling the pan, tilt, focus, iris and zoom operations of the camera. There are three data bytes and the bits are used to start or stop the operation depending on whether they are set or reset.

Opcode 5 <0x05>: Start/Stop Variable-speed PTZ

Opcode 5 <0x05> activates variable-speed functions for an indefinite period. A logic one activates the indicated function, which remains active until explicitly turned off. The appropriate Speed Bits determine the speed for the Pan, Tilt, and Zoom operations. The Receiver/Driver settings determine the Focus and Iris speed. The functions can be turned off by a command with a different Opcode or by Opcode 5 <0x05> with a zero in the associated data bit position.

Received Command

<0x87><Address MSB><Address LSB><0x05><Data Byte 1><Data Byte 2><Data Byte 3> <checksum>

Data Byte Codes

 

7

6

5

4

3

2

1

0

Data Byte 1

0

Zoom Speed Bit 2

Zoom Speed  Bit 1

Zoom Speed Bit 0

Tilt  Speed Bit 3

Tilt Speed Bit 2

Tilt Speed Bit 1

Tilt Speed Bit 0

Data Byte 2

0

Pan Speed  Bit 3

Pan Speed Bit 2

Pan Speed Bit 1

Pan Speed Bit 0

Iris Brighter

Iris Darker

Focus Far

Data Byte 3

0

Focus Near

Zoom In

Zoom Out

Tilt Up

Tilt Down

Pan Left

Pan Right

 

  • An X indicates that the bit position is not used.
  • A value of 1 (one) in a bit position starts the operation.
  • A value of 0 (zero) in a bit position stops the operation.

 

Opcode 8 <0x08>: Repetitive Variable-speed PTZ, Focus, and Iris

Opcode 8 <0x08> activates pan, tilt, zoom, focus, and iris functions. It provides for variable speed control over pan/tilt/zoom functions. The pan and tilt functions require a speed value of 0 to 15; 0 is the slowest speed and 15 is the fastest speed. The zoom function requires a speed value of 0 to 7; 0 is the slowest speed and 7 is the fastest speed. This Opcode causes the specified function to be activated for at least 50 ms, so the command must be issued at a frequency of no less than 20 Hz for smooth operation.

Received Command

<0x87><Address MSB><Address LSB><0x08><Data Byte 1><Data Byte 2><Data Byte 3> <checksum>

Data Byte Codes

 

7

6

5

4

3

2

1

0

Data Byte 1

0

Zoom Speed Bit 2

Zoom Speed Bit 1

Zoom Speed Bit 0

Tilt Speed Bit 3

Tilt Speed Bit 2

Tilt Speed Bit 1

Tilt Speed Bit 0

Data Byte 2

0

Pan Speed Bit 3

Pan Speed Bit 2

Pan Speed Bit 1

Pan Speed Bit 0

Iris Brighter

Iris Darker

Focus Far

Data Byte 3

0

Focus Near

Zoom In

Zoom Out

Tilt Up

Tilt Down

Pan Left

Pan Right

 

  • A value of 1 (one) in a bit position starts the operation.
  • A value of 0 (zero) in a bit position stops the operation.
  • The appropriate Speed Bits determine the speed for the pan, tilt, and zoom operations.
  • The Receiver/Driver settings determine the speed for the focus and iris operations.