QHYCCD

QHYCCD LOW LEVEL (1) USB PROTOCOL WHITE PAPER

QiuHY

  • *****
  • 5000
    • View Profile
    • Email
Re: QHYCCD LOW LEVEL (1) USB PROTOCOL WHITE PAPER
« Reply #15 on: February 23, 2017, 09:51:42 AM »
CCC=0XAB

not defined, maybe on camera guide port control
Qiu Hongyun

QiuHY

  • *****
  • 5000
    • View Profile
    • Email
Re: QHYCCD LOW LEVEL (1) USB PROTOCOL WHITE PAPER
« Reply #16 on: February 23, 2017, 09:52:32 AM »
CCC=0XAC

not defined, maybe temperature control
Qiu Hongyun

QiuHY

  • *****
  • 5000
    • View Profile
    • Email
Re: QHYCCD LOW LEVEL (1) USB PROTOCOL WHITE PAPER
« Reply #17 on: February 23, 2017, 09:54:14 AM »
CCC=0XAD

reserved
Qiu Hongyun

QiuHY

  • *****
  • 5000
    • View Profile
    • Email
Re: QHYCCD LOW LEVEL (1) USB PROTOCOL WHITE PAPER
« Reply #18 on: February 23, 2017, 09:54:40 AM »
CCC=0XAE

reserved
Qiu Hongyun

QiuHY

  • *****
  • 5000
    • View Profile
    • Email
Re: QHYCCD LOW LEVEL (1) USB PROTOCOL WHITE PAPER
« Reply #19 on: February 23, 2017, 09:55:10 AM »
CCC=0XAF

Temperature Control

CCP1:     Control Mode  1=Auto temperature regular loop  0=manual set the PWM (0-255) range
CCP2:     Target PWM value This value will be active when set control mode to manual control
CCP3:     Temperature unit select  0=degree  1=ADU unit  (QHY163 use the degree)
CCP4..5: Target temperature (0.1 degree unit)    This value will be active when set to CCP3=0, degree unit
CCP6..7: Target temperature (ADU unit)        This value will be active when set to CCP3=1, adu unit



*1. The temperature unit is 0.1C  for example:

set temp to +10C

CCP1     = 1
CCP3     = 0
CCP4..5 = 100


set temp to -10C

CCP1     = 1
CCP3     = 0
CCP4..5 = 65436   (65436 is -100 for signed integer)


use manual mode , set PWM = 12
CCP1     = 0
CCP2     = 12

Code: [Select]
void CCC_AF(bool isAuto,unsigned char targetPWM,unsigned char unit,double targetTempDegree,unsigned short targetTempADU){

unsigned char data[16];

signed short targetTempDegreex10_sign;
unsigned short targetTempDegreex10;


data[0]=0xaF;
if(isAuto==true) data[1]=1;
else             data[1]=0;

data[2]=targetPWM;
data[3]=unit;

targetTempDegreex10_sign=targetTempDegree*10;
if(targetTempDegreex10_sign>=0) targetTempDegreex10=targetTempDegreex10_sign;
else                            targetTempDegreex10=65536-abs(targetTempDegreex10_sign);


targetTempDegreex10_sign=targetTempDegreex10;

Form1->Caption =targetTempDegreex10_sign;

data[4]=MSB(targetTempDegreex10);
data[5]=LSB(targetTempDegreex10);

data[6]=MSB(targetTempADU);
data[7]=LSB(targetTempADU);

QHYCCDVendRequestWrite(g_hCam,0xd1,0x00,0x00,16,data);

}
« Last Edit: March 13, 2017, 11:34:57 AM by QiuHY »
Qiu Hongyun

QiuHY

  • *****
  • 5000
    • View Profile
    • Email
Re: QHYCCD LOW LEVEL (1) USB PROTOCOL WHITE PAPER
« Reply #20 on: February 23, 2017, 09:55:41 AM »
CCC=0XB0

reserved
Qiu Hongyun

QiuHY

  • *****
  • 5000
    • View Profile
    • Email
Re: QHYCCD LOW LEVEL (1) USB PROTOCOL WHITE PAPER
« Reply #21 on: February 23, 2017, 09:56:05 AM »
CCC=0XB1

reserved
Qiu Hongyun

QiuHY

  • *****
  • 5000
    • View Profile
    • Email
Re: QHYCCD LOW LEVEL (1) USB PROTOCOL WHITE PAPER
« Reply #22 on: February 23, 2017, 09:56:23 AM »
CCC=0XB3

reserved
Qiu Hongyun

QiuHY

  • *****
  • 5000
    • View Profile
    • Email
Re: QHYCCD LOW LEVEL (1) USB PROTOCOL WHITE PAPER
« Reply #23 on: February 23, 2017, 09:56:54 AM »
CCC=0XB4

reserved
Qiu Hongyun

QiuHY

  • *****
  • 5000
    • View Profile
    • Email
Re: QHYCCD LOW LEVEL (1) USB PROTOCOL WHITE PAPER
« Reply #24 on: February 23, 2017, 09:57:17 AM »
CCC=0XB5

reserved
Qiu Hongyun

QiuHY

  • *****
  • 5000
    • View Profile
    • Email
Re: QHYCCD LOW LEVEL (1) USB PROTOCOL WHITE PAPER
« Reply #25 on: February 23, 2017, 09:57:37 AM »
CCC=0XB6

reserved
Qiu Hongyun

QiuHY

  • *****
  • 5000
    • View Profile
    • Email
Re: QHYCCD LOW LEVEL (1) USB PROTOCOL WHITE PAPER
« Reply #26 on: February 23, 2017, 09:58:00 AM »
CCC=0XB7

reserved
Qiu Hongyun

QiuHY

  • *****
  • 5000
    • View Profile
    • Email
Re: QHYCCD LOW LEVEL (1) USB PROTOCOL WHITE PAPER
« Reply #27 on: February 23, 2017, 09:58:26 AM »
CCC=0XB8...BF

reserved
Qiu Hongyun

QiuHY

  • *****
  • 5000
    • View Profile
    • Email
Re: QHYCCD LOW LEVEL (1) USB PROTOCOL WHITE PAPER
« Reply #28 on: February 23, 2017, 10:06:00 AM »
VendRequest 0XD2


Vendrequest 0XD2 direction is IN. The host will get 64byte Camera Status Information(CSI) data from camera.

The data structure is :

CSI0      current sensor readout speed. For cmos camra the unit is MHz. for CCD camera it is not an accurate data. Normally the lowest speed is 0, normal speed is 1, high speed is 2
CSI1..4  the time left to exposure end, unit is microsec. ) CSI1=MSB  CSI4=LSB  QHY163 does not support this function
CSI5..8  the exposure time which had been set


CSI9   firmware version year
CSI10 firmware version month
CSI11 frimware version day

CS12 temperature readout unit. 0=support degree output   1=support ADU unit output  2=support both output

CSI13..14 current temperature, unit is 0.1 degree. signed short number
CSI15..16 target temperature,unit is 0.1 degree. signed short number
CSI17       current PWM value (0-255)
CSI18       current temperature controller working mode    1=automatic   0=manual set the pwm


CSI19..21  current DDR data value    CSI19=MSB CSI21=LSB 

CSI22..23  current temperature (ADU unit)
CSI24..25  target temperature (ADU unit)

CSI28..29 Image Size X
CSI30..31 Image Size Y

CSI32   Image bit depth.       0=8bit   1=16bit
CSI33   Current USB Speed.  1=usb1.1  2=usb2.0  3=usb3.0


CSI38..45  eight bytes CFW information buffer.  The camera has 8 bytes buffer to store the data received from the QHY color wheel. The data will not be updated till next CFW command sent to the camera.

CSI46 camera model index.    no used in QHY163
CSI47 sensor type  (monochrom, bayer RGB, wRGB etc)     0:mono    1: RGB   

CSI48...63 camera series number (16byte)


Code: [Select]
unsigned char c_firmware_year;
unsigned char c_firmware_month;
unsigned char c_firmware_day;

int c_data_in_ddr;
unsigned int c_expTime;
unsigned int c_expTime_toend;

unsigned char c_seriesNumber[16];
unsigned char c_cmosfreq;

unsigned char c_temp_unit;

short c_current_temp_degree;
short c_target_temp_degree;
unsigned short c_current_temp_adu;
unsigned short c_target_temp_adu;

unsigned char c_pwm;
unsigned char c_isAuto;

unsigned char c_camera_submodel;
unsigned char c_sensor_type;

unsigned short c_imageX;
unsigned short c_imageY;

unsigned char c_is16bit;
unsigned char c_usbspeed;



unsigned char c_uart[8];






unsigned int c_actual_expTime;


unsigned short index, value;
unsigned char data[64];

unsigned int length = 64;
index = 0;






QHYCCDVendRequestRead(g_hCam, 0xd2, 0, index, length, data);

debug_print_cls;

c_cmosfreq         =data[0];
c_expTime_toend=    data[1]*256*256*256+data[2]*256*256+data[3]*256+data[4];
c_expTime        =  data[5]*256*256*256+data[6]*256*256+data[7]*256+data[8];

c_firmware_year  =data[9];
c_firmware_month =data[10];
c_firmware_day   =data[11];




c_temp_unit=data[12];
c_current_temp_degree=data[13]*256+data[14];
c_target_temp_degree =data[15]*256+data[16];


c_pwm=data[17];
c_isAuto=data[18];

c_data_in_ddr=    data[19]*256*256+data[20]*256+data[21];


c_current_temp_adu=data[22]*256+data[23];
c_target_temp_adu =data[24]*256+data[25];


c_camera_submodel=data[46];
c_sensor_type=data[47];


c_imageX=data[28]*256+data[29];
c_imageY=data[30]*256+data[31];

c_is16bit=data[32];
c_usbspeed=data[33];



for(int i=0;i<16;i++){
c_seriesNumber[i]=data[48+i];
}

for(int i=0;i<8;i++){
c_uart[i]=data[38+i];
}

debug_print "cmos freq:     " + AnsiString(c_cmosfreq);
debug_print "exptime to end:" + AnsiString(c_expTime_toend);
debug_print "target exptime:" + AnsiString(c_expTime);
debug_print "firmware year: " + AnsiString(c_firmware_year);
debug_print "firmware month:" + AnsiString(c_firmware_month);
debug_print "firmware day:  " + AnsiString(c_firmware_day);
debug_print "data in ddr 2kb" +    AnsiString(c_data_in_ddr);
debug_print "temp unit:"      +    AnsiString(c_temp_unit);
debug_print "current temp degree"+ AnsiString((double)c_current_temp_degree/10);
debug_print "target temp degree" + AnsiString((double)c_target_temp_degree/10);
debug_print "current temp adu"+ AnsiString(c_current_temp_adu);
debug_print "target temp adu" + AnsiString(c_target_temp_adu);

debug_print "c_pwm:         " + AnsiString(c_pwm);
debug_print "c_isAuto:      " + AnsiString(c_isAuto);
debug_print "c_camera_submodel"+AnsiString(c_camera_submodel);
debug_print "c_sensor_type    "+AnsiString(c_sensor_type);

debug_print "imageX:        " + AnsiString(c_imageX);
debug_print "imageY:        " + AnsiString(c_imageY);
debug_print "is16BIT        " + AnsiString(c_is16bit);
debug_print "usb speed      " + AnsiString(c_usbspeed);


debug_print "CFW buffer 1st position " + char(c_uart[0]);


for(int i=0;i<8;i++){
   debug_print "UART"+AnsiString(i)+":"+AnsiString(c_uart[i]);
}

for(int i=0;i<16;i++){
  debug_print "GUID"+AnsiString(i)+":"+AnsiString(c_seriesNumber[i]);
}



« Last Edit: March 19, 2017, 06:15:31 AM by QiuHY »
Qiu Hongyun

QiuHY

  • *****
  • 5000
    • View Profile
    • Email
Re: QHYCCD LOW LEVEL (1) USB PROTOCOL WHITE PAPER
« Reply #29 on: February 27, 2017, 07:36:13 AM »
reserved
Qiu Hongyun