I performed the calibration of the fast analog inputs according the wiki manual
http://wiki.redpitaya.com/index.php?tit ... alibration
Unfortunately, the adjustment of the offset input parameters have no effect on my measured voltages.. I tested the measurement with following code - but independently of the set parameters, I am getting the same measurement values:
Code: Select all
int main(int argc, char **argv){
/* Print error, if rp_Init() function failed */
if(rp_Init() != RP_OK){
fprintf(stderr, "Rp api init failed!\n");
}
uint32_t buff_size = 16384;
float *buffV = (float *)malloc(buff_size * sizeof(float));
int16_t *buffRaw = (int16_t *)malloc(buff_size * sizeof(int16_t));
rp_AcqReset();
rp_AcqSetDecimation(RP_DEC_8);
rp_AcqSetTriggerLevel(0.1); //Trig level is set in Volts while in SCPI
rp_AcqSetTriggerDelay(0);
rp_AcqStart();
/* After acquisition is started some time delay is needed in order to acquire fresh samples in to buffer*/
/* Here we have used time delay of one second but you can calculate exact value taking in to account buffer*/
/*length and smaling rate*/
sleep(1);
rp_AcqSetGain (RP_CH_1, RP_HIGH);
rp_AcqSetGain (RP_CH_2, RP_HIGH);
rp_AcqSetTriggerSrc(RP_TRIG_SRC_NOW);
rp_acq_trig_state_t state = RP_TRIG_STATE_TRIGGERED;
while(1){
rp_AcqGetTriggerState(&state);
if(state == RP_TRIG_STATE_TRIGGERED){
sleep(1);
break;
}
}
rp_AcqGetOldestDataV(RP_CH_2, &buff_size, buffV);
rp_AcqGetOldestDataRaw(RP_CH_2, &buff_size, buffRaw);
int i;
for(i = 0; i < 50; i++){
printf("%i %f\n", buffRaw[i], buffV[i]);
}
/* Releasing resources */
free(buffRaw);
free(buffV);
rp_Release();
return 0;
}
Code: Select all
redpitaya> calib -r -v
FE_CH1_FS_G_HI = 42949672
FE_CH2_FS_G_HI = 42949672
FE_CH1_FS_G_LO = 858993459
FE_CH2_FS_G_LO = 858993459
FE_CH1_DC_offs = 91
FE_CH2_DC_offs = 90
BE_CH1_FS = 42949672
BE_CH2_FS = 42949672
BE_CH1_DC_offs = 0
BE_CH2_DC_offs = 0
Stefan