esp8266 / esp8266/Arduino

I2C as Master, sending data. [3.1.2]

Open
#8,961 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
16.7k
Forks
13.1k
PR merge metrics
No merged PRs in 30d

Description

### Basic Infos

This is an I2C issue.

- [?] This issue complies with the [issue POLICY doc](https://github.com/esp8266/Arduino/blob/master/POLICY.md).
- [x] I have read the documentation at [readthedocs](https://arduino-esp8266.readthedocs.io/en/latest) and the issue is not addressed there.
- [x] I have tested that the issue is present in current master branch (aka latest git).
- [x] I have searched the issue tracker for a similar issue.
- [ ] If there is a stack dump, I have decoded it.
- [x] I have filled out all fields below.

#### Platform

- Hardware: [ESP8266]
- Core Version: [Latest does not work with this issue. The issue is I have to use old 2.0.10]
- Development Env: [Arduino IDE]
- Operating System: [Windows]

### Settings in IDE

- Module: [Nodemcu 1.0]
- Flash Mode: [qio|dio|other]
- Flash Size: [4MB(2M SPIFFS)]
- lwip Variant: [v2 Lower Memory]
- Reset Method: [nodemcu]
- Flash Frequency: [N/A]
- CPU Frequency: [80Mhz]
- Upload Using: [SERIAL]
- Upload Speed: [115200]

### Problem Description

I have used a Data logger on the SDA and SCL
1. (Write mode) the issue is between the Address Byte and the First Data Byte. There is a bit set high. 00000000 > 10000000. It could be because SDA is flipped at the wrong time during ACK.
2. Also at the end of transmission the SCL has an extra pulse that holds onto the bus. I think it is the same reason as above.
3. (Read mode) I think if you fix the write mode, this will be fixed also.

![Ver. 3.1.2 results ISSUE](https://i.imgur.com/BtKhM3f.png)
![Ver. 2.5.0 results OK](https://i.imgur.com/F6iEEdn.png)

My fix:
1. Use version 2.5.0
2. With version 2.5.0 it all works perfect.
4. I do not know where the fault got introduced between 2.5.0 and now, I cant me arsed to find out. I have a working fix for my purposes.
5. Note I had a similar issue when I wanted to use interrupts in a project, I had to do the same, use ver. 2.5.0

### [MCVE](https://stackoverflow.com/help/mcve) Sketch

```cpp

#include
#include

char Buffer_TX[64]; /* message */

void SendBufferOnI2C(int I2C_address) {

Wire.beginTransmission(I2C_address); // Get device at I2C_address attention
Wire.write(Buffer_TX, 64); // Send Buffer_TX
Wire.endTransmission(); // Stop transmitting

}
```

### Debug Messages

```
See images.
The issue cannot be found with code.
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.