參數(shù)資料
型號: 30770
廠商: Dresden Elektronik
文件頁數(shù): 46/74頁
文件大小: 2001K
描述: SET DERFNODE FOR AVR HOUSING
標準包裝: 1
User Manual
Version 1.1
2011-07-15
 
  deRFnode and deRFgateway
 
 
 
 
dresden elektronik
ingenieurtechnik gmbh
Enno-Heidebroek-Str. 12
12 7 Dr
n
rm  n
Tel.: +49 351  31 85 00
Fax: +49 351  3 18 50 10
wireless@dresden-elektronik.de
www. r
n- l k r nik.
Page 46 of 56
 
For AVR MCUs, an equivalent code snippet is:
 
#define VREF 1.6      // reference voltage; either 1.6 or 3.3 [V] 
 
uint16_t adc_val;     // ADC measurement value 
double v_bat;         // real battery voltage 
double c ;            // conversion factor 
 
c = ((double)(1040/(double)220)) * VREF;
 
#if (VREF==1.6) 
  // Select internal 1.6V reference voltage, left AVDREF pin open
  ADMUX = (1 << REFS1) | (1 << REFS0);
#else  
  // External reference voltage on AVDREF pin, selected by default 
#endif 
 
// Analog channel (0) and gain selection (none) <-> MUX5:0 = 0b00000  
// -> no changes required 
 
// select prescaler for 500 kHz frequency 
#if (F_CPU == (16000000UL)) 
  ADCSRA |= (1 << ADPS2) | (1 <// Prescaler = 32
#elif (F_CPU == (8000000UL)) 
  ADCSRA |= (1 << ADPS2); // Prescaler = 16
#elif (F_CPU == (4000000UL)) 
  ADCSRA |= (1 << ADPS1) | (1 << ADPS0); // Prescaler = 8
#elif (F_CPU == (1000000UL)) 
  ADCSRA |= (1 << ADPS0); // Prescaler = 2
#else 
  #error "unsupported F_CPU"
#endif 
 
// put into free running mode (ADTS2:0 = 0b000) -> no changes required 
 
// enable ADC 
ADCSRA |= (1 << ADEN);
 
// Start Conversion, Clear ADIF 
ADCSRA |= (1 << ADSC);
 
// wait for completion 
while (!(ADCSRA & (1 << ADIF))) ; 
 
// get measurement 
adc_val = ADC;
 
// disable ADC 
ADCSRA &= ~(1 << ADEN);
 
// convert to real battery voltage (mv) 
v_bat = c * adc_val; 
相關(guān)PDF資料
PDF描述
3700BL15B100E BALUN CERAMIC CHIP WIMAX 3.7GHZ
4000BL14U100T BALUN CERAMIC CHIP UWB 4GHZ
4391-93 ATTENUATOR BNC MALE/FMALE 93 OHM
4432-T-B1 B 915 KIT DEV TEST EZRADIOPRO SI4432
5250AT43A200E ANTENNA CHIP 5.25GHZ WIFI
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
3077-0-00-01-00-00-33-0 制造商:Mill-Max Mfg Corp 功能描述:
30770001 制造商: 功能描述: 制造商:undefined 功能描述:
3077-0-00-15-00-00030 制造商:Mill-Max Mfg Corp 功能描述:3077 DOUBLE TAIL HEADER PIN
307706 制造商:Weidmuller 功能描述:WBP-1/2IN NPT,STOPPING PLUG, -EA - Bulk
307707 制造商:Weidmuller 功能描述:WBP-3/4IN NPT,STOPPING PLUG, -EA - Bulk