EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / Interfacing ESP8266 with an ATmega16/32

Interfacing ESP8266 with an ATmega16/32

|

Microcontroller › AVR › Interfacing ESP8266 with an ATmega16/32

  • This topic has 5 replies, 4 voices, and was last updated 7 years, 8 months ago by Ashutosh Bhatt.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • April 24, 2016 at 12:31 am #4430
    Pranav Sewpersad
    Participant
    Hello guys 
    I am in desperate need of help with interfacing the esp8266 with an avr microcontroller. I have learnt how to use the esp8266 with a terminal software via a usb to serial module where i can set it up as a sever, connect devices to the module and communicate using the AT commands. I also setup the microcontroller to communicate via usart (with the specs needed to communicate with the wifi ,module) and was tested using hyperteminal. When I am sending the AT commands as strings to the module from the microcontroller nothing is happening(the module should send back "OK" or ERROR. How do I go about sending the AT commands to the wifi module from the micro? I have uploaded the code i am testing with below
     
     
     
    /*
     * Uart9600TxRx.c
     *
     * Created: 4/20/2016 1:09:32 AM
     *  Author: Pranav
     */ 
     
     
    //Uart working for bytes at baud of 9600 Tx and Rx
     
    #include <avr/io.h>
    #include <avr/interrupt.h>
    #include <util/delay.h>
    #include <string.h>
    #ifndef F_CPU
    #define F_CPU 16000000
    #endif
    volatile char rec;
     
    void usart_msg(char *c)
    {
    while (*c != 0)                     //— Check for null
    UartTx(*c++);                 //— Increment the pointer
    }
    void Usart_Init(){
    UCSRB = (1 << RXEN ) | (1 << TXEN );
    UCSRC = (1 << URSEL ) | (1 << UCSZ0 ) | (1 << UCSZ1 );
    UBRRL = 103 ;
    UBRRH=0;
    UCSRB |= (1 << RXCIE );
     
    }
    void UartTx(char send){
    UDR=send;
    while (!(UCSRA & (1<<UDRE)));
    }
    int main(void)
    {
    Usart_Init();
    DDRC=0XFF;
    DDRB=0x00;
    PORTB=0xFF;
    sei();
    char send;
    //int x=0;
    //SOME AT COMMANDS TO SETUP THE ESP8266 AS A SEVER
    usart_msg("AT");
    usart_msg("AT+CIPMUX=1");
    usart_msg("AT+CIPSEVER=1,1003");
     
    while(1)
    {
     
     
    }
    }
    ISR (USART_RXC_vect){
    //char Rec;
    //PORTC=0xFF;
    _delay_ms(1000);
    if(UDR=='O'){
    PORTC=0xFF;
    }
    rec=UDR;
    //UDR=rec;
    //return(rec);
    }
     

     

    April 24, 2016 at 8:41 am #13889
    Ashutosh Bhatt
    Participant

    thr may be problem with baud rate. try to set exact baud rate between AVR uC and ESP8266

    September 24, 2017 at 5:27 pm #14664
    Anonymous
    Guest

    Hey, am sorry couldnt find the solution to it. But i need a little help. I am actually working on a project which includes use of esp8266. i am confused abt how i start.. please guide me if possible. Like how to interface esp8266 with microcontroller (i am using atmega328p). Wanna know the concepts and the other hardware if required. like do i need to even program esp along with atmega? 

    September 25, 2017 at 9:23 am #14665
    Ashutosh Bhatt
    Participant

    first connect ESP8266 with PC / laptop through serial to USB converter and test it with AT commands through PC

    September 25, 2017 at 12:56 pm #14667
    bivash
    Participant

    I am also gatting same problem and already I checked with pc, Its worki

    October 19, 2017 at 1:17 pm #14673
    Ashutosh Bhatt
    Participant

    even I am having problem with ESP8266. it does not respond to direct AT commands given through PC

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Fixing board, Easy question HEX SCHMITT July 9, 2025
  • Can I make two inputs from one?? July 9, 2025
  • The Analog Gods Hate Me July 9, 2025
  • How to make string LEDs? July 9, 2025
  • It's Amazing What A Buck And A Quarter.... July 8, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise