Author |
Message |
cerkit
Joined: Nov 17, 2016 Posts: 17 Location: Montgomery, AL USA
|
|
Back to top
|
|
|
gdavis
Joined: Feb 27, 2013 Posts: 359 Location: San Diego
Audio files: 1
|
Posted: Tue Feb 07, 2017 6:27 pm Post subject:
|
|
|
Well, you still have the same issue of driving a chip running at 5V with a 3.3V logic signal. The 23017 doesn't resolve that any more than a nand gate does. It's great for adding more I/O's if you need them, but it's not a level shifter.
You also don't need all those 100k resistors. Just connect unused inputs to ground and you can leave unused outputs unconnected. _________________ My synth build blog: http://gndsynth.blogspot.com/ |
|
Back to top
|
|
|
cerkit
Joined: Nov 17, 2016 Posts: 17 Location: Montgomery, AL USA
|
Posted: Tue Feb 07, 2017 6:53 pm Post subject:
|
|
|
gdavis wrote: | Well, you still have the same issue of driving a chip running at 5V with a 3.3V logic signal. The 23017 doesn't resolve that any more than a nand gate does. It's great for adding more I/O's if you need them, but it's not a level shifter.
You also don't need all those 100k resistors. Just connect unused inputs to ground and you can leave unused outputs unconnected. |
I'm confused, it seems to be handling the I²C messages like it should.
Upon further research, I have found a blog post about this very issue as it relates to the Raspberry Pi and why my circuit is working, even though it is out of spec.
Raspberry Pi and I2C devices of different voltage
I will most likely create an I²C level shifter circuit specifically for my future endeavors. I will need the GPIO pins on the Raspberry Pi for other applications. This way, I only need a single level shifter for the I²C that can help me control the expanded ports.
Thanks for the tip about removing the resistors. I wish I could find the original source that recommended using 100k resistors on unused pins. This will save me from all of this resistor madness (and make my schematics a lot more tame). |
|
Back to top
|
|
|
gdavis
Joined: Feb 27, 2013 Posts: 359 Location: San Diego
Audio files: 1
|
Posted: Tue Feb 07, 2017 7:35 pm Post subject:
|
|
|
cerkit wrote: | gdavis wrote: | Well, you still have the same issue of driving a chip running at 5V with a 3.3V logic signal. The 23017 doesn't resolve that any more than a nand gate does. It's great for adding more I/O's if you need them, but it's not a level shifter.
You also don't need all those 100k resistors. Just connect unused inputs to ground and you can leave unused outputs unconnected. |
I'm confused, it seems to be handling the I²C messages like it should. |
It's called luck. Electronics aren't black and white. Just because something appears to be working now doesn't mean it will be reliable. Change in temperature or use a part from another batch and you may suddenly start to see errors.
Basically what happens is you have two transistors on the input - one registers a high and the other registers a low. When you're "in between", those two transistors are fighting with each other with no guarantee over which one will win out. Also, they will both be conducting abnormally large amounts of current for extended periods of time. In normal operation the transition between low and high is very short so the current during the in between part isn't a concern, but when you constantly drive it at the incorrect level it can cause cumulative damage leading to premature failure.
Quote: | Upon further research, I have found a blog post about this very issue as it relates to the Raspberry Pi and why my circuit is working, even though it is out of spec.
Raspberry Pi and I2C devices of different voltage
I will most likely create an I²C level shifter circuit specifically for my future endeavors. I will need the GPIO pins on the Raspberry Pi for other applications. This way, I only need a single level shifter for the I²C that can help me control the expanded ports. |
That web page has a nice circuit for the I2C level shifting. You wouldn't need the resistors on the Raspberry side (the board already has them) so you'd just need the two transistors and two resistors for the 5V side. Definitely nice that you only have to shift the two I2C signals to get 16 I/O's.
Quote: | Thanks for the tip about removing the resistors. I wish I could find the original source that recommended using 100k resistors on unused pins. This will save me from all of this resistor madness (and make my schematics a lot more tame). |
Not sure why anyone would suggest that except maybe to save you from accidentally connecting an output to ground. They don't hurt but it's a lot of unnecessary components cluttering the board. _________________ My synth build blog: http://gndsynth.blogspot.com/ |
|
Back to top
|
|
|
cerkit
Joined: Nov 17, 2016 Posts: 17 Location: Montgomery, AL USA
|
Posted: Thu Feb 09, 2017 7:12 am Post subject:
|
|
|
gdavis wrote: | That web page has a nice circuit for the I2C level shifting. You wouldn't need the resistors on the Raspberry side (the board already has them) so you'd just need the two transistors and two resistors for the 5V side. Definitely nice that you only have to shift the two I2C signals to get 16 I/O's. |
Do you think a single level shifter on the I2C interface will work if I add additional I2C components to the circuit? I may add additional MCP23017s or other I2C devices. |
|
Back to top
|
|
|
gdavis
Joined: Feb 27, 2013 Posts: 359 Location: San Diego
Audio files: 1
|
Posted: Thu Feb 09, 2017 12:35 pm Post subject:
|
|
|
cerkit wrote: | gdavis wrote: | That web page has a nice circuit for the I2C level shifting. You wouldn't need the resistors on the Raspberry side (the board already has them) so you'd just need the two transistors and two resistors for the 5V side. Definitely nice that you only have to shift the two I2C signals to get 16 I/O's. |
Do you think a single level shifter on the I2C interface will work if I add additional I2C components to the circuit? I may add additional MCP23017s or other I2C devices. |
Yes, that's the beauty of it! You can have any number of 3.3V devices on the 3.3V side and any number of 5V devices on the 5V side. That's what the "device" boxes at the bottom of the diagram are trying to show. _________________ My synth build blog: http://gndsynth.blogspot.com/ |
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Thu Feb 09, 2017 1:10 pm Post subject:
|
|
|
cerkit wrote: | [...] I may add additional MCP23017s or other I2C devices. |
As stated above already, yes ... but ... note ... that you can not then tie the address bits A0 .. A2 all to ground for additional MCP23017s - they will need different addresses to be set. _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
cerkit
Joined: Nov 17, 2016 Posts: 17 Location: Montgomery, AL USA
|
Posted: Fri Feb 10, 2017 6:40 am Post subject:
|
|
|
Blue Hell wrote: | cerkit wrote: | [...] I may add additional MCP23017s or other I2C devices. |
As stated above already, yes ... but ... note ... that you can not then tie the address bits A0 .. A2 all to ground for additional MCP23017s - they will need different addresses to be set. |
That's good information, thanks.
I'm very new to this, so this is all very helpful. Thanks for your time. |
|
Back to top
|
|
|
|