Tuesday, August 26, 2014

Recent Posts 4 - Input / Output: FTM (PWM output, pulse count) 2014/08/13 3 - Input / Output: ADC (


Gyroscope ENC03 to read for example. Initialization / ************************************** *********************************** * Function Name: ADdevice_init * Function Description: AD device initialization function * Parameter Description: * Function Returns: None * Modified: 2012-2-14 * Note: initialize AD channel ************************* needed ************************************************ / void ADdevice_init () {// ENC 03 initialization PE3 adc_init (ENC_AD, ENC_X_CH);}
Below the voltage value of the gyro read AD30 times the average is stored in a global variable gyro_stand_voltage. / ************************************************* ************************ * Function Name: gyro_init * Function: duty free sydney airport The initial acquisition gyroscope bias value * Parameter Description: * Function Returns: None * Modified: 2014-3-15 * Note: just boot time, AD reading may be unstable, and then reading the first delay 2s. Fat barbecued ************************************************ ************************* / void gyro_init () {delayms (2000); gyro_stand_voltage = ad_ave (ENC_AD, ENC_X_CH, duty free sydney airport ADBITS, 30); / / vertical gyro zero bias 12bits 2000 400} XS128
To read an example gyroscope ENC03 initialization void ADC_Init (void) {ATD0CTL1 = 0b00100000;. // 10-bit precision, before sampling does not discharge, AN0 as trigger source ATD0CTL2 = 0b01000000; // flag is automatically cleared, disable external triggered interrupts disabled ATD0CTL3 = 0b10001000; // right-justified unsigned, each a sequence of conversion, No FIFO ATD0CTL4 = 0b01000100; // sampling time is 8 ATDClock //ATDClock=[BusClock*0.5]/[PRS+1 ] = 80M / 2 / (4 + 1) = 8M ATD0CTL5 = 0b00000000; // special channel disabled, single-channel sampling, single-channel conversion ATD0DIEN = 0b00000000; // disable the digital input}
The following code references duty free sydney airport the big Yang / ****************************************** ******************************* * Freescale smart car program upright walking routines * File name: [ENC03.c ] * Description: * Design gyro settings: snowwolf * Email: snowwolf2012@qq.com * Note: *************************** ********************************************* / #include "Includes .h "#include" ENC03.h "int ReadATD (unsigned char channel) // read the 01-channel AD {ATD0CTL5 duty free sydney airport = channel; while (ATD0STAT0_SCF!); return ATD0DR0;} duty free sydney airport int GetOffset () {char i, j; unsigned long temp = 0; // GYRO1 for (j = 0; j <100; j ++) // collected 100 {for (i = 0; i <31; i ++) // collected 31 times temp + = ReadATD (CHANNEL_GYRO ); Delay_ms (5); // 20ms} temp / = 64; GYRO_Vol = temp / 100.0; // reference voltage 4.96V, 496/1023/31/100 = / 6400 GYRO_Vol_Offset = GYRO_Vol; return 0;}
Categories open class MOOCs Scala image and video processing Image and Video Processing Travel duty free sydney airport Traveling Nepal Travel Travel to Nepal Unclassified movie Movie Experience Experience Computer Computer Android Development C ++ MC9S12XS128 VBA Assembly Language Assembly Language Online Network for catering and entertainment Delicacy Freescale smart car Freescale Intelligent Car
Recent Posts 4 - Input / Output: FTM (PWM output, pulse count) 2014/08/13 3 - Input / Output: ADC (analog to digital converter) 2014/08/12 2 - Input / Output: duty free sydney airport GPIO 2014/08/11 1 - tracing vehicle control and design ideas 2014/08/11 Ubuntu14.04 64bit install duty free sydney airport Android-Studio 2014/08/09 2014/08/06 smart car after the game casually duty free sydney airport stroll review: Yan'an 2014/07/26 Archives 2014 August July 2014 June 2014 May 2014 April 2014 March 2014 February 2014 January 2014 December 2013 November 2013 October 2013 September 2013 2013 August July 2013
8086 C ++ Coursera dosbox Excel Freescale Google LCC MGF nepal SJW SZX VBA vhdl Chinese tourists the whole arrangement of geometric distribution Kathmandu Beijing University of Posts and Telecommunications Technology Building, National Taiwan University, duty free sydney airport Xi Tai Fung Seafood Restaurant International Roaming image processing duty free sydney airport Nepal and Brazil manual stapling Lhasa exponential distribution derived the data processing tea probability class motto camphor Wood compilation Tsinghua roaming tariffs movie gourmet Xining Qinghai-Tibet Plateau Qinghai-Tibet Railway in Hong Kong to resolve duty free sydney airport the nest is proudly duty free sydney airport powered by WordPress

No comments:

Post a Comment