+ Post New Thread
Results 1 to 8 of 8
  1. #1
    Banned
    Points: 333, Level: 3

    Join Date
    Jul 2014
    Posts
    62
    Helped
    0 / 0
    Points
    333
    Level
    3

    atmega16/8 ADC-USART C code

    i need a c file to program my micro for A2D. I have 1 analog input and just ONE serial output please help me Fast

    •   AltAdvertisment

        
       

  2. #2
    Super Moderator
    Points: 69,659, Level: 64
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,229
    Helped
    3251 / 3251
    Points
    69,659
    Level
    64

    Re: atmega16/8 ADC-USART C code

    Hi,
    There are example codes in the avr datasheet and a huge ammount of threads in the forum and the internet.

    If you need something special, then you need to specify it.

    Asking for fast help, but giving no details is resulting in no answers..

    Klaus



    •   AltAdvertisment

        
       

  3. #3
    Banned
    Points: 333, Level: 3

    Join Date
    Jul 2014
    Posts
    62
    Helped
    0 / 0
    Points
    333
    Level
    3

    Re: atmega16/8 ADC-USART C code

    Quote Originally Posted by KlausST View Post
    Hi,
    There are example codes in the avr datasheet and a huge ammount of threads in the forum and the internet.

    If you need something special, then you need to specify it.

    Asking for fast help, but giving no details is resulting in no answers..

    Klaus
    I need something like this but it has to send serial data to just 1 output! i want to connect it to opto-coupler and then to PC (USB) .can u change the output to USART output PortB pin0?

    Code:
    #define F_CPU 16000000UL
    #include 
    #include 
    
    int main(void)
    {
    DDRA=0;
    //Declaring Port A as input
       
    DDRB=255;
    //Declaring port B as output
       
    ADCSRA|=(1<
    
    Last edited by alexan_e; 20th July 2014 at 14:35. Reason: added code tags



    •   AltAdvertisment

        
       

  4. #4
    Banned
    Points: 333, Level: 3

    Join Date
    Jul 2014
    Posts
    62
    Helped
    0 / 0
    Points
    333
    Level
    3

    How can I Connect my analog input to ATMEGA8 -> 6n137 -> USB

    I programmed A atmega8(ADC,USART) to send my EKG/ECG analog input into my PC to process.Do You Have any Idea how should I connect AVR and optocoupler Pins? For example Should I connect a RC circuit for RESET pin? how i should connect my Analog into Atmega8 pin? Which pins need +5 and which for GND? Help me PLease



  5. #5
    Super Moderator
    Points: 69,659, Level: 64
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,229
    Helped
    3251 / 3251
    Points
    69,659
    Level
    64

    Re: atmega16/8 ADC-USART C code

    Hi,

    again:
    Asking for fast help, but giving no details is resulting in no answers..
    Do You Have any Idea how should I connect AVR and optocoupler Pins?
    google for "atmega uart optocoupler"
    then decide what else you want to know.

    Should I connect a RC circuit for RESET pin?
    look into datasheet

    how i should connect my Analog into Atmega8 pin?
    We do not know:
    * what is your analog signal: Source, voltage, frequency...

    Which pins need +5 and which for GND?
    of what device?

    Klaus



  6. #6
    Banned
    Points: 333, Level: 3

    Join Date
    Jul 2014
    Posts
    62
    Helped
    0 / 0
    Points
    333
    Level
    3

    Re: atmega16/8 ADC-USART C code

    EKG signal of MY device.I GooGled it but there is no such thing.No data on datasheet that used ADC and USART together to an optocoupler then to USB



  7. #7
    Super Moderator
    Points: 251,591, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    43,812
    Helped
    13322 / 13322
    Points
    251,591
    Level
    100

    Re: atmega16/8 ADC-USART C code

    The ECG signal can be connected to AVR-ADC after being amplified to 5V. I presume you have a suitable preamplifier.

    Connecting "UART to optocoupler then to USB" is less clear. You need an USB interface chip like FT232 to connect UART to USB, maybe with optical isolation by an optocoupler.


    1 members found this post helpful.

    •   AltAdvertisment

        
       

  8. #8
    Banned
    Points: 333, Level: 3

    Join Date
    Jul 2014
    Posts
    62
    Helped
    0 / 0
    Points
    333
    Level
    3

    Re: atmega16/8 ADC-USART C code

    Quote Originally Posted by FvM View Post
    The ECG signal can be connected to AVR-ADC after being amplified to 5V. I presume you have a suitable preamplifier.

    Connecting "UART to optocoupler then to USB" is less clear. You need an USB interface chip like FT232 to connect UART to USB, maybe with optical isolation by an optocoupler.
    my signal amplified by 2 instrumental amps. Look at his work.I want something like this
    PHP Code:
    people.ece.cornell.edu/land/courses/ece4760/FinalProjects/s2012/cwm55/cwm55_mj294



--[[ ]]--