I2C Master and Arduino

scargill
Posts: 70
Joined: Sun Nov 02, 2014 8:09 pm

I2C Master and Arduino

Postby scargill » Thu Jul 28, 2016 6:09 pm

So I am working on code so that ESP8266 is the master and an Atmega1284 is the slave.

I send data to the Arduino - and I get data back. I'm having reliability issues in that the RETURN data is ok for one byte - but more than one byte I tend to get bad data - AND the ESP has a tendency to reboot.

So questions for those familiar with the I2CMaster code on the ESP.

1. What could cause the ESP to reboot while receiving data - looking at the I2c code I cannot see anywhere that it can get hung up waiting and cause a watchdog timer timeout... has anyone else had this?

2. In the process of trying to narrow this down, I put a logic analyser on the i2c and noted a whole load of CLOCKS at the start. I went back into the I2c_master code for ESP and noted that even in the latest version of the SDK - the function i2c_master_gpio_init() calls at the end, i2c_master_init() which I would have THOUGHT would merely need to ensure that both clock and data lines are high - but in fact sends out a whole load of stuff including no less than 28 clocks - WHAT is all that about????

Pete.

pratik

Re: I2C Master and Arduino

Postby pratik » Tue Aug 02, 2016 1:07 am

Could you solve this problem?
It is just bit-banging so you may be able to track the problem down by viewing the assembler source file at epc1 address.

Who is online

Users browsing this forum: No registered users and 3 guests