I2C Pins

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
randytsuch
Normal user
Posts: 33
Joined: 05 Jun 2017, 05:32

I2C Pins

#1 Post by randytsuch » 05 Jul 2017, 22:02

Found out the hard way ESP Easy really doesn't like it when you reassign I2C pins, at least the way I did it.

I thought there might be a conflict if you wanted to use pins 4 and 5 while they were assigned to SDA and SCL, so I had reassigned them to pins 9 and 10 to SDA and SCL on a couple boards. 9 and 10 aren't available on a Wemos mini D1 or D1 pro, so I thought it would work out.

So the boards work fine for basic stuff, reading switch inputs, reading a temp device and setting relays.

But if I tried to do almost anything else, like sending a HTTP command for an event to start a rule, it would reset. Some serial commands caused resets too, I didn't try that many though.
After I figured out I should assign SDA and SCL back to pins 4 and 5, it works fine. And I can still use pins 4 and 5 for inputs or outputs, so I didn't need to worry about it.

I am using version 120.

It would be nice not to allow pins 9 and 10 for SDA/SCL since it causes this behavior. Keep others out of trouble lol.

Randy

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: I2C Pins

#2 Post by papperone » 05 Jul 2017, 23:45

As far as I know GPIO9/10 are used to access SD memory and cannot be used for anything else otherwise the ESP will quite surely reset (just some old boards seems to be ok to use those pins)...
If you don't use I2C you can always leave those 2 "empty" in the hardware tab and all will work as you have already see :)
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

randytsuch
Normal user
Posts: 33
Joined: 05 Jun 2017, 05:32

Re: I2C Pins

#3 Post by randytsuch » 05 Jul 2017, 23:53

papperone wrote: 05 Jul 2017, 23:45 As far as I know GPIO9/10 are used to access SD memory and cannot be used for anything else otherwise the ESP will quite surely reset (just some old boards seems to be ok to use those pins)...
If you don't use I2C you can always leave those 2 "empty" in the hardware tab and all will work as you have already see :)
OK, that makes sense.
But then why is it even an option to use 9 and 10 for SDA/SCL?

Some idiot like me will pick them, and then regret it. ;)

I don't remember an option for blank, I'll check that tonight.

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: I2C Pins

#4 Post by papperone » 06 Jul 2017, 08:49

as I wrote it's been reported that in some old boards GPIO9 (and maybe 10) can work without any issue, while in the majority of the current modules (Wemos D1 Mini 100% sure) it causes reboot if used
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: I2C Pins

#5 Post by Shardan » 06 Jul 2017, 11:56

papperone wrote: 06 Jul 2017, 08:49 as I wrote it's been reported that in some old boards GPIO9 (and maybe 10) can work without any issue, while in the majority of the current modules (Wemos D1 Mini 100% sure) it causes reboot if used
I've tested this with several boards and bare ESP-12E/F on my own PCB's.
My result: Refrain from unsing GPIO9/10 whereever possible.
If you need an additional GPIO and decide to use these GPIO's, test your setup thoroughly.

As with many GPIOs (0,2,15...) these pins have more functions then GPIO only.
They may work in your environment - or not.

Example:
You may use GPIO0 as an input. But it has to be "high" on booting, otherwise the ESP
will boot into flash mode. If your circuit supports this - nice.
Took me a while to get an IR receiver to work on GPIO0 of a ESP-01 and reliable booting it.... :D

Anyways, maybe have a look at https://www.letscontrolit.com/forum/vie ... IO9#p15919

Regards
Shardan
Regards
Shardan

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: I2C Pins

#6 Post by papperone » 06 Jul 2017, 14:06

I agree Shardan, my statement was just to asnwer that GPIO9/10 are still available as a choice as far as user aknowledge there are limitations (as well i can confirm I've no module that can work with GPIO9/10 but I've read here in the forum with older modules it is possible)
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

randytsuch
Normal user
Posts: 33
Joined: 05 Jun 2017, 05:32

Re: I2C Pins

#7 Post by randytsuch » 06 Jul 2017, 16:36

One other suggestion is to add this to the wiki, to warn people not to use pins 9 and 10 for I2C as it may break other functions and cause resets.

Or at least I hope this thread will help others in the future.

Randy

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: I2C Pins

#8 Post by Shardan » 06 Jul 2017, 16:44

randytsuch wrote: 06 Jul 2017, 16:36 One other suggestion is to add this to the wiki, to warn people not to use pins 9 and 10 for I2C as it may break other functions and cause resets.

Or at least I hope this thread will help others in the future.

Randy
Hello Randy,

the wiki is undergoing many changes these days.
I thin these things and possible issues will be in the wiki when done.

Regards
Shardan
Regards
Shardan

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests