0% found this document useful (0 votes)
128 views14 pages

Nyx5800 - Software IDD.V1.03 (1) - 1

The document describes a serial communications protocol for an imaging device. It specifies the packet format which includes a process code, status byte, function code, byte count, CRC bytes, and argument bytes. It then lists the basic serial commands for the device, including commands for configuration, image capture, and reading sensor data. Packet replies from the device provide a status code to indicate command success or failure.

Uploaded by

yigitcetinkaya88
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
128 views14 pages

Nyx5800 - Software IDD.V1.03 (1) - 1

The document describes a serial communications protocol for an imaging device. It specifies the packet format which includes a process code, status byte, function code, byte count, CRC bytes, and argument bytes. It then lists the basic serial commands for the device, including commands for configuration, image capture, and reading sensor data. Packet replies from the device provide a status code to indicate command success or failure.

Uploaded by

yigitcetinkaya88
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

N Y X 5 8 0 0 S o f t wa re I n t er f ace

D e s c r i p t i o n D o c u m e n t ( I DD )

N o v e m b e r 7 , 11
D o c u m e n t N u m b e r : d h - 1 0 0 - 11
Ve r s i o n 1 . 0 3
Table of Contents

1. Document ....................................................................................................................................... 3
1.1. Revision History ........................................................................................................................ 3
2. Acronyms / Abbreviations ............................................................................................................ 3
3. Serial Communications Protocol.................................................................................................. 3
3.1 Port Settings ............................................................................................................................... 3
4. Packet Protocol .............................................................................................................................. 3
4.1 Base Packet Protocol ................................................................................................................. 4
4.2 Base Serial Command List ....................................................................................................... 6
4.3 Extend Packet Protocol ........................................................................................................... 10
4.4 Extend Serial Command List ................................................................................................. 11
5. Application demonstration ......................................................................................................... 13
5.1 Base Packet Protocol ............................................................................................................... 13
5.2 Extend Packet Protocol ........................................................................................................... 13
6. Summarized Command Lists ..................................................................................................... 13

2/14
1. Document
1.1. Revision History
Rev.# Date Comments
1.01 11/01/2015 Initial Release.
1.02 05/08/2017 Add new image Command.
1.03 Add new command and example.
08/11/2018
Add timeout for the given commands.

2. Acronyms / Abbreviations
AGC Automatic Gain Control
CCITT Commite' Consultatif International de Telegraphique et Telephonique. (International
consultative committee on telecommunications and Telegraphy)
CRC Cyclic Redundancy Check
FFC Flat Field Correction
FPA Focal Plane Array
FW Firmware
IDD Interface Description Drawing / Document
LSB Least Significant Bit
MSB Most Significant Bit
ROI Region of Interest
SW Software
TBD To Be Determined

3. Serial Communications Protocol


The serial communication channel is a two-node, master-slave interface between an external device and the
core. The external device is considered the “master” in that it initiates all communications. The core is a
“slave” that generates a reply to each received message. For the purposes of this document “incoming” or
“received” messages refer to those from the master device to the core, and “reply” messages refer to those
from the core to the master device.
3.1 Port Settings
Table 3-1 defines the serial port default settings of the serial communication interface.
Table 3-1
Parameter Value
Baud rate 115200
Data bits 8
Parity none
Stop bits 1

4. Packet Protocol
All incoming and reply messages shall adhere to the packet protocol defined in 4.2 and the subparagraphs
3/14
that follow.
4.1 Base Packet Protocol
Table 4-1
BYTE# Upper Byte Comments
1 Process Code Set to 0x6E on all valid incoming and reply messages
2 Status See 4.1.1
3 Reserved reserved
4 Function See 4.1.2
5 Byte Count (MSB) See 4.1.3
6 Byte Count (LSB) See 4.1.3
7 CRC1 (MSB) See 4.1.4
8 CRC1 (LSB) See 4.1.4
N Argument See 4.1.5
N+1 CRC2 (MSB) See 4.1.4
N+2 CRC2 (LSB) See 4.1.4

4.1.1 Status Byte


The second byte of each incoming packet is ignored. For all reply messages, the core sets the second byte
as shown in Table 4-2 to indicate status of the previous incoming message packet. The decoding of the
incoming message is as follows:
Table 4-2
Status Byte
Definition Description
Value(hex)#
0x00 CAM_OK Message received
0x02 Not able to process a command at this
CAM_NOT_READY
time
0x03 CAM_RANGE_ERROR Argument out of range
0x04 CAM_CHECKSUM_ERROR Header or message-body checksum error
0x05 CAM_UNDEFINED_PROCESS_ER
Unknown process code
ROR
0x06 CAM_UNDEFINED_FUNCTION_E
Unknown function code
RROR
0x07 CAM_TIMEOUT_ERROR Timeout executing serial command
0x09 CAM_BYTE_COUNT_ERROR Byte count incorrect for the function code
0x10 CAM_UNDEFINED_EXPAND_FU
Unknown expand function code
NCTION_ERROR
0x11 CAM_CFG_ERROR Configuration operation error
0x12 CAM_FLASH_ERROR Flash error
0x13 CAM_UART_ERROR Error in serial port operation

4/14
0x14 CAM_ALGORITHM_ERROR Algorithm error
0x15 CAM_MEMORY_ERROR Memory error

4.1.2 Function Byte


The function-code byte is used to specify the function of an incoming message. For all reply messages, the
camera will echo back the function-code byte. A list of all valid Nyx5800 commands is shown in the
Command List. For most of these commands, the core replies after it has executed the specified function.

4.1.3 Byte Count Bytes


The byte-count bytes are used to specify the number of argument bytes in the packet (not the total number
of bytes in the packet). The byte count will typically be a positive integer, with range between 0 and
0x0106 (262 decimal). See the Command List for the expected byte count associated with each
function-code byte. Note that the byte-count of an incoming message is not necessarily equal to the byte
count of the reply message.

4.1.4 CRC Bytes


On all incoming and outgoing messages, two cyclical redundancy checks (CRCs) are calculated using
CCITT-16 initialized to 0. (Polynomial = x^16 + x^12 + x^5 + 1.) CRC1 is calculated using only the first
6 bytes of the packet. CRC2 is calculated using all previous bytes in the packet (i.e. bytes 0 through N).
Below is an example showing a CRC calculation for the single byte 0x6E.

Data = 0x6E = 01101110 (binary); Polynomial = 10001000000100001 (binary)


011011100000000000000000 [data is right-padded with 16 zeros]
⊕ 010001000000100001
---------------------------------------
001010100000100001000000
⊕ 0010001000000100001
---------------------------------------
000010000000110001100000
⊕ 00010001000000100001
---------------------------------------
000010000000110001100000
⊕ 000010001000000100001
---------------------------------------
000000001000110101101000
⊕ 0000010001000000100001
---------------------------------------
000000001000110101101000
⊕ 00000010001000000100001
---------------------------------------
000000001000110101101000
⊕ 000000010001000000100001
---------------------------------------
000000001000110101101000 = 0x8D68

5/14
4.1.5 Argument Bytes
The argument bytes (also called data bytes) are used to encode the argument of a message packet. The
number of argument bytes is typically a positive integer. See Command List for the argument definition for
each message. Two’s-complement numbering is used for all signed values. Big-endian ordering is
employed:
Byte 0, Byte 1, Byte 2, etc.

4.2 Base Serial Command List

1)Default
COMMAND FUCTION Byte Count Argument Description
SET 0x01 cmd:0 Sets all current
None settings as power-on
DEFAULTS reply:0
defaults

2) Reset
COMMAND FUCTION Byte Count Argument Description
RESET 0x02 cmd:0
None Sets camera
reply:0 reset/reboot

3) Restore Factory Defaults


COMMAND FUCTION Byte Count Argument Description
RESTORE
cmd:0
FACTORY 0x03 None Reverts settings to
reply:0 factory defaults.
DEFAULTS

4) Serial Number
COMMAND FUCTION Byte Count Argument Description
Bytes 0-31: Camera
SERIAL cmd:0 serial number Gets the serial
0x04 number of the
NUMBER reply:64 Bytes 32-63: Sensor
camera and sensor
serial number

5) Version
COMMAND FUCTION Byte Count Argument Description
Bytes 0-31: SW version
GET cmd:0
0x05 Bytes 32-63: FW Gets the firmware /
VERSION reply:64 software version
version

6/14
6) Baud Rate
COMMAND FUCTION Byte Count Argument Description
get cmd:0 Gets the Baud Rate
None
reply:2
0x0000: Auto baud Set the Baud Rate
0x0001: 9600 baud
BAUD
0x07 0x0002: 19200 baud
RATE set cmd:2
0x0004: 57600 baud
reply:2
0x0005: 115200 baud
0x0006: 460800 baud
0x0007: 921600 baud

7) Gain Mode
COMMAND FUCTION Byte Count Argument Description
Gets the
get cmd:0
None dynamic-range-contr
reply:2 ol mode
GAIN
0x0a 0x0001 = Low Gain sets the
MODE dynamic-range-contr
set cmd:2 Only
ol mode
reply:2 0x0002 = High Gain
Only

8) FFC Mode
COMMAND FUCTION Byte Count Argument Description
get cmd:0 Gets the FFC mode
None
reply:2
FFC MODE 0x0b
set cmd:2 0x0000 = Manual Sets the FFC mode
reply:2 0x0001 = Automatic

9) Do FFC
COMMAND FUCTION Byte Count Argument Description
get cmd:0 a short FFC is
Do FFC 0x0c None executed.
reply:0

10) FFC Period


COMMAND FUCTION Byte Count Argument Description
FFC Get Cmd: 0 Gets the FFC period
0x0d None
PERIOD (Reply: 4)

7/14
Set Cmd:2 Set FFC interval for
Bytes 0-1: FFC interval current gain state
& Reply: 2
Set Cmd:4 Bytes 0-1: reserved Set FFC interval for
all state
& Reply: 4 Bytes 2-3: FFC interval

11) FFC Temperature Delta


COMMAND FUCTION Byte Count Argument Description
Get Cmd: 0 Gets or sets the
None temperature
(Reply: 4)
difference used to
trigger automatic
FFC.The specified
FFC TEMP value is converted to
0x0e Celsius degrees by
DELTA Set Cmd:2 Bytes 0-1: Temperature
dividing by 10 then
& Reply: 2 delta value adding 0.1. For
example, a value of
100 corresponds to a
delta temperature of
1.1C deg.

12) Video mode


COMMAND FUCTION Byte Count Argument Description
Get Cmd: 0 Gets the video mode
None
VIDEO (Reply: 2)
0x0f
MODE Set Cmd: 2 0x0000 = real-time Set the video mode
& Reply: 2 0x0001 = freeze

13) Video Palette


COMMAND FUCTION Byte Count Argument Description
Get Cmd: 0 Gets the video
None palette
(Reply: 2)
0x0000-white hot Set the video palette
0x0001-black hot
0x0002-fusion
VIDEO 0x0003-rainbow
0x10
PALETTE Set Cmd: 2 0x0004-globow
& Reply: 2 0x0005-ironbow1
0x0006-ironbow2
0x0007-sepia
0x0008-color1
0x0009-color2

8/14
0x000a-icefire
0x000b-rain
0x000c-redhot
0x000d-greenhot
0x000f-spring
0x0010-summer
0x0011-autumn
0x0012-winter

14) Read Sensor


COMMAND FUCTION Byte Count Argument Description
0x0000 | FPA temp Gets various data
from the core,
C*10;
depending upon
READ Cmd: 2 0x000C | Circuit board argument of
0x20 incoming message
SENSOR & Reply: 2 temp, deg. C*100;
0x000A | Housing
temp, deg. C*100;

15) Test Pattern


COMMAND FUCTION Byte Count Argument Description
Get Cmd: 0 Gets the test pattern
none mode
TEST (Reply: 2)
0x25
PATTERN Set Cmd: 2 0x0000 = test pattern Sets the test pattern
mode
& Reply: 2 off 0x0006 = color bars

16) AGC Fliter


COMMAND FUCTION Byte Count Argument Description
Get Cmd: 0 Gets the AGC filter
none value
(Reply: 2)
AGC
0x3e Bytes 0-1: agc fliter Sets the AGC filter
FLITER Set Cmd: 2 value
value
& Reply: 2
Range: 0 to 255

17) AGC Plateau Level


COMMAND FUCTION Byte Count Argument Description
AGC Get Cmd: 0 Specifies the plateau
none level for the Plateau
PLATEAU 0x3f (Reply: 2)
AGC algorithm.
LEVEL Set Cmd: 2 Bytes 0-1: Plateau level

9/14
& Reply: 2 Range:0 to 4095

18) AGC roi


COMMAND FUCTION Byte Count Argument Description
Get Cmd: 0 Gets or sets the
none Region of Interest
(Reply: 8)
(ROI) used by some
of the AGC
algorithms in normal
and zoom modes.
Bytes 0-1: Left Assumes signed
AGC ROI 0x4c coordinates relative
Set Cmd: 2 Bytes 2-3: Top
to center value of
& Reply: 8 Bytes 4-5: Right (0,0), and
coordinates are
Bytes 6-7: Bottom
expressed as
percentages (-512 =
-50%, +512 =
+50%).

19) Brightness
COMMAND FUCTION Byte Count Argument Description
Get Cmd: 0 Get brightness
none
(Reply: 2)
BRIGHTNE
0x55 Bytes 0-1: brightness Set brightness
SS Set Cmd: 2
value
& Reply: 2
Range: 0 to 255

20) Sharpness
COMMAND FUCTION Byte Count Argument Description
Get Cmd: 0 Get sharpness
none
(Reply: 2)
SHARPNES
0xe3 Bytes 0-1: sharpness Set sharpness
S Set Cmd: 2
value
& Reply: 2
Range: -20 to 100

4.3 Extend Packet Protocol


Make appropriate extensions that are consistent with the underlying protocol format, fix the protocol word
(Function) to 0x00, and extend it within the Argument it carries. The first byte of the Argument is the
command code of the extension protocol, and the other bytes are the data it carries. The format of Extend
Packet Protocol is shown below.

10/14
Table 4-1
BYTE# Upper Byte Comments
1 Process Code 0x6E
2 Status See 4.1.1
3 Reserved reserved
4 Function 0x00
5 Byte Count (MSB) See 4.1.3
6 Byte Count (LSB) See 4.1.3
7 CRC1 (MSB) See 4.1.4
8 CRC1 (LSB) See 4.1.4
BYTE# Argument below
9 DHSCP Function See 4.3.1
N DHSCP Argument See 4.3.2
N+1 CRC2 (MSB) See 4.1.4
N+2 CRC2 (LSB) See 4.1.4

4.3.1 DHSCP Function


The DHSCP function-code byte is used to specify the function of an incoming message in the Extend
Packet Protocol. For all reply messages, the camera will echo back the function-code byte. A list of all
valid Nyx5800 commands is shown in 4.4 Extend serial Command List.

4.3.2 DHSCP Argument


The DHSCP argument bytes are used to encode the argument of a message packet. The definition is
the same as the Argument which has detailed instructions in 4.1.3.

4.4 Extend Serial Command List


1) 2D de-noise
COMMAND DHSCP Description
Byte Count Argument
Function
Get Cmd: 0 Get 2D level
none
(Reply: 2)
2D 0x03
Set Cmd: 2 Bytes 0-1: 2D level Set 2D level
& Reply: 2 Range: 0 to 100

2) 3D de-noise
COMMAND DHSCP Description
Byte Count Argument
Function
3D 0x04 Get Cmd: 0 none Get 3D level

11/14
(Reply: 2)
Set Cmd: 2 Bytes 0-1: 3D level Set 3D level
& Reply: 2 Range: 0 to 100

3) Scene Mode
COMMAND DHSCP Description
Byte Count Argument
Function
Get Cmd: 0 Get Scene mode
none
(Reply: 2)
byte0~1: Set Scene mode
SCENE
0x2a 0x0000:low dynamic
MODE Set Cmd: 2
0x0001:high dynamic
& Reply: 2
0x0002 : adaptive
dynamic

4) Contrast
COMMAND DHSCP Description
Byte Count Argument
Function
CONTRAST 0x2d Get Cmd: 0 Get Contrast
none
(Reply: 2)
Bytes 0-1: Contrast Set Contrast
Set Cmd: 2
level
& Reply: 2
Range: 0 to 100

5) Detail Enhancement
COMMAND DHSCP Description
Byte Count Argument
Function
Detail 0x2c Get Detail
Get Cmd: 0
Enhancement none Enhancement
(Reply: 2)

Set Cmd: 2 Bytes 0-1: level Set Detail


& Reply: 2 Range: 0 to 128 Enhancement

6) histogram equalization
COMMAND DHSCP Description
Byte Count Argument
Function
HISTOGRA 0x32 Get Cmd: 0 none Get histogram

12/14
M (Reply: 2) equalization
EQUALIZAT Set histogram
Set Cmd: 2 Bytes 0-1: level
ION equalization
& Reply: 2 Range: 0 to 32

5. Application demonstration
5.1 Base Packet Protocol
For example, get the housing temperature:

[COMMAND]
Process
Status Reserved Function Byte Count CRC1 Argument CRC2
Code
0x6E 0x00 0x00 0x20 0x00 0x02 0x79 0x3F 0x00 0x0a 0xa1 0x4a

[REPLY]
Process
Status Reserved Function Byte Count CRC1 Argument CRC2
Code
0x6E 0x00 0x00 0x20 0x00 0x02 0x79 0x3F 0x11 0x55 0x3a 0x12

So house temperature is 0x1155/100 = 44.3℃.

5.2 Extend Packet Protocol


For example, set contrast to 0x32:
[COMMAND]
Process DHSCP DHSCP
Status Reserved Function Byte Count CRC1 CRC2
Code Function Argument
0x6E 0x00 0x00 0x00 0x00 0x03 0xef 0xd8 0x2d 0x00 0x32 0xd2 0x86

[REPLY]
Process DHSCP DHSCP
Status Reserved Function Byte Count CRC1 CRC2
Code Function Argument
0x6E 0x00 0x00 0x00 0x00 0x03 0xef 0xd8 0x2d 0x00 0x32 0xd2 0x86

6. Summarized Command Lists


The lists below are subsets of all command, each showing all the commands related to a particular aspect of
Nyx5800 operation.

13/14
List of Camera basic setting commands:
Function Code COMMAND Cost Time(Max)
0x01 SET DEFAULTS 6s
0x02 SET RESET NA
RESTORE FACTORY 130ms
0x03
DEFAULTS
0x04 SERIAL NUMBER NA
0x05 GET VERSION 50ms
0x07 BAUD RATE NA
0x20 READ SENSOR 30ms
0x25 TEST PATTERN 30ms

List of FFC-relate commands:


Function Code COMMAND Cost Time(Max)
0x0b FFC MODE 30ms

0x0c DO FFC 4s

0x0d FFC PERIOD 30ms

0x0e FFC TEMP DELTA 30ms

List of AGC commands:


Function Code COMMAND Cost Time(Max)
0x3e AGC FLITER 130ms

0x3f AGC PLATEAU LEVEL 30ms

0x4c AGC ROI 30ms

List of Image basic settings commands:


Function Code COMMAND Cost Time(Max)
0x55 BRIGHTNESS 30ms
0xe3 SHARPNESS 30ms
0x2d CONTRAST 30ms
0x2c DETAIL ENHANCEMENT 30ms
HISTOGRAM 30ms
0x32
EQUALIZATION

List of Image Enhancement commands:


Function Code COMMAND Cost Time(Max)
0x03 2D 30ms
0x04 3D 30ms

14/14

You might also like