pattern generator produces binary file as well; adc clock frequency can be changed as well as run clock frequency

This commit is contained in:
2014-11-25 11:38:19 +01:00
parent 327c2106df
commit d10335e4a9
17 changed files with 1640 additions and 769 deletions

View File

@ -4,6 +4,7 @@ if [ "$#" -eq 0 ]; then
fi
infile=$1
outfile=$infile"at"
outfilebin=$infile"bin"
if [ "$#" -ge 2 ]; then
outfile=$2
fi
@ -14,7 +15,7 @@ fi
if [ -f "$infile" ]
then
gcc -DINFILE="\"$infile\"" -DOUTFILE="\"$outfile\"" -o $exe generator.c ; ./$exe ; rm $exe
gcc -DINFILE="\"$infile\"" -DOUTFILE="\"$outfile\"" -DOUTFILEBIN="\"$outfilebin\"" -o $exe generator.c ; ./$exe ; rm $exe
else
echo "$infile not found."
fi

View File

@ -43,7 +43,9 @@ int nloop[3]={0,0,0};
char infile[10000], outfile[10000];
FILE *fd;
FILE *fd, *fd1;
uint64_t PAT[MAXWORDS];
int i,ii,iii,j,jj,jjj,pixx,pixy,memx,memy,muxout,memclk,colclk,rowclk,muxclk,memcol,memrow,loopcounter;
//int W[33];
@ -129,18 +131,22 @@ void setwaittime(int iloop, uint64_t t) {
void pw(){
if (iaddr<MAXWORDS)
PAT[iaddr]= pat;
fprintf(fd,"patword %04x %016llx\n",iaddr, pat);
iaddr++;
if (iaddr>=MAXWORDS) printf("ERROR: too many word in the pattern (%d instead of %d)!",iaddr, MAXWORDS);
}
main(void) {
int iloop=0;
fd=fopen(OUTFILE,"w");
#include INFILE
fprintf(fd,"patctrl %016llx\n",iopat);
fprintf(fd,"patioctrl %016llx\n",iopat);
fprintf(fd,"patclkctrl %016llx\n",clkpat);
fprintf(fd,"patlimits %04x %04x\n",start, stop);
@ -157,4 +163,7 @@ main(void) {
}
close((int)fd);
fd1=fopen(OUTFILEBIN,"w");
fwrite(PAT,sizeof(uint64_t),iaddr, fd1);
close((int)fd1);
}

View File

@ -85,7 +85,7 @@ setoutput(adc_ena);
setclk(CLKBIT);
#define adc_sync 19
#define adc_sync 63
setoutput(adc_sync);