I'm having an issue trying to make a NodeMCU to communicate with an Arduino-based custom board.
First, I have a Nano that send 1 byte to a custom board, that has an ATTiny2313 that upon receiving that byte, will display something.
I have a "sniffer" that capture the packets, and the result is as expected.
When I connect my NodeMCU, the display board doesn't do anything: but the sniffer capture some activity: request to write something to address 01 with "NoAck"
I know the pinout is good on my NodeMCU, otherwise I wouldn't sniff anything. I have reversed the signals (SCL vs SDA) and when I do it, my sniffer doesn't catch anything.
Anyone has an idea of what my be wrong ?
I suspected that the NodeMCU might be on a weird speed. I've added the following line: Wire.setClock(400000L) with no luck.
GND are connected together. Vcc is not. Pull-up are in place (4.7k across 3.3v) Maybe I should try a lower value ??
Yes, the SpenceKonde library is what I've used. I do not suspect that board to be the problem, as it works fine with 2-3 other boards that I did.
The final board that I plan to use is actually not that one (I use it as a test board), but if I can't make it work with that one, if will definitely not work with the other !
Do you really have to use the I2C bus between the ATtiny and the NodeMCU ?
Do you know if the ATtiny does work in Slave mode ?
Do you really have to use the ATtiny, can you try with an Arduino Uno.
You made me curious, what is your sniffer ?
I am very fond of the LHT00SU1 logic analyzer in combination with sigrok/PulseView.
Can you show your sketches ?
Keep the default speed of the I2C bus (100kHz).
The ESP8266 is more or less 5V tolerant. You could try 10k pullup resistors to 5V to raise the level. Never do that with a ESP32. You can also power your ATtiny with 4V or 4.5V.
Do you use a breadboard ? They have often bad contacts.
Is your ATtiny on a breadboard ? How many decoupling capacitors are there ? Does it have a good crystal ?
You might not have just one problem, there could be more than ten problems in these situations. Or maybe the ATtiny is broken, then it is just one problem.
Just loves it. Has helped me many times to troubleshoot I2C issues
Not using a breadboard: PCB on both (master & slave) side
No crystal. Using internal clock (by memory, I think it's 2 or 8 MHz
Decoupling cap (1x) almost sitting on the CPU
As I mentioned, I don't think the slave is the problem, as it works fime with other boards, all Arduinos
This is the first time I use a NodeMCU with I2C. I will make more test tonight, but I getting convinced, it has to do with 3.3v vs 5.0v and the pull-ups connected to 3.3v instead of 5.0v