+ Post New Thread
Results 1 to 2 of 2
  1. #1
    Advanced Member level 4
    Points: 12,536, Level: 26
    Achievements:
    Created Blog entry 7 years registered
    thannara123's Avatar
    Join Date
    Jan 2010
    Location
    Nedumkandam, India, India
    Posts
    1,431
    Helped
    118 / 118
    Points
    12,536
    Level
    26
    Blog Entries
    2

    ADSC not rest in avr32 (adc read problem

    I am trying to read ADC in atmeg 32 .Displaying the data to lcd to a vlot /ammeter project .
    my problem whenever simulate it on proteus it will hangup on the checking of ADSC conversion

    Code:
    /*
     * vmam.c
     *
     * Created: 14-Oct-15 6:44:15 PM
     *  Author: Krishna
     */ 
    #define F_CPU 16000000UL
    #include 
    #include
    #include"lcd.h"
    
    
    int main(void)
    {
       DDRD = 0xFF;
       int adc_value=0x00;
       char ch_sec =0;
       void adc_init();
       lcd_init();
       string("ADC Reading ");
       
       adc_value = read_adc(0);  // reading adc value
       LINE2
      lcd_data(adc_value+0x30);
       while(1);
    }

    adc.h file

    Code:
    /*
     * adc.c
     *
     * Created: 14-Oct-15 7:39:18 PM
     *  Author: Krishna
     */ 
    #include 
    #define F_CPU 16000000UL
    #include
    
    
    void adc_init()
    {
    ADMUX |= (REFS0); // AVcc with external capacitor at AREF
     // Set the ADC prescaler to 128 (i.e., 16MHz/128 = 125KHz)
     ADCSRA |= ( 1 << ADPS2 )|( 1 << ADPS1 ) | ( 1 << ADPS0 );
     ADCSRA |= ( 1 << ADEN ); // ADC ON    
     ADCSRA |= (1<
    
    the avr studio whole file and proteus simulation file attaching here
    https://www.edaboard.com/attachment....1&d=1444875677

    I Respect You

    •   AltAdvertisement

        
       

  2. #2
    Advanced Member level 4
    Points: 12,536, Level: 26
    Achievements:
    Created Blog entry 7 years registered
    thannara123's Avatar
    Join Date
    Jan 2010
    Location
    Nedumkandam, India, India
    Posts
    1,431
    Helped
    118 / 118
    Points
    12,536
    Level
    26
    Blog Entries
    2

    Re: ADSC not rest in avr32 (adc read problem

    is it proteus error ?

    - - - Updated - - -

    It corrected .any way thanks . the changes done as follows
    Added a header file #include "adc.h"
    function prototyped instead of function call so changed void adc_init();to adc_init();

    - - - Updated - - -

    and posted here the full projects http://circuits-collection.blogspot....dc-of-avr.html
    I Respect You



--[[ ]]--