Wiki

This version (28 Sep 2023 16:56) was approved by Andre Straker-Payne.The Previously approved version (21 Sep 2023 18:08) is available.Diff

ADSD3500 Guide

Host Processor Integration Guide

Software System Overview

ADSD3500 is a Depth Compute Image Signal Processor (ISP) for the ADI ToF CW CMOS imaging sensors. It converts the raw frame captures from the sensor to Depth data and Active Brightness (AB) image, along with a confidence frame. ADSD3500 shall support Thoreau and Newton imagers and future imaging sensors if the input data format is compatible with the current imaging sensors and up to a maximum resolution of 1MP.

Host Protocol Design Overview

Host Protocol is software module implemented in ADSD3500 Firmware to interact with Host. Through this module, Host can,

  • Configure and control the ADSD3500 ISP
  • Get the status of ADSD3500 ISP
  • Configure Imager Module attached to ADSD3500 ISP
  • Upgrade the Flash content on the Module (Imager Firmware, Calibration Data, ADSD3500 Firmware, Configuration Parameters
  • Read the Debug/Diagnostic information stored in Flash

Standard mode and Burst mode commands are implemented to achieve the above functionalities. Supported communication channels between Host and ADSD3500 are I2C, SPI and I3C. Host works as Master in the system. Bootstraps pins #0, #1 and #2 are used to select the communication channel as follows.

Bootstrap Pins
{BS3, BS1}
Description
b00 I2C Slave Interface to HOST (With Static I2C address as 0x70/0x71)
b01 SPI Slave Interface to HOST
b10 I2C Slave Interface to HOST (With Static I2C address as 0x80/0x81)
b11 I3C Slave Interface to HOST (Use static I2C address as 0x70/0x71 – Used by I3C master for quick Dynamic address allocation)

Commands

There are two command group:

  • Standard
  • Burst

Standard commands are used to read or write 16-bits of data. Burst commands are used to read or write more than 16-bits of data.

The ADSD3500 needs to be switched between the two modes. As a result there is a standard mode command to switch to bust mode; and there is a burst mode command to switch to standard mode.

Note, the data format is Big-endian.

It is recommended that no READ commands be issued while streaming frames (between stream on and stream off).
It is recommended that for READ commands, a delay be inserted between the command write operation and the data read operation. This is more critical for I2C rates above 400KHz, where a delay of 1ms should be used.

Standard Mode Commands

WRITE operation:

  • Write: <2-bytes for command ID> <2-bytes of data>

READ Operation :

  • Write: <2-bytes for command ID>
  • Read: <2-bytes of data>
Description Type Op 1 Command ID
(16-bits)
Op 2 Data
(16-bit)
Get Chip ID Read W 0x0112 R 0x5931
Stream On Write W 0x00AD W 0x00C5
Stream Off Write W 0x000C W 0x0002
Set Imager Mode Write W 0xDAxx
xx → Imager mode value.
i.e., for mode 7 it should be 7.
Supported modes are 0 to 10.
W 0xyyyy
yyyy – ADSD3500 mode setting is decoded as follow:
Bit 0:  Depth is enabled (1)/Disabled (0) 
Bit 1: Data interleaving (1)/Virtual channel (0)
Bit 2: AB Enabled (1)/Disabled (0)
Bit 3: AB averaging Enabled (1)/Disabled (0)
Bit 6,5,4: Number of bits in Depth/Phase
* 000 → 16-bits
* 001 → 14-bits
* 010 → 12-bits
* 011 → 10-bits
* 100 → 8-bits
Bit 9,8,7: Number of bits in AB 
* 000 → 16-bits
* 001 → 14-bits
* 010 → 12-bits
* 011 → 10-bits
* 100 → 8-bits
Bit 11,10: Confidence
* 00 → Confidence Disabled
* 01 → 4-bits confidence
* 10 → 8bits Confidence
Bit 13,12: MIPI Lanes
* 00 → 0 output MIPI lanes
* 01 → 1 output MIPI lane
* 10 → 2 output MIPI lane
Bit 14,15: Reserved
Read Imager Mode Read W 0x0012 R Current imager mode
Value returned is between 0 and 10.
Set AB Invalidation Threshold Write W 0x0010 W 0 to 0xFFFFF
Get AB Invalidation Threshold Read W 0x0015 R Invalidation threshold
Returned value is between 0 to 0xFFFF.
Set Confidence Threshold Write W 0x0011 W 0 to 0xFFFF
Get Confidence Threshold Read W 0x0016 R Confidence threshold
Returned value is between 0 to 0xFFFF
Enable/Disable JBLF Filter Write W 0x0013 W * 0x0000 - Disable JBLF filter
* 0x0001 - Enable JBLF filter
Get JBLF Filter Status Read W 0x0017 R * 0x0000 - JBLF filter disabled
* 0x0001 - JBLF filter enabled
Set JBLF Filter Size Write W 0x0014 W JBLF filter size = 3, 5 or 7.
Get JBLF Filter Size Read W 0x0018 R Current JBLF filter size; 3, 5 or 7.
Switch to Burst Mode Write W 0x0019 W 0x0000
Set Enable/Disable Temperature Compensation Write W 0x0021 W * 0 - Disable temperature compensation
* 1 - Enable temperature compensation
Get Status Read W 0x0020 R ADSD3500 Status
* 0x01 ADI_STATUS_INVALID_MODE
* 0x02 ADI_STATUS_INVALID_JBLF_FILTER_SIZE
* 0x03 ADI_STATUS_UNSUPPORTED_CMD
* 0x04 ADI_STATUS_INVALID_MEMORY_REGION
* 0x05 ADI_STATUS_INVALID_FIRMWARE_CRC
* 0x06 ADI_STATUS_INVALID_IMAGER
* 0x07 ADI_STATUS_INVALID_CCB
* 0x08 ADI_STATUS_FLASH_HEADER_PARSE_ERROR
* 0x09 ADI_STATUS_FLASH_FILE_PARSE_ERROR
* 0x0A ADI_STATUS_SPIM_ERROR
* 0x0B ADI_STATUS_INVALID_CHIPID
* 0x0C ADI_STATUS_IMAGER_COMMUNICATION_ERROR
* 0x0D ADI_STATUS_IMAGER_BOOT_FAILURE
* 0x0E ADI_STATUS_FIRMWARE_UPDATE_COMPLETE
* 0x0F ADI_STATUS_NVM_WRITE_COMPLETE
* 0x10 ADI_STATUS_IMAGER_ERROR
* 0x11 ADI_STATUS_TIMEOUT_ERROR
* 0x12 ADI_STATUS_NVM_LOCKED
(Note : To get the Status , Switch to Standard Mode)
Set Framerate Write W 0x0022 W Frame rate on MIPI
Get Framerate Read W 0x0023 R Read the current frame rate set
Reset the ADSD3500 Write W 0x0024 W N/A
Enable FSYNC Trigger Control Write W 0x0025 W * 0x00 - ADSD3500 Firmware stops triggering the FSYNC after processing frame.
* 0x01 - ADSD3500 Firmware Starts triggering the FSYNC.
* 0x02 - ADSD3500 Firmware set FSYNC signal to high impedance state.
Trigger FSYNC Write W 0x0026 W 0x0000
Set Radial Threshold Minimum Write W 0x0027 W Writes a 16-bit radial threshold min value to be set.
Get Radial Threshold Minimum Read R 0x0028 R Reads a 16-bit radial threshold min value to be set.
Set Radial Threshold Maximum Write W 0x0029 W Writes a 16-bit radial threshold max value to be set.
Get Radial Threshold Maximum Read R 0x0030 R Reads a 16-bit radial threshold max value to be set.
Get Imager Type and CCB Version Read R 0x0032 R 0:7 CCB Version
* 1 - Version 0
* 2 - Version 1
8:15 Imager Type
* 1 - ADSD3100
* 2 - ADSD3030
Get Laser Temperature Read R 0x0055 R 16-bit temperature in degrees C
Get Sensor Temperature Read R 0x0054 R 16-bit temperature in degrees C
Enable Edge Confidence Read W 0x0062 W 0x0000 - Disable Edge Confidence
0x0001 - Enable Edge Confidence
Get Temperature Compensation Status Read W 0x0076 R 1 - Temperature Compensation is Enabled
0 - Temperature Compensation is Disabled
Set MIPI output speed Write W 0x0031 W Set the firmware output MIPI speed per lane from any of the predefined values.
0xYY is any of the following values:

0x01 - 2.5 Gbps,
0x02 - 2 Gbps,
0x03 - 1.5 Gbps,
0x04 - 1 Gbps,
0x05 - 800 Mbps,
0x06 - 500 Mbps,
0x07 - 400 Mbps,
0x08 - 250 Mbps
Get MIPI output speed Read R 0x0034 R Returns one of the following values:

0x01 - 2.5 Gbps,
0x02 - 2 Gbps,
0x03 - 1.5 Gbps,
0x04 - 1 Gbps,
0x05 - 800 Mbps,
0x06 - 500 Mbps,
0x07 - 400 Mbps,
0x08 - 250 Mbps
Enable Phase Value Invalidation Write W 0x0072 W 0x0000 - Phase Value Invalidation
0x0001 - Enable Phase Value Invalidation
Enable/Disable Output metadata Header in AB Frame Write W 0x0036 W 0x0000 - Disable metadata header in AB Frame
0x0001 - Enable metadata header in AB Frame
Get Output metadata Header in AB Frame status Read R 0x0037 R * 0x0000 - metadata header in AB Frame is Disabled
* 0x0001 - metadata header in AB Frame is Enabled
Get Imager Error Code Read R 0x0038 R Reads 16-bit error code from ADSD3100 Imager
Set VCSEL Delay Write W 0x0066 W Write a 16-bit value that controls delay of VCSEL. Note: Applicable only for ADSD3100
Get VCSEL Delay Read R 0x0068 R Reads a 16-bit VCSEL delay value from the MIPI header. Note: Applicable only for ADSD3100
Set JBLF Max Edge Threshold Write W 0x0074 W 0xZZZZ is the 16-bit jblf Max Edge threshold to be set.
Set JBLF AB Threshold Write W 0x0075 W 0xZZZZ is the 16-bit jblf AB threshold to be set. Threshold value would be scaled by Number of Freqs.
Get JBLF Gaussian Sigma Read R 0x0069 R Reads 16-bit JBLF Gaussian sigma value
Set JBLF Gaussian Sigma Write W 0x006B W Set JBLF Gaussian sigma value
Get JBLF Exponential term Read R 0x006A R Reads 16-bit JBLF EXPONENTIAL TERM
Set JBLF Exponential term Write W 0x006C W Set JBLF EXPONENTIAL TERM
Enable 1PPS Timer Mode Write W 0x006D W 0x0000 - Free-Wheeling mode
0x0001- 1PPS Mode

Burst Mode Commands

Get Camera Intrinsics

This is BURST mode command to get the camera intrinsic structures from the ADSD3500 for a given Mode (Supported Modes are 0 to 10). This is the calibration data required for R-depth to Point Cloud conversion.

ID
1 Byte
Size
2 Bytes
Cmd
1 Byte
Address
4 Bytes
Header Checksum
4 Bytes
Custom Data
4 Bytes
0xAD 0x00 0x01 0x0000 Header Checksum (size, CMD, address) Mode

Upon reception of this command, Firmware sends 56 Bytes CAMERA INSTRINSIC structure as follow:

typedef struct { 
  float fx; 
  float fy; 
  float cx; 
  float cy; 
  float codx; 
  float cody; 
  float k1; 
  float k2; 
  float k3; 
  float k4; 
  float k5; 
  float k6; 
  float p2; 
  float p1; 
} CameraIntrinsics; 

Get Dealias Parameters

This is BURST mode command to get the dealias parameters for a given mode (Supported Modes are 0 to 10). For getting the calibration data required for partial depth to full depth conversion

ID
1 Byte
Size
2 Bytes
Cmd
1 Byte
Address
4 Bytes
Header Checksum
4 Bytes
Custom Data
4 Bytes
0xAD 0x00 0x02 0x0000 Header Checksum (size, CMD, address) Mode

Upon reception of this command, Firmware send 32-byte dealias parameter structure as follow:

typedef struct { 
  int n_rows; 
  int n_cols; 
  uint8_t n_freqs; 
  uint8_t row_bin_factor; 
  uint8_t col_bin_factor; 
  uint16_t n_offset_rows; 
  uint16_t n_offset_cols; 
  uint16_t n_sensor_rows; 
  uint16_t n_sensor_cols; 
  uint8_t FreqIndex[3]; 
  uint16_t Freq[3]; 
} DealiasDataStructure; 

Firmware Upgrade Command

This is burst mode command to upgrade the ADSD3500 Current firmware stored in Flash memory.

ID
1 Byte
Size
2 Bytes
Cmd
1 Byte
Address
4 Bytes
Header Checksum
4 Bytes
Custom Data
4 Bytes
0xAD Chunk Size (Size of Flash Page) 0x04 Total size of Firmware Binary Header Checksum (size, CMD, address) CRC of the Firmware Binary

Host first send this 16 byte header to ADSD3500. ADSD3500 will receive header and derives, One Chunk Size, total number of chunks (Total size / one chunk size), Expected CRC of the complete firmware.

If firmware size is 16 KB and Flash page size is 512 Byte, then SIZE = 512 and Total size = 16384 (16 KB). ADSD3500 firmware shall expect 32 (16 KB/512) data chunk each of size 512 Byte.

If the firmware size is not multiple of Page size, then Host shall pad the remaining byte with 0x00 to make it multiple of Page size. i.e. Firmware size = 16000 Byte. Size is 384 bytes short to 16 KB (16384), so Host shall send Total size = 16 KB and pad the last 384 bytes of last chuck with 0x00.

Get Pulsatrix Firmware Version and GitHash

This is burst mode command to retrieve the ADSD3500 Firmware version and GIT HASH of the commit used to generate the Firmware binary. GIT HASH is computed using SHA-1 algorithm so it is 160 bits log (20 BYTES (40 hex characters, 40 bytes ASCII values) ). First 4 bytes of the Firmware binary are reserved for Firmware version. GIT HASH shall be appended at the END of the Firmware Binary while storing to Flash.

ID
1 Byte
Size
2 Bytes
Cmd
1 Byte
Address
4 Bytes
Header Checksum
4 Bytes
Custom Data
4 Bytes
0xAD 0x00 0x05 0x0000 Header Checksum (size, CMD, address) * 0x01 - To get the version of Current Firmware
* 0x02 - To get the version of Upgrade Firmware
* 0x03 - To get the version of Factory Firmware

Upon reception of this command, upon reception of this command, Firmware retrieves the version and GIT Hash from the Firmware stored in Flash for a given Section (Current, Upgrade, Factory) and sends 44 bytes (4 Byte version followed by 40 bytes Hash) to Host.

Switch to Standard Mode

This command switches the protocol mode of the ADSD3500 Firmware from BURST MODE to STANDARD MODE. After this command, ADSD3500 supports only STANDARD MODE commands. 

ID
1 Byte
Size
2 Bytes
Cmd
1 Byte
Address
4 Bytes
Header Checksum
4 Bytes
Custom Data
4 Bytes
0xAD 0x00 0x10 0000 Header Checksum (size, CMD, address) 0x00

Get ADSD3500 System Status

ID
1 Byte
Size
2 Bytes
Cmd
1 Byte
Address
4 Bytes
Header Checksum
4 Bytes
Custom Data
4 Bytes
0xAD 0x00 0x18 0x0000 Header Checksum (size, CMD, address) 0x00 0x00 0x00 0x00

The response from the ADSD3500 will be:

ID
1 Byte
Size
2 Bytes
Cmd
1 Byte
Address
4 Bytes
Header Checksum
4 Bytes
Custom Data
4 Bytes
0xAD 0x00 0x18 0x0000 Header Checksum (size, CMD, address) ADSD3500 System Status

Example Flow

Sample Code: C Code for Accessing ADSD3500 Host Commands

The following code shows how to access ADSD3500 host commands via the ToF Linux device driver. The program executes from the command line on a Linux embedded host.

This file ingests infile.txt. infile.txt contains the commands.

Example 1:

  • Issue the 'Get Chip ID' command
analog@aditof:~$ mode infile.txt
R 01 12
analog@aditof:~$ ./burst_ctrl
59 31

Example 2:

  • Issue the 'Get Confidence Threshold' command
  • Issue the 'Get Chip ID' command
  • Issue the 'Set Confidence Threshold' command
  • Issue the 'Get Chip ID' command
  • Issue the 'Get Confidence Threshold' command
analog@aditof:~$ more infile.txt
R 00 16
R 01 12
W 00 11 00 34
R 01 12
R 00 16
analog@aditof:~$ ./burst_ctrl
00 19
59 31
59 31
00 34
burst_ctrl.cpp
#include <string>
#include <iostream>
#include <sstream>
#include <fstream>
 
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <stdint.h>
#include <malloc.h>
#include <cstring>
#include <stdbool.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <linux/videodev2.h>
 
#define IOCTL_TRIES 3
#define CLEAR(x) memset (&(x), 0, sizeof (x))
#define CTRL_SIZE 4099
#define VER_MAJ 1
#define VER_MIN 0
#define VER_PATCH 1
 
static int xioctl(int fd, int request, void *arg)
{
	    int r;
	    int tries = IOCTL_TRIES;
	    do {
	        r = ioctl(fd, request, arg);
	    } while (--tries > 0 && r == -1 && EINTR == errno);
 
	    return r;
}
 
bool v4l2_ctrl_set(int fd, uint32_t id, uint8_t *val)
{
	static struct v4l2_ext_control extCtrl;
	static struct v4l2_ext_controls extCtrls;
 
	extCtrl.size = CTRL_SIZE * sizeof(char);
	extCtrl.p_u8 = val;
	extCtrl.id = id;
	memset(&extCtrls, 0, sizeof(struct v4l2_ext_controls));
	extCtrls.controls = &extCtrl;
	extCtrls.count = 1;
	if (xioctl(fd, VIDIOC_S_EXT_CTRLS, &extCtrls) == -1) {
		std::cout << "Failed to set ctrl with id " << id;
		return false;
	}
 
	return true;
}
 
bool v4l2_ctrl_get(int fd, uint32_t id, uint8_t *val)
{
	static struct v4l2_ext_control extCtrl;
	static struct v4l2_ext_controls extCtrls;
 
	extCtrl.size = CTRL_SIZE * sizeof(char);
	extCtrl.p_u8 = val;
	extCtrl.id = id;
	memset(&extCtrls, 0, sizeof(struct v4l2_ext_controls));
	extCtrls.controls = &extCtrl;
	extCtrls.count = 1;
	if (xioctl(fd, VIDIOC_G_EXT_CTRLS, &extCtrls) == -1) {
		std::cout << "Failed to get ctrl with id " << id;
		return false;
	}
 
	return true;
}
 
 
int main() {
	uint8_t data[CTRL_SIZE] = {0};
 
	int fd = open("/dev/v4l-subdev1", O_RDWR | O_NONBLOCK);
	if (fd == -1) {
		std::cout << "Failed to open the camera" << std::endl;
		return -1;
	}
 
	std::ifstream infile("infile.txt");
	std::string line;
 
	if (!infile.is_open()) {
		std::cout << "File infile.txt not found\n";
		return -1;
	}
 
	printf("Burst Control app version: %d.%d.%d\n", VER_MAJ, VER_MIN, VER_PATCH);
 
	while (std::getline(infile, line))
	{
		std::stringstream lineStream(line);
		std::string token;
		std::string r_w;
		int i = 0;
		lineStream >> r_w;
		while(lineStream >> token) {
			try {
				data[i+3] = stoi(token, 0, 16);
			}
			catch(std::invalid_argument& e){
			}
			i++;
			if (i > 4096) {
				std::cout << "Command line has to many bytes\n";
				return -1;
			}
		}
		//Delay functionality
		if (r_w == "D") {
			usleep(1000 * data[3]);
			continue;
		}
 
		data[0] = 1;
		data[1] = i >> 8;
		data[2] = i & 0xFF;
 
		v4l2_ctrl_set(fd, 0x009819e1, data);		
		if ((r_w == "R") && (i != 2) && (i != 4)) {
			data[0] = 0;
			data[1] = data[4];
			data[2] = data[5];
			v4l2_ctrl_set(fd, 0x009819e1, data);
			v4l2_ctrl_get(fd, 0x009819e1, data);
 
			int read_len = (data[1] << 8) | data[2];
 
			for (int j = 0; j < read_len; j++)
				printf("%02X ", data[j + 3]);
			printf("\n");
		} else if (((r_w == "R") && (i == 2)) || ((r_w == "R") && (i == 4))) {
			data[0] = 0;
			data[1] = 0;
			data[2] = 2;
			usleep(1000 * 33);
			v4l2_ctrl_set(fd, 0x009819e1, data);
			v4l2_ctrl_get(fd, 0x009819e1, data);
 
			int read_len = 2;
 
			for (int j = 0; j < read_len; j++)
				printf("%02X ", data[j + 3]);
			printf("\n");
		}
	}
 
	return 0;
}

Sample Code

adsd3500_sample.py
from i2chw_d import * 
import binascii 
from binascii import hexlify 
import os 
import ctypes 
import time  
 
def hexstring(values): 
    """ 
    Convert a bytes like object to a hex string 
    :param values : bytes like object 
    :return: hex string representing the value 
    """ 
    return hexlify(bytearray(values)).decode("ascii") 
 
def intstring(values): 
    """ 
    Convert a bytes like object to a hex string 
    :param values : bytes like object 
    :return: hex string representing the value 
    """ 
    return hexlify(bytearray(values)).decode("int") 
 
if __name__ == "__main__": 
    global ft4222_handle
 
    I2C_FREQ = 0 
    n = len(sys.argv) 
    print("Total arguments passed:", n) 
    I2C_FREQ = sys.argv[1] 
    print(I2C_FREQ)  
    i2cInit(int(I2C_FREQ)) 
    count = 0 
    i2c_fifo_depth = 1 
    i2c_fifo_word_size = 1 
 
    ########################################################################################## 
    #Get chip id CMD : 0x0112 - This is READ command. ADSD3500 returns 2 BYTE chip ID (0x5931) 
    data_out_list_append = [] 
    for i in range(1, i2c_fifo_word_size * i2c_fifo_depth+1): 
        data_out_list_append.extend(int(0x0112).to_bytes(2,byteorder="big")) 
 
    data_out = bytes(data_out_list_append) 
    print('I2C data written') 
    print(hexlify(data_out)) 
    count = i2cWrite(0x38, data_out)     
    count, rx_data = i2cRead(0x38, 2) 
    print('I2C data read') 
    print(hexlify(rx_data)) 
    print("Number of data bytes read: %2d bytes\n" % (count)) 
    time.sleep(0.5) 
 
    ######################################################################################### 
    #Stream on : CMD : 0x00AD DATA : 0x00C5 
    data_out_list_append = [] 
    for i in range(1, i2c_fifo_word_size * i2c_fifo_depth+1): 
        data_out_list_append.extend(int(0x00AD).to_bytes(2,byteorder="big")) 
        data_out_list_append.extend(int(0x00C5).to_bytes(2,byteorder="big")) 
 
    data_out = bytes(data_out_list_append) 
    print('I2C data written') 
    print(hexlify(data_out)) 
    count = i2cWrite(0x38, data_out)     
    print("Number of data bytes written: %2d bytes \n" % (count)) 
    time.sleep(0.5)  
 
    ########################################################################################## 
    #Stream off : CMD : 0x000C DATA : 0x0002 
    data_out_list_append = [] 
    for i in range(1, i2c_fifo_word_size * i2c_fifo_depth+1): 
        data_out_list_append.extend(int(0x000C).to_bytes(2,byteorder="big")) 
        data_out_list_append.extend(int(0x0002).to_bytes(2,byteorder="big")) 
 
    data_out = bytes(data_out_list_append) 
    print('I2C data written') 
    print(hexlify(data_out)) 
    count = i2cWrite(0x38, data_out)     
    print("Number of data bytes written: %2d bytes \n" % (count)) 
    time.sleep(0.5) 
 
    ########################################################################################## 
    #Set Imager mode CMD : 0xDA07 DATA : 0x2021 (Depth is enabled, 12 bit depth, Virtual Channel is enabled, 2 o/p MIPI lanes) 
    data_out_list_append = [] 
    for i in range(1, i2c_fifo_word_size * i2c_fifo_depth+1): 
        data_out_list_append.extend(int(0xDA07).to_bytes(2,byteorder="big")) 
        data_out_list_append.extend(int(0x00FF).to_bytes(2,byteorder="big")) 
 
    data_out = bytes(data_out_list_append) 
    print('I2C data written') 
    print(hexlify(data_out)) 
    count = i2cWrite(0x38, data_out)     
    print("Number of data bytes written: %2d bytes \n" % (count)) 
    #time.sleep(0.5) 
 
    #read transaction 
 
    count, rx_data = i2cRead(0x38, 2) 
    print('I2C data read') 
    print(hexlify(rx_data)) 
    print("Number of data bytes read: %2d bytes\n" % (count)) 
    time.sleep(0.5) 
 
    ######################################################################################### 
    #Stream on CMD : 0x00AD DATA : 0x00C5 
    data_out_list_append = [] 
    for i in range(1, i2c_fifo_word_size * i2c_fifo_depth+1): 
        data_out_list_append.extend(int(0x00AD).to_bytes(2,byteorder="big")) 
        data_out_list_append.extend(int(0x00C5).to_bytes(2,byteorder="big")) 
 
    data_out = bytes(data_out_list_append) 
    print('I2C data written') 
    print(hexlify(data_out)) 
    count = i2cWrite(0x38, data_out)     
    print("Number of data bytes written: %2d bytes \n" % (count)) 
    time.sleep(0.5) 
 
    ########################################################################################## 
    #Stream off CMD : 0x000C DATA : 0x0002 
    data_out_list_append = [] 
    for i in range(1, i2c_fifo_word_size * i2c_fifo_depth+1): 
        data_out_list_append.extend(int(0x000C).to_bytes(2,byteorder="big")) 
        data_out_list_append.extend(int(0x0002).to_bytes(2,byteorder="big")) 
 
    data_out = bytes(data_out_list_append) 
    print('I2C data written') 
    print(hexlify(data_out)) 
    count = i2cWrite(0x38, data_out)     
    print("Number of data bytes written: %2d bytes \n" % (count)) 
    time.sleep(0.5) 
 
    ########################################################################################## 
    #Set Framerate command CMD : 0x0022 DATA : 0x20 (32 FPS)  
    data_out_list_append = [] 
    for i in range(1, i2c_fifo_word_size * i2c_fifo_depth+1): 
        data_out_list_append.extend(int(0x0022).to_bytes(2,byteorder="big")) 
        data_out_list_append.extend(int(0x0020).to_bytes(2,byteorder="big")) 
 
    data_out = bytes(data_out_list_append) 
    print('I2C data written') 
    print(hexlify(data_out)) 
    count = i2cWrite(0x38, data_out)     
    print("Number of data bytes written: %2d bytes \n" % (count)) 
    #time.sleep(0.5) 
 
    #read transaction 
    count, rx_data = i2cRead(0x38, 2) 
    print('I2C data read') 
    print(hexlify(rx_data)) 
    print("Number of data bytes read: %2d bytes\n" % (count)) 
    time.sleep(0.5)  
 
    ######################################################################################### 
    #Stream on CMD : 0x00AD DATA : 0x00C5 
    data_out_list_append = [] 
    for i in range(1, i2c_fifo_word_size * i2c_fifo_depth+1): 
        data_out_list_append.extend(int(0x00AD).to_bytes(2,byteorder="big")) 
        data_out_list_append.extend(int(0x00C5).to_bytes(2,byteorder="big")) 
 
    data_out = bytes(data_out_list_append) 
    print('I2C data written') 
    print(hexlify(data_out)) 
    count = i2cWrite(0x38, data_out)     
    print("Number of data bytes written: %2d bytes \n" % (count)) 
    time.sleep(0.5) 
    ######################################################################################### 

Metadata

Note: The embedded header is 128-bytes.

The following defines the data in the ADSD3500 output embedded data.

32-bit Word Index Name Bit-fields Additional Comments
0 Frame Characteristics 0:15 Width of the image
16:31 Height of the image
1 Use Case Details 0:7 Output Configuration
8:15 Bits in Depth/Phase
16:23 Bit in AB
24:31 Bits in Confidence
ADSD3500 Output Configuration:
0 Full Depth Frame
1 Phase Frame (Partial Depth)
2 AB Frame
3 Confidence Frame
4 Depth AB Interleaved
5 Phase and AB Interleaved
6 Phase, JBLF Confidence and AB Interleaved
7 Depth, Confidence and AB Interleaved

Bit in Depth/Phase:
8, 12 or 16 Based on use case

Bits in AB:
8, 12 or 16 Based on use case

Bits in Confidence:
4 or 8 Based on use case
2 Phase Frame Characteristics 0:15 Invalid Phase Value
16:23 Frequency Index
24:31 AB Frequency Index
In partial depth case, the host must know the invalid phase value used by the ADSD3500, which is used for invalidation during full depth compute.

Frequency Index: Stores index of the frequency for which the phase frame is outputted.

AB Frequency Index:
0 AB of frequency 0
1 AB of frequency 1
2 AB of frequency 2
3 AB Averaged
3 Frame Number 0:31 Frame Number The frame number, which is incremented per frame
4 Mode 0:7 Imager Mode
8:15 Number of Phases
16:23 Number of Frequencies
Imager Mode: The imager mode in use
Number of Phases: Number of phases in the input raw capture fed to the ADSD3500
Number of Frequencies: Number of frequencies in the input raw capture fed to the ADSD3500.
5 Elapsed Time Fractional Value 0:15 Lower 16-bit value
16:31 Upper 16-bit value
32-bit fractional value out of total elapsed time.
6 Elapsed Time Seconds Value 0:15 Lower 16-bit value
16:31 Upper 16-bit value
32-bit seconds value out of total elapsed time.
7 Sensor Temperature 0:31 Sensor Temperature Sensor temperature in degrees Celsius
8 Laser Temperature 0:31 Laser Temperature Laser temperature in degrees Celsius
resources/eval/user-guides/eval-adtf3175x-adsd3500.txt · Last modified: 28 Sep 2023 16:50 by Andre Straker-Payne