I am trying to set up a simple project with a Teensy 4 and an ESP8266 that communicate over I2C to allow some LEDs to be controlled by the Teensy. The rough idea is something like this:
Where the two Teensy's at the end are controlling some LED strips via WS2812Serial based on the commands they receive. After failing to get anything working I broke the project down into the smallest test setup that I could and it looks like this (although a Teensy 4 instead of a Teensy 3.1):
In this configuration I am unable to get the two devices to talk to each other in either master/slave or slave/master configuration. If I set up one as a slave and then use the scanner I get back 0 devices. Curiously, if I replace the Teensy with an Arduino Uno OR I replace the ESP8266 with an Arduino Uno then they are able to communicate without any issues. At this point I feel like it must be related to the logic levels somehow but I'm confused about that.
I know that applying 5v to the Teensy or the ESP8266 can damage them so using the Uno for testing is a bit of a gamble but so far everything has held up ok. I've tried adding pullup resistors to both the SDA and SCL lines (I only had about 4 ~1k on hand so I used two on each without any difference in behavior). I also tried a 10k and that didn't seem to help either (but honestly I don't know enough to confidently say what values I should be using or how to tell if they are working).
I have a logic level converter on hand that I can use if anyone thinks it might help but I'm very confused about why the 3v signals between the Teensy and the ESP8266 wouldn't work on their own. I think since I'm not planning on using an Arduino for this project I shouldn't need to use the logic level shifter at all?
The code I'm using for my tests are just the basic Master_Sender and Slave_Receiver examples from the Wire library, nothing else fancy at the moment. Does anyone have any tips, suggestions or ideas about what I might be doing wrong here? Even just additional thoughts on what I can troubleshoot would be greatly appreciated. Thank you!
Where the two Teensy's at the end are controlling some LED strips via WS2812Serial based on the commands they receive. After failing to get anything working I broke the project down into the smallest test setup that I could and it looks like this (although a Teensy 4 instead of a Teensy 3.1):
In this configuration I am unable to get the two devices to talk to each other in either master/slave or slave/master configuration. If I set up one as a slave and then use the scanner I get back 0 devices. Curiously, if I replace the Teensy with an Arduino Uno OR I replace the ESP8266 with an Arduino Uno then they are able to communicate without any issues. At this point I feel like it must be related to the logic levels somehow but I'm confused about that.
I know that applying 5v to the Teensy or the ESP8266 can damage them so using the Uno for testing is a bit of a gamble but so far everything has held up ok. I've tried adding pullup resistors to both the SDA and SCL lines (I only had about 4 ~1k on hand so I used two on each without any difference in behavior). I also tried a 10k and that didn't seem to help either (but honestly I don't know enough to confidently say what values I should be using or how to tell if they are working).
I have a logic level converter on hand that I can use if anyone thinks it might help but I'm very confused about why the 3v signals between the Teensy and the ESP8266 wouldn't work on their own. I think since I'm not planning on using an Arduino for this project I shouldn't need to use the logic level shifter at all?
The code I'm using for my tests are just the basic Master_Sender and Slave_Receiver examples from the Wire library, nothing else fancy at the moment. Does anyone have any tips, suggestions or ideas about what I might be doing wrong here? Even just additional thoughts on what I can troubleshoot would be greatly appreciated. Thank you!