单片机类毕业设计外文翻译内容摘要:
0, 3, ADC_CTL_CH1)。 ADCSequenceStepConfigure(ADC_BASE, 0, 4, ADC_CTL_CH1)。 ADCSequenceStepConfigure(ADC_BASE, 0, 5, ADC_CTL_CH1)。 ADCSequenceStepConfigure(ADC_BASE, 0, 6, ADC_CTL_CH1)。 ADCSequenceStepConfigure(ADC_BASE, 0, 7, (ADC_CTL_CH1 | ADC_CTL_END))。 // // Configure sequence steps for sequencer 1 // ADCSequenceStepConfigure(ADC_BASE, 1, 0, ADC_CTL_CH1)。 ADCSequenceStepConfigure(ADC_BASE, 1, 1, ADC_CTL_CH1)。 ADCSequenceStepConfigure(ADC_BASE, 1, 2, ADC_CTL_CH1)。 ADCSequenceStepConfigure(ADC_BASE, 1, 3, (ADC_CTL_CH1 | ADC_CTL_END))。 // // Configure sequence steps for sequencer 2 // ADCSequenceStepConfigure(ADC_BASE, 2, 0, ADC_CTL_CH1)。 ADCSequenceStepConfigure(ADC_BASE, 2, 1, ADC_CTL_CH1)。 ADCSequenceStepConfigure(ADC_BASE, 2, 2, ADC_CTL_CH1)。 ADCSequenceStepConfigure(ADC_BASE, 2, 3, (ADC_CTL_CH1 | ADC_CTL_IE \ | ADC_CTL_END))。 In Code Segment , the interrupt handler must gather the data from the FIFOs and perform the averaging calculation. The ADC Sequence Data Get function is not used here since the desired results are obtained without having to deal with the function overhead, so direct register reads are used to empty the sequencer FIFOs. Using ADC Sequence Data Get requires the function to define an extra 8entry sample buffer. Even with direct register reads, there is still putational overhead from the sum and average calculations performed in the interrupt handler. Code Segment . ADC Interrupt Handler void ADCIntHandler(void) { unsigned long ulIdx。 unsigned long ulSum = 0。 // // Clear the interrupt // ADCIntClear(ADC_BASE, 2)。 // // Get the data from sequencer 0 // for(ulIdx = 8。 ulIdx。 ulIdx) 9 { ulSum += HWREG(ADC_BASE + ADC_O_SSFIFO0)。 } // // Get the data from sequencers 1 and 2 // for(ulIdx = 4。 ulIdx。 ulIdx) { ulSum += HWREG(ADC_BASE + ADC_O_SSFIFO1)。 ulSum += HWREG(ADC_BASE + ADC_O_SSFIFO2)。 } // // Average the oversampled data // g_ulAverage = ulSum 4。 // // Placeholder for ADC processing code // } Before initiating the conversion process, the sample sequencers and interrupts are enabled (see Code Segment ). Code Segment . Enabling the ADC and Interrupts // // Enable the sequencers and interrupt // ADCSequenceEnable(ADC_BASE, 0)。 ADCSequenceEnable(ADC_BASE, 1)。 ADCSequenceEnable(ADC_BASE, 2)。 ADCIntEnable(ADC_BASE, 2)。 IntEnable(INT_ADC2)。 // // Enable the timer and start conversion process // TimerEnable(TIMER0_BASE, TIMER_A)。 Example 3. 16x Oversampling Using a Timer Running at fOS Another way to over sample (without consuming a large portion of the ADC sequencer resources) is by using a periodic timer that runs at the over sampling frequency. For example, if a conversion must be returned to the main application every 10 ms and is to be over sampled by 16, a timer can be configured to take a single sample every 625 μs. Having the timer trigger a conversion at the over sampling frequency obviously generates additional ADC interrupt traffic, which must 10 be accounted for in the application. The code that configures the ADC and timer to operate like this is shown in Code Segment . Code Segment . ADC Configuration – Timer Running at fOS // // Initialize the ADC to take a single sample on channel 1, sequencer 3 // when a trigger is detected. // ADCSequenceConfigure(ADC_BASE, 3, ADC_TRIGGER_TIMER, 0)。 ADCSequenceStepConfigure(ADC_BASE, 3, 0, (ADC_CTL_CH1 | ADC_CTL_IE \ | ADC_CTL_END))。 // // Initialize Timer 0 to trigger an ADC conversion once every 625 microseconds // TimerConfigure(TIMER0_BASE, TIMER_CFG_32_BIT_PER)。 TimerLoadSet(TIMER0_BASE, TIMER_A, SysCtlClockGet() / 1600)。 TimerControlTrigger(TIMER0_BASE, TIMER_A, true)。 Now that the ADC is sampling at the over sampling frequency, the interrupt handler must keep track of the number of samples taken and the overall sum (see Code Segment ). When 16 conversions have been accumulated, the averaging is performed and the global sample count and sum variables are cleared. Code Segment . ADC Interrupt Handler void ADCIntHandler(void) { // // Clear the interrupt // ADCIntClear(ADC_BASE, 3)。 // // Add the new sample to the global sum // g_ulSum += HWREG(ADC_BASE + ADC_O_SSFIFO3)。 // // Increment g_ucOversampleCnt // g_ucOversampleCnt++。 // // If 16 samples have accumulated, average them and reset globals // if(g_ucOversampleCnt == 16) { 11 g_ulAverage = g_ulSum 4。 g_ucOversampleCnt = 0。 g_ulSum = 0。 } // // Placeholder for ADC processing code // } Finally, before enabling the timer, sequencer 3 and its interrupt are enabled, and the global counter and sum variables are cleared (see Code Segment ). Code Segment . Enabling the ADC, Interrupts and Global Variables // // Enable the sequencer and interrupt // ADCSequenceEnable(ADC_BASE, 3)。 ADCIntEnable(ADC_BASE, 3)。 IntEnable(INT_ADC3)。 // // Zero the oversample counter and the sum // g_ucOversampleCnt = 0。 g_ulSum = 0。 // // Enable the timer and start conversion process // TimerEnable(TIMER0_BASE, TIMER_A)。 Over sampling Using a Rolling Average The rolling average approach is useful in situations where the sampling frequency is closer to the maximum sample rate of the ADC. The main ponent of a rolling average application is the sample buffer, which drops/adds data each time a conversion pletes. In Example 4, the ADC is configured to sample once every 100 μs,。单片机类毕业设计外文翻译
相关推荐
al with about 1 mW. This means that the crystal itself should be specified to perform proper resonation when it is driven at this power level. This crystal parameter is called the drive level and it
)( m= 由表 取标准模数 m= d1=mz1=25mm= d2=mz2=100=250mm b2= dd1=1= 经圆整后取 b2=65mm b1=b2+5mm=70mm a= m( z1+z2) =( 25+100) = 由式( )得出 σF,如 σF≤【 σF】则校核合格确定有关系与参数: ( 1)、齿形系数 YF 查表 得 YF1= , YF2= ( 2)
....... 62 、卫生措施 ....................................................................................... 62 ...........................................................................................
整 时间月调整 时间年调整 显示周 显示日 显示月 显示年 时间显示 时间显示主界面 四川信息职业技术学院毕业设计说明书 (论文 ) 第 13 页 LCD 的初始化与及 显示 程序 1 LCD 的初始化 void ini()/*LCD 的初始化 函数 { rw=0。 en=0。 P1=0xff。 writeCG()。 write_order(0x38)。 /*端口写入
的露营休闲旅游市场 繁荣。 根据国际露营协会及各国露营协会统计数据,美国现有房车 850 万辆,欧洲 540 万辆,加拿大80 万辆,南非 11 万辆,澳大利亚 40 万辆,德国 150 万辆。 在亚洲,日本也有 6 万辆,而中国只有 3 千多辆。 国外的露营地情况是:欧洲不同等级的露营地大约 26000 个,美国 17000 个,澳大利亚 3000 个,蒙古 118 个,日本 1500 个
治、文化、信息中心 ,市委、市政府及市直属机关90%设在该区内 ,是武汉商贸的重要组成部分。 这里汇集有武商、武广、中百、沃尔玛等国内国际知名的零售企业。 著名的国家级汉正街小商品市场 ,有 30 多个室内专业市场 ,经营 6 万余种商品 ,日均客流量 20 万人次 ,年销售额 180 亿元 ,占全市批发零售总额的 %。 深厚的商业 文化底蕴、独特的区位优势、巨大的消费市场、良好的经营氛围