Interfacing ESP8266 with Atmega32

Go To Last Post
25 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Please help me with interfacing atmega32 with esp8266.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There's an open issue to add a terminal server (serial port server) to ESP8266.

Alternatively, ESP32 (ESP8266 follow on) can run MicroPython; then, use pySerial to get to the mega32.

Would need to connect a TCP socket or WebSocket to pySerial; that's relatively simple.

But ... MicroPython has been ported to ESP8266 and there's a tutorial on ESP8266 I2C (so TWI to mega32)

 


https://github.com/chilipeppr/serial-port-json-server/issues/4

Lightweight port to ESP-8266? #4

by JamesNewton

Apr 2, 2016

http://micropython.org/ 

http://docs.platformio.org/en/latest/platforms/espressif32.html#frameworks

...

Pumbaa is Python on top of Simba

...

http://pythonhosted.org/pyserial/

https://pypi.python.org/pypi/websockets

Adafruit Learning System

MicroPython Hardware: I2C Devices

https://learn.adafruit.com/micropython-hardware-i2c-devices?view=all

...

 

https://learn.adafruit.com/micropython-hardware-i2c-devices?view=all#hardware

...

ESP8266 board running MicroPython, ...

...

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

That's a broad question. If you Google esp8266 arduino

Then the same techniques apply.
Remember - we have no idea of what you want to achieve so you need to tell us.
In terms of the hardware interface, there are three wires. The software side is a bit more involved. So do some Googling and see what you find.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am not using arduino. I am using avr studio 4 and gcc compiler. I just getting started. i want to know HOW TO INTERFACE AVR ATMEGA32 WITH ESP8266. I need help in hardware interface and sample code.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mega32 is an AVR. No surprise, perhaps, so is Meta328 which is the core of an Arduino. They are quite similar. Sure, you would not use the wire library and the pin access functions. But, other than those details, it is VERY similar.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

All ESP8266 modules are 3.3V
You can communicate from a mega32 if you run the AVR at 3.3V
You can use whatever protocol you like e.g. UART Serial, SPI, I2C, ...
SPI is probably the easiest interface.
.
You can add an ESP8266 core to Arduino. Then many Arduino sketches and libraries will work straight out of the box.
.
David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Google esp8266 arduino - Then the same techniques apply.
 

Hari_22 wrote:
I am not using arduino.

So??

 

As Kartman said, the techniques are the same - whether you use arduino or not.

 

I am using avr studio 4 and gcc compiler. I just getting started.

Any particular reason for getting started with such an old version?

 

Surely, Arduino is an ideal platform for getting started?

 

Also, TCP/IP networking seems a bit advanced for a beginners project.

 

For beginner's getting started steps, see: http://www.avrfreaks.net/comment...

 

i want to know HOW TO INTERFACE AVR ATMEGA32 WITH ESP8266.

How to interface anything to anything elsehttp://www.8052.com/forum/read/1...

 

http://www.lmgtfy.com?q=INTERFACE+AVR+ATMEGA32+WITH+ESP8266

 

 

EDIT: fix broken quote

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hello friends,

my issue is same, i've used arduino uno as serial to TTL converter to configure ESP module.

But i want to use ESP8266 with atmega32A.

 

Now the problem i am facing right now is,

 

Rx-Rx

Tx-Tx

Vcc-3.3V

CH_PD-3.3v

GPIO0 - GND

GND-GND

 

and in arduino i've done RESET to GND so it will become serial to TTL only.

 

That one works for me. 

But next day it won't i don't know what is the problem,

issues i am facing now is,

1. when i remove Vcc-3.3v RED LED on ESP ain't stop glowing(means contionous glowing after removing VCC)

2. when i remove RX pin out of arduino of ESP RED LED STOP Glowing(Seems like ESP VCC is coming from RX pin ?)

3. when i try to send AT nothing happens but when i switch Rx and Tx pin some symbols shown up once then nothing happen no response.

4. when i remove Rx and VCC, ESP STOPS but once i Connect RX pin BLUE AND RED LED GLOWs continously.

 

PLease help me out whats going on. 

Manish verma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

2. Yes, that is probably what is happening. This is a design feature.
Is the arduino 3V or 5V? Hopefully not 5V as the esp8266 won’t like that voltage.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes arduino uno having both 5 and 3.3 but i m using 3.3v.

 

Manish verma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

staring.net@gmail.com wrote:
 i've used arduino uno as serial to TTL converter 

That seems enormously over complicated!

 

Why not just use a simple USB-to-TTL converter to connect direct to the PC?!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hmmm... actually i tried that one as well.

problem i am facing using USB - TTL converter.

It shows connection works fine.(RX-RX,Tx-Tx,Vcc-3v3,gnd-gnd,GPI0-Gnd)

but no response,

using arduino serial port COM5 and sketch for AT commands

..

whenever type anything and send. Blue Led on USB-TTL converter blinks and some small disturbance felt on ESP like RED led getting low power or something no blue light glows on ESP

Manish verma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

staring.net@gmail.com wrote:
It shows connection works fine.(RX-RX,Tx-Tx,Vcc-3v3,gnd-gnd,GPI0-Gnd)

but no response,

Err - if there's "no response" then the connection is not "works fine" - is it?!?!

 

Are you sure about this:

 

RX-RX,Tx-Tx

That means that the TX on one device (the Arduino?) must be an output, and the TX on the other (the ESP?) must be an input - doesn't it?

 

Now, strictly speaking, this is correct by the original definitions of DTE & DCE;  but, nowadays, it is more common to find that "RX" is always the input and "TX" is always the output - in which case you need:

TX (output) -----> RX (input)

RX  (input) <----- TX (output)

 

Also, are you sure that the USB-to-TTL converter can provide enough power for the ESP module to operate correctly?

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ASIDE:

 

awneil wrote:
strictly speaking, this is correct by the original definitions of DTE & DCE

See: http://www.8052.com/forum/read/1...

 

And: http://www.8052.com/forum/read/1...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

as per your suggestion i did what you said.....but all i get is Blue and 2 RED LEDs on USB-TTL glowing contionusly and ESP RED AND BLUE LED not glowing.

Manish verma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

 

Also, are you sure that the USB-to-TTL converter can provide enough power for the ESP module to operate correctly?

 

 

 

i don'y know whether it provide enough power or not....please tell me how to acheive that much power ?

Manish verma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Go to esp8266.com
A zillion others have had the same problems methinks.

My guess is your 3V supply is not up to scratch.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

staring.net@gmail.com wrote:
i don'y know whether it provide enough power or not

So find out, then!

 

RTFM!

 

Read the documentation for your ESP module - what does it require ?

 

Read the documentation for your USB-to-TTL converter - what can it provide ?

 

It should be obvious that the USB-to-TTL converter must be specified to provide at lease as much as the ESP module requires - isn't it?

 

One thing to beware of is that any radio-based device - such as the ESP - tends to have very high peak power requirements.

You need to ensure that your supply can meet the peak requirement.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But try to understand the problem is,

It WORKED perfectly very first day i used ESP module with arduino uno board. without using any converter TTL -USB or any thing just some wires and ESP and Arduino,.

But now i facing this problem i don't understand why its happening.

I tried seraching on google but there is nothing related to it.. all is about connections and configurations with arduino not even with Atmega32A and some thing like that.

Manish verma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You jumped onto this old thread saying:

staring.net@gmail.com wrote:
my issue is same

 

So, if you issue is the same, then the answer is the same - and that answer was:

 

Kartman wrote:
arduino

 

ka7ehk wrote:
Arduino

 

david.prentice wrote:
Arduino

 

awneil wrote:
Surely, Arduino is an ideal platform for getting started?

 

As you are clearly stuggling with the very basics, why do you not simply use an Arduino and an ESP8266 shield ??

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ahhh ....

Cmon anweil i do have Arduino UNO and ESP8266-01 and USB-TTL converter but not that shield......

If you know how to analyise my problem then please tell me the process what to do and where to start. because i did everything possible for me to do...checked voltages of every pin (all correct).

Checked connections 100 times(all correct)

but now its not working and i don't know y.

Manish verma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

staring.net@gmail.com wrote:
but now its not working and i don't know y.

Neither do we. We don't do magic here.

I can tell you the esp8266 modules are unreliable if the power supply is not right. Sometimes it works, sometimes it doesn't. Go to esp8266.com and read about the zillion others that have learnt the hard way.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

staring.net@gmail.com wrote:
please tell me the process

The process is to start with known-good hardware.

 

That would be an Arduino and a shield.

 

Then you have a reference point.

 

At the moment, we know nothing about what module, exactly, you're using; what USB-to-TTL converter you're using; how you've it wired up; what you may have done to break stuff.

 

It is virtually impossible to debug this stuff remotely.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
I can tell you the esp8266 modules are unreliable if the power supply is not right.

That applies to most things!

 

laugh

 

But, as I mentioned earlier, anything radio-based is particularly susceptible to this kind of "misbehaviour" - because of the high peak currents encountered.

 

Only this morning we have another example right here: http://www.avrfreaks.net/forum/r...

 

This is why you should at least start with a shield from a reputable supplier with a good body of support.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here we go,

 

Solution -

 

Rx       -RX

Tx       -Tx

Gnd     -Gnd

Vcc      -3.3 v

CH_PD -3.3 V

 

thats it nothing more .....

 

just put this connection with your arduino UNO board. 

 

And you can work on AT commands as UNO can afford that much current to communicate via AT, But once you are enabling its wifi you have to use external supply.

 

Thanks 

Manish verma