Changeset 17627 for firmware


Ignore:
Timestamp:
Mar 18, 2014, 4:19:43 PM (5 years ago)
Author:
dneise
Message:
whitepace edit
File:
1 edited

Legend:

Unmodified
Added
Removed
  • firmware/FSC/src/atmega_adc.c

    r10910 r17627  
    55{
    66//ADC einschalten
    7         ADCSRA |= (1<<ADPS2) | (1<<ADPS1);     // ADC_clk = 125kHz
    8         ADCSRA &= ~(1<<ADPS0);
    9                 // normal conversion takes: 13 adc_clk cycles = 104us
    10                 // 1st conversion takes longer: 25 clk cycles = 200us
    11         ADCSRA |= 1<<ADATE; // autotrigger enable
    12         SFIOR &= ~(0xE0);               //ADTS=000 --> free running mode
    13         ADCSRA |= (1<<ADEN);                  // ADC aktivieren
     7    ADCSRA |= (1<<ADPS2) | (1<<ADPS1);     // ADC_clk = 125kHz
     8    ADCSRA &= ~(1<<ADPS0);
     9        // normal conversion takes: 13 adc_clk cycles = 104us
     10        // 1st conversion takes longer: 25 clk cycles = 200us
     11    ADCSRA |= 1<<ADATE; // autotrigger enable
     12    SFIOR &= ~(0xE0);           //ADTS=000 --> free running mode
     13    ADCSRA |= (1<<ADEN);                  // ADC aktivieren
    1414
    15         ADMUX &= ~(1<<REFS0);
    16         ADMUX &= ~(1<<REFS1);   //REFS = 00 --> use external reference voltage.
    17         //ADMUX |= 1<<ADLAR;            //ADLAR =1      --> left adjust ac result in ADCH register --> 8bit resolution only.                           
    18         ADMUX |= (0x1F & 0x06); //MUX = 0x06 --> Pin ADC6 = PA6 is used as ADC input pin.
    19        
    20         ADCSRA |= (1<<ADSC);    // start 1st conversion
     15    ADMUX &= ~(1<<REFS0);
     16    ADMUX &= ~(1<<REFS1);       //REFS = 00 --> use external reference voltage.
     17    //ADMUX |= 1<<ADLAR;                //ADLAR =1      --> left adjust ac result in ADCH register --> 8bit resolution only.                           
     18    ADMUX |= (0x1F & 0x06); //MUX = 0x06 --> Pin ADC6 = PA6 is used as ADC input pin.
     19
     20    ADCSRA |= (1<<ADSC);        // start 1st conversion
    2121
    2222}
Note: See TracChangeset for help on using the changeset viewer.