基于阶跃法的智能RLC电气参数测试仪 - 图文 下载本文

内容发布更新时间 : 2024/12/23 23:06:46星期一 下面是文章的全部内容请认真阅读。

西安交通大学城市学院本科生毕业设计(论文)

}

void timer1(void) interrupt 3 { }

void cafrequent(void) reentrant {

long int l1=0x00; long int h1=0x00;

float tt=0; //tt用于计算频率 TMOD=(TMOD&0x0F)|0x90; TH1=0x00; TL1=0x00; ET1=1; EA=1;

while(fw==1); TR1=1; while(fw==0); while(fw==1); TR1=0; l1=TL1; h1=TH1;

uu=h1*256+l1+inte*65536; inte=0;

tt=uu/(11.0592*1000000.0/12.0); ff=(unsigned long int)(1.0/tt); //频率值 }

void judgekey() {

long int R=0,C=0,L=0; cafrequent(); delay_5ms();

TL1=0x00; TH1=0x00;

40

附录

while(sr==0) {

if (srd==0) { //R=(6560000.0/(2.0*ff))-(330.0/2.0); R=(6906343.0/(2.0*ff))-(330.0/2.0); delay_5ms(); m=R/100000; delay_5ms(); w=(R/10000); delay_5ms(); q=(R/1000); delay_5ms(); b=(R/100);

delay_5ms(); s=(R/10); delay_5ms();

g=R;

}

else (srg==0) ; { R=((1000000.0/(0.693*0.01*ff))-20000.0)/2.0; delay_5ms(); m=R/100000; delay_5ms(); w=(R/10000); delay_5ms(); q=(R/1000); delay_5ms(); b=(R/100);

delay_5ms(); s=(R/10);

delay_5ms();

41

西安交通大学城市学院本科生毕业设计(论文)

g=R;

} }

while(sc==0) {

// C=2790000.0/ff;

C=3193333.0/ff; delay_5ms(); m=C/100000; delay_5ms(); w=(C/10000); delay_5ms(); q=(C/1000); delay_5ms(); b=(C/100); delay_5ms(); s=(C/10); delay_5ms(); g=C;

}

while(sl==0) {

L=38000000.0/(ff*ff);

delay_5ms(); m=L/100000; delay_5ms(); w=(L/10000); delay_5ms(); q=(L/1000); delay_5ms(); b=(L/100); delay_5ms(); s=(L/10); delay_5ms(); g=L;

42

附录

} while(1) {

display(m,1); delay_5ms(); display(w,2);

delay_5ms(); display(q,3); delay_5ms(); display(b,4); delay_5ms(); display(s,5); delay_5ms(); display(g,6); delay_5ms();

}

}

void main() {

judgekey(); }

43