using i2c and serial with the same two pins? #3011
Replies: 5 comments
-
|
Posted at 2019-07-03 by Wilberforce Since the pins will be connected to two devices - you might get unwanted results. I2c usually has a pull up so that might also cause issues with serial. Why can you just use another 2 pins an keep them separate? |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-07-03 by @gfwilliams Yes, you can swap between I2C and Serial 'on the fly' in Espruino without any trouble - but as @wilberforce says it's unlikely that other devices you connect to will be as forgiving :) |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-07-03 by BootySnorkeler my plan was to have different devices that I would plug in one at a time. For example, one day I would plug in an I2C LCD module and another day I would take that off and plug in a USB to serial cable. I guess I would be fine with that |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-07-04 by @gfwilliams Yes, totally - no problems at all :) |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-07-04 by @fanoush someone have tested serial and i2c over same pins with ds-d6 fitness tracker (which only have 2 gpios available without taking it apart and by default it is serial console) and switching to i2c worked fine. ttl serial is high when idle so pull up configuration should be similar with i2c and ttl serial. I guess it uses just internal configurable pull ups and not resistors on board but even if there are pull up resistors in ds-d6 the requirement for them should be similar for i2c and serial (?) so in general this combination should work. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2019-07-03 by BootySnorkeler
Hi,
Since the MDBT42Q module is based on the nRF52832, and the nRF52832 chip can assign any two pins as SCL/SDA, can i use both i2c and serial with the same two pins? Not simultaneously, of course, but I would like to use them and switch between I2C and Serial on the fly.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions