利用MAXQ7667确定超声传感器的谐振频率和阻尼特性

时间:2012-09-14来源:网络
; TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">  { // has not been set, then

  half_peak = STIM; // save the time it took to reach half the peak value.

  i = 101; // Half peak found so exit the loop.

  }

  while (T2CNB0_bit.TF2 == 0) {} // Wait for timer # 0.

  T2CNB0_bit.TF2 = 0; // Clear flag.

  }

  T2CNA0_bit.TR2 = 0; // Stop timer # 0.

  return half_peak;

  }

  void main()

  {

  unsigned short i = 0;

  unsigned short peak = 0;

  unsigned short first70 = 0;

  unsigned short second70 = 0;

  unsigned short center_pllf;

  unsigned short wait2measure;

  unsigned short halfpeak;

  init();

  // **********************************

  // **********************************

  // Configuration settings

  echo_receive_gain(0); // Set receiver to minimum gain (allowed values 0-31)

  Burst_Clock_Divider = 400; // for calculating the burst-frequency in PC-Application.

  burst_setup(BURST_CLK_PLL, BURST_PULSE_1, BURST_DIV_400, 0, PLL_CLOCK_16MHZ, 0);

  step_size=10; // Sets the step-size (steps go from 0 to 511).

  // END configuration settings.

  // ******************************

  // ******************************

  while(1)

1 2 3 4 5 6

关键词: MAXQ7667 超声传感器 谐振频率 阻尼特性

加入微信
获取电子行业最新资讯
搜索微信公众号:EEPW

或用微信扫描左侧二维码

相关文章

查看电脑版