{"action":"created","issue":{"url":"https://api.github.com/repos/SuperHouse/esp-open-rtos/issues/92","repository_url":"https://api.github.com/repos/SuperHouse/esp-open-rtos","labels_url":"https://api.github.com/repos/SuperHouse/esp-open-rtos/issues/92/labels{/name}","comments_url":"https://api.github.com/repos/SuperHouse/esp-open-rtos/issues/92/comments","events_url":"https://api.github.com/repos/SuperHouse/esp-open-rtos/issues/92/events","html_url":"https://github.com/SuperHouse/esp-open-rtos/pull/92","id":135092853,"number":92,"title":"Added possibility to enable internal pull-up resistors","user":{"login":"Nurgak","id":1785126,"avatar_url":"https://avatars.githubusercontent.com/u/1785126?v=3","gravatar_id":"","url":"https://api.github.com/users/Nurgak","html_url":"https://github.com/Nurgak","followers_url":"https://api.github.com/users/Nurgak/followers","following_url":"https://api.github.com/users/Nurgak/following{/other_user}","gists_url":"https://api.github.com/users/Nurgak/gists{/gist_id}","starred_url":"https://api.github.com/users/Nurgak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nurgak/subscriptions","organizations_url":"https://api.github.com/users/Nurgak/orgs","repos_url":"https://api.github.com/users/Nurgak/repos","events_url":"https://api.github.com/users/Nurgak/events{/privacy}","received_events_url":"https://api.github.com/users/Nurgak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2016-02-20T16:26:24Z","updated_at":"2016-02-21T23:32:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/SuperHouse/esp-open-rtos/pulls/92","html_url":"https://github.com/SuperHouse/esp-open-rtos/pull/92","diff_url":"https://github.com/SuperHouse/esp-open-rtos/pull/92.diff","patch_url":"https://github.com/SuperHouse/esp-open-rtos/pull/92.patch"},"body":"I was working on an 5V I2C device (LCD screen) which had pull-up resistors on the SCL an SDA lines, since the ESP is not 5V tolerant I removed them. 3.3V is apparently enough in my application to make the slave recognise a logical 1.\r\n\r\nThis modification lets the user choose to enable the ESP internal pull-up resistors for the SCL and SDA lines with a new function: `i2c_pullups(boolean)`. This way the circuit does not need more external parts. ~~I have tested the code and checked the signal on an oscilloscope, despite the SCL line not rising to 3.3V it works well.~~ Edit: this is actually not reliable, but could work at slower speeds...\r\n\r\n![I2C using ESP internal pull-up resistors](http://i.imgur.com/mxN0Ggo.jpg)\r\n\r\n~~There's a risk in driving the SDA and SCL lines to Vcc. In my example I use a ESP8266-01 board where only the GPIO0 and 2 are available, just enough for I2C. GPIO0 must be connected to 0V when programming, but as soon as the program starts and drives the line to 3.3V it basically shorts Vcc to 0V via this GPIO0, an open-drain output allows for safety in this situation.~~\r\n\r\n~~Ultimately driving the SCL and SDA lines to Vcc is a bad idea and should be removed I think (at least as the default configuration). If the slave drives the line to 0V for some reason it shorts out and the ESP probably dies, open-drain output is basically the whole point of I2C.~~\r\n\r\nNever mind, the lines were never driven to Vcc, however internal pull-up resistors is still a neat feature."},"comment":{"url":"https://api.github.com/repos/SuperHouse/esp-open-rtos/issues/comments/186943995","html_url":"https://github.com/SuperHouse/esp-open-rtos/pull/92#issuecomment-186943995","issue_url":"https://api.github.com/repos/SuperHouse/esp-open-rtos/issues/92","id":186943995,"user":{"login":"projectgus","id":205573,"avatar_url":"https://avatars.githubusercontent.com/u/205573?v=3","gravatar_id":"","url":"https://api.github.com/users/projectgus","html_url":"https://github.com/projectgus","followers_url":"https://api.github.com/users/projectgus/followers","following_url":"https://api.github.com/users/projectgus/following{/other_user}","gists_url":"https://api.github.com/users/projectgus/gists{/gist_id}","starred_url":"https://api.github.com/users/projectgus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectgus/subscriptions","organizations_url":"https://api.github.com/users/projectgus/orgs","repos_url":"https://api.github.com/users/projectgus/repos","events_url":"https://api.github.com/users/projectgus/events{/privacy}","received_events_url":"https://api.github.com/users/projectgus/received_events","type":"User","site_admin":false},"created_at":"2016-02-21T23:32:34Z","updated_at":"2016-02-21T23:32:34Z","body":"Veering a bit O/T here, but I was curious about making resistors in silicon. This lecture goes over a few methods used for analog cmos http://www.aicdesign.org/SCNOTES/2010notes/Lect2UP070_%28100419%29.pdf\r\n... says large resistance values are often made as 'n-well resistors', +/-40% absolute accuracy. I don't know enough about chip fabrication to know what techniques would apply to ESP8266 though. 30K-100K is +/-54% anyhow, which is more than what's mentioned for any of these techniques (even once you add a few percent across the temp range). ???"}}