Chat here about code rewrites, mods, etc... with respect to the github project https://github.com/esp8266/Arduino

Moderator: igrr

User avatar
By Julio Cesar Gouy
#73090 Hi, did you made your tests with the Adafruit ESP8266 as Slave? Do you know where can I find more information about the ESP8266 I2C Slave support and it's interoperability with the Arduino Nano, for example?

Thanks a lot!
User avatar
By bjoham
#73262 I used this board: https://www.adafruit.com/product/2471
(Adafruit HUZZAH ESP8266 Breakout, PRODUCT ID: 2471)

There are a lot of I2C documentation sources available on the internet: datasheets, tutorials, etc. Once the topic is familiar, I recommend the Atmega328 datasheet to get into the details.

With I2C being a standardized interface, my experience says that any interoperability issues has its cause in SW. Hence, testing and source reviewal is the only way to find out (either by you or someone else).

For the ESP8266 I2C slave support in particular, it is a SW-only implementation. Hence, any issue (on the ESP8266 side) is either a SW bug, a timing issue, or a combination of the two. Some timing issues are known and unsolvable(?) such as the interrupt latency resulting in the maximum communication speed being around 15kHz.

I have some additional boards that I plan to test. So far no luck in prioritizing it, however.

The board I have, have been running more or less continuously since put in action. Only once, I had to manually reset it. That time, the MQTT server had changed its IP address. Maybe that clogged up something and made the ESP8266 freeze. (I have yet to activate the WD to avoid anything like this in the future.)
User avatar
By Driftmonster
#74481 Hello bjoham,

i am on my way to write my own I2C Slave library, mine is interrupt driven. I can reach up to 100 kHz, but i want to reach Fast Mode (400 kHz). My biggest problem is, that my Interrupts get triggeres waaayy too slow. I am also reaching 2 µs (with 160 MHz CPU Speed) until i am able to write a GPIO, which is too slow to repsond fast enough and i would prefer running the ESP8266 at 80 MHz again.

So my question is: Is there meanwhile any faster way to run my ISR?

On Github i found the very intersting part from CNLohr, where he uses ASM instructions, but i am not able to understand and adopt these to my needs. I would basically like to use my current ISR and simply jump there from the ASM instructions, that runs as soon as the Interrupt flag is set.
https://github.com/cnlohr/espusb/blob/master/user/usb_asm_1bit.S

I hope my english is understandable, since i am from germany ;)
User avatar
By bjoham
#75671 I haven't found any fast way to do it.

How have you done it? It seems that you're doing it at least 10 times faster than my code.