4 TEST DATA…………………………………………………………………………7
INSTRUMENT DEVELOPMENT LABORATORY
UNIVERSITY OF HAWAII MANOA
DALIREVB
TECHNICAL NOTES
[pic]
By
Mavourneen Wilcox
INSTRUMENT DEVELOPMENT LABORATORY
DALIREVB Users Manual
06/17/04
Manoa, Hawaii phys.hawaii.edu/~idlab Technical questions: idlab.phys.hawaii.edu
TABLE of CONTENTS
1. C-PROGRAM VERSION 11………………………………………………………3
2. DALIREVB Gui Code Version 11…………………………………...…………..13
3. FIRMWARE DALIREVB_SALTY_BUSY..........……………………………….19
4. FIRMWARE DALIREVB_SALTY……………………………………………….28
1 DALIREVB Code Version 11
//////////////////////////////////////////////////////////////
// File - dalib_v11.c
//
// Initial code was generated by DriverWizard v6.03 - .
// The library accesses the hardware via WinDriver functions.
//
// Version 01 for testing the DALI Rev. B board
// Version 02 implements automatic register set and trigger holdoff
// Version 03 toy version for 1050MHz play
// Version 04 for read1out speed evaluation
// Version 05 version for interface with Pyhton
// Version 06 has pedestal sub. for dalib_b3,b4,b1,b5
// calib1,2,3,4 respectively. This version also allows for
// multi board read out
// Version 07 adding
// Version 11 writes data to a time stampped file. Has problem when interfacing with GUI... PM
////////////////////////////////////////////////////////////////
#include
#include "testapp_lib.h"
#include "samples/shared/pci_diag_lib.h"
#include
#include "include/status_strings.h"
#include
#include "dalib.h"
//global cal1
struct PCIData ave_sca;
// Driver handle passed between routines
//TESTAPP_HANDLE hTESTAPP=NULL;
TESTAPP_HANDLE hTESTAPPm[BOARD_MAX];
// input command from user
static char line[256];
int cards;
float corr2[SCA_MAX];
float correction2;
struct timeb start_all_time,error_time;
struct timeb trigger_time;
int first_error=1;
int setup(){
DWORD dwOffset=0x54; // GPIOC address offset
DWORD dwVal;
HANDLE hWD;
int i,xxx,sca,chan,chip;
FILE *fp99,*fp;
int sca_a;
//get the beginning time
ftime (&start_all_time);
printf("Start time is %d \n",&start_all_time.time);
// Make sure WinDriver is loaded
if (!PCI_Get_WD_handle(&hWD))
return 0;
WD_Close (hWD);
cards= TESTAPP_CountCards (VENDOR_ID, DEVICE_ID);
printf("Found %u matching PCI cards\n", (UINT)cards);
for(i=0;idata[244][chan][chip][board]=0;
// D->data[243][chan][chip][board]=0;
}
}
return (start_err || stop_err);
}
void readData(struct PCIData *D){
int sca,chip,chan;
DWORD dwOffset=0x54; // GPIOC address offset
DWORD dwVal;
int i,xxx,readOK=0;
char filename[1024];
FILE *outFp;
// Loop that waits for the trigger (temporary?)
//printf("Waiting for trigger\n");
dwVal = 0x00000000;
while(!((dwVal & 0x00000800)==0x00000800)) // EoE
{
dwVal = TESTAPP_ReadDword(hTESTAPPm[0], 0, dwOffset);
if (DALIDEBUG>=2) printf("GPIOC Register set to: %x\n",dwVal);
}
ftime(&trigger_time);
for(i=0;idata,sizeof(int),SCA_MAX*CHAN_MAX*CHIP_MAX*BOARD_MAX,outFp)!=SCA_MAX*CHAN_MAX*CHIP_MAX*BOARD_MAX) */
/* printf("Error writing to a file file %s.\n",filename); */
/* fclose(outFp); */
/* } */
}
TESTAPP_HANDLE TESTAPP_LocateAndOpenBoard(DWORD dwVendorID, DWORD dwDeviceID)
{
DWORD cards, my_card;
TESTAPP_HANDLE hTESTAPP = NULL;
if (dwVendorID==0)
{
printf ("Enter VendorID: ");
fgets(line, sizeof(line), stdin);
sscanf (line, "%x",&dwVendorID);
if (dwVendorID==0) return NULL;
printf ("Enter DeviceID: ");
fgets(line, sizeof(line), stdin);
sscanf (line, "%x",&dwDeviceID);
}
cards = TESTAPP_CountCards (dwVendorID, dwDeviceID);
if (cards==0)
{
printf ("%s", TESTAPP_ErrorString);
return NULL;
}
else if (cards==1)
my_card = 1;
else
{
UINT i;
if (DALIDEBUG) printf ("Found %u matching PCI cards\n", (UINT)cards);
if (DALIDEBUG) printf ("Select card (1-%u): ", (UINT)cards);
i = 0;
fgets(line, sizeof(line), stdin);
sscanf (line, "%d",&i);
if (i>=1 && i ................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.