STC-C42A/C43A
C.
The Communication Format
1. Sending Data Format from the PC to the Camera is shown below:
a. Sending the read command:
SOF
Device Code
Read / Write
Page Selection
Command Code
Data Length
Data
EOF
8 bit
(always 02H)
6 bit
1 bit
(always 00H)
1 bit
8 bit
8 bit
8 bit
8 bit
(always 03H)
b. Sending the write command:
SOF
Device Code
Read / Write
Page Selection
Command Code
Data Length
Data
EOF
8 bit
(always 02H)
6 bit
1 bit
(always 01H)
1 bit
8 bit
8 bit
Data
Length
Byte
8 bit
(always 03H)
2. Receiving data format from the camera is as below:
a. After sending the reading command:
SOF
Data Length
Data
EOF
8 bit (always 02H)
8 bit
Data Length Byte
8 bit (always 03H)
b. After sending the write command:
SOF
Data Length
Data
EOF
8 bit (always 02H)
8 bit (always 00H)
8 bit
8 bit (always 03H)
3. Descriptions of the Format:
Name
Descriptions
SOF
Start of the frame. The set (or receive) value is always “02H”
Device Code
This indicates the destination of the communication
The device code for the camera is “000000”. Other codes are the peripheral devices.
Read / Write
This specifies “Read” or “Write” to command numbers. Set 0 for “Read” and 1 for “Write”.
Page Selection
This specifies page selection (access selection) to registers and EEPROM of command.
Set 0 to access the command register of the camera.
Read command: To read the current data from the command register.
Write command: To set the data into the command register. The data in the EEPROM is not replaced.
Set 1 to access the EEPROM of the camera
Read command: To read the data from the EEPROM
Write command: To save the data into the EEPROM as default data
Notes:
1. The camera operates with the data in the EEPROM when the camera is powered on.
2. The camera returns the receiving code “01H” to the PC after save the data into the EEPROM. The camera rejects any commands
during the data saved (approximately 5 mseconds / byte) and returns the receiving code “07H” (busy) to the PC.
Command Code
This indicates the command. Refer to the following page for the details.
Data Length
This indicates the data length (Unit is byte).
Sending data: Set to 0 when sending the read command. The data length is dependent on each write command when sending the write
command.
Receiving data: The data length is dependent on each write command after sending the read command.
Receive “00H” after sending the write command.
Receive “00H” when an error has occurred.
Data
This indicates write data or read data according to the command type.
EOF
End of the frame. The set (or receive) value is always “03H”
Receiving Code
This indicates result of the sending command:
01H: Receiving OK (ACK)
10H: Receiving problem (NAC)
07H: The camera is in process (Busy)
11H: Communication problem
Application Manual
7 of 13
Rev1.0