{"id":369,"date":"2020-10-16T23:39:07","date_gmt":"2020-10-16T22:39:07","guid":{"rendered":"http:\/\/tescaweb.nl\/Carel\/?p=369"},"modified":"2022-01-26T13:45:43","modified_gmt":"2022-01-26T12:45:43","slug":"i2c-and-level-shifting-simple-explained","status":"publish","type":"post","link":"http:\/\/tescaweb.nl\/Carel\/?p=369","title":{"rendered":"I2C and level shifting simple explained"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"alignright\"><img alt=\"\"\/><\/figure><\/div>\n\n\n\n<h2>The basics of I2C<\/h2>\n\n\n\n<p>For the basics see the I2C bus and level shifting, see:<\/p>\n\n\n\n<ul><li>The I2C specifications ( bible) by NXP:<br><a href=\"https:\/\/www.nxp.com\/docs\/en\/user-guide\/UM10204.pdf\">https:\/\/www.nxp.com\/docs\/en\/user-guide\/UM10204.pdf<\/a><\/li><li>Level shifting basic from NXP:<br><a href=\"https:\/\/www.nxp.com\/docs\/en\/application-note\/AN10441.pdf\">https:\/\/www.nxp.com\/docs\/en\/application &#8230; N10441.pdf<\/a><\/li><li>To understand the N-MOSFET (Enhancement type are often used in a level shifter), see:&nbsp;<a href=\"http:\/\/www.learningaboutelectronics.com\/Articles\/N-Channel-MOSFETs\">http:\/\/www.learningaboutelectronics.com &#8230; el-MOSFETs<\/a><\/li><li>How a MOSFET works as part of a level switcher:&nbsp;<a href=\"https:\/\/electronics.stackexchange.com\/questions\/173297\/how-does-a-bidirectional-level-shifter-work\">https:\/\/electronics.stackexchange.com\/q &#8230; ifter-work<\/a>&nbsp;(1\/2 page)<\/li><li>A link to an application note which explains in two pages &#8220;level shifting&#8221; and the power supply levels needed:<br><a href=\"https:\/\/www.onsemi.com\/pub\/Collateral\/AND8449-D.PDF\">https:\/\/www.onsemi.com\/pub\/Collateral\/AND8449-D.PDF<\/a><br>I choose this application note because it is almost similar with the configuration in the article (a 3.3V master with several 5V slave devices).&nbsp;The 5V and 3.3V power supplies are show explicit.<\/li><li>A level shifter is binary and bi-directional. It has a low and high voltage side and&nbsp; it doesn&#8217;t have a master or client side.<\/li><\/ul>\n\n\n\n<h2>Fischertechnik and I2C<\/h2>\n\n\n\n<p>Both the TX-C and the TXT controllers from fischertechnik have an I2C bus.<\/p>\n\n\n\n<p>The TXT controller has also a programming mechanisme, called SLI, to extend the RoboPro with downloadedble modules programmed in C\/C++<\/p>\n\n\n\n<ul><li>See also:&nbsp;<a href=\"https:\/\/reivilofischertechnik.weebly.com\/isup2c.html\" target=\"_blank\" rel=\"noreferrer noopener\">Rei Vilo&#8217;s pages<\/a><\/li><\/ul>\n\n\n\n<h2>I2C line lengths<\/h2>\n\n\n\n<p>Additional note about I2C device and line (wires) impedance, signal quality and their relation with the length of the line :<\/p>\n\n\n\n<p>The value of the Rp ( the pull-up resistor), the optional device serial resistors (Rs) and the length and quality of the connection line are very often underexposed in the FTC publications about the use of the I2C bus.<br>On the fast speed (400 khz) this issues become more and more important.<br>The device and line impedances are important and they are well describe in the NXP I2C bible (for example: chapter 7).<br>See also:&nbsp;<a href=\"http:\/\/dsscircuits.com\/articles\/effects-of-varying-i2c-pull-up-resistors\">http:\/\/dsscircuits.com\/articles\/effects &#8230; -resistors<\/a><br><br>In case your lines between the TXT or TX-C (or I2C level-shifter) and the I2C device(s) in your model are too long and it is slowing down the performance of your I2C-bus, it could be helpful to make use of a real&nbsp;<strong>I2C bus-extender<\/strong>&nbsp;like the P82B715.&nbsp;Read the overview of this extender in:&nbsp;<a href=\"https:\/\/www.nxp.com\/products\/analog\/interfaces\/ic-bus\/ic-bus-repeaters-hubs-extenders\/i2c-bus-extender:P82B715\">https:\/\/www.nxp.com\/products\/analog\/int &#8230; er:P82B715<\/a>&nbsp;and also the application notes (under the tab documentation)<br>Remarks:&nbsp;This I2C bus-extender is not the same as an I2C level shifter!<\/p>\n\n\n\n<p>General remarks:<\/p>\n\n\n\n<ol><li>The impedance, the Rs and the Rp of the TXT and TX-C I2C-bus has not been specified by in the TXT documentation from fischertechnik. However they are published on the forum:<br><a rel=\"noreferrer noopener\" href=\"https:\/\/forum.ftcommunity.de\/viewtopic.php?f=21&amp;t=5376#p39701\" target=\"_blank\">Rp= 4k7 ohm and a Rs =100 ohm<\/a><br><\/li><li>Connectors and additional not used overhead on a line could influence the quality of the signal in negative sense.<\/li><\/ol>\n\n\n\n<h2>See also an article about I2C&nbsp; level shifting in the&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/ftcommunity.de\/ftpedia_ausgaben\/ftpedia-2019-2.pdf\" target=\"_blank\">FTpedia 2019-2<\/a> pag 44<\/h2>\n","protected":false},"excerpt":{"rendered":"<p>The fischertechnik TXT-control offers a I2C master output with a 3.3V signal level. This post describes how this level could also be 5V.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":""},"categories":[6,40,43,44,7],"tags":[53,54,17],"post_folder":[],"_links":{"self":[{"href":"http:\/\/tescaweb.nl\/Carel\/index.php?rest_route=\/wp\/v2\/posts\/369"}],"collection":[{"href":"http:\/\/tescaweb.nl\/Carel\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/tescaweb.nl\/Carel\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/tescaweb.nl\/Carel\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/tescaweb.nl\/Carel\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=369"}],"version-history":[{"count":1,"href":"http:\/\/tescaweb.nl\/Carel\/index.php?rest_route=\/wp\/v2\/posts\/369\/revisions"}],"predecessor-version":[{"id":788,"href":"http:\/\/tescaweb.nl\/Carel\/index.php?rest_route=\/wp\/v2\/posts\/369\/revisions\/788"}],"wp:attachment":[{"href":"http:\/\/tescaweb.nl\/Carel\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=369"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/tescaweb.nl\/Carel\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=369"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/tescaweb.nl\/Carel\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=369"},{"taxonomy":"post_folder","embeddable":true,"href":"http:\/\/tescaweb.nl\/Carel\/index.php?rest_route=%2Fwp%2Fv2%2Fpost_folder&post=369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}