Schematics: Using P82B96 w/ MCP23017 on RPi - Page 1
Forum section: electronics / beginners

author: gcardinal
author_rank: Unknown
timestamp: May 19, 2014, 01:16:21 am
content: Many people are usingMCP23017directly with 3.3v I2C on Raspberry Pi, but it looks like its out of spec, a high shouldn’t be lower than 4v for the MCP23017. And also since I'm planning on using 3x I2C chips I would like to solve this before it becomes an issue by using bi-directional buffer IC such as theP82B96.In datasheet it says:"Can Interface Between I2C Buses Operating at Different Logic Levels (2 V to 15 V)"And that is what I want to use it for - to connect 5V I2C chips to 3.3V I2C rail on Raspberry PiI made an attempt to wire it up - but I have a strange fealing that it might be all wrong. I based iton this example, but in datasheet for P82B96 its recommended to use 1K on R3 / R6 and 330 on R7 / R8 - however Im just unsure on how to calculate values of those resistors.Any advice and feedback is highly appreciated, thanks!Edit: 5V are from external source, but 3.3V to P82B96 comes from 3.3V GPIO pin on Raspberry PiEdit2: I would like to stick to one value resistors on all 4 resistors if possible as Im planning on using SIP or DIP resistor network.

author: Unknown
author_rank: Unknown
timestamp: May 19, 2014, 03:30:54 am
content: Quote from: gcardinal on May 19, 2014, 01:16:21 amIn the datasheet where it mentions 1k/330ohm it's talking about driving fairly high-capacitance loads i.e. 3m of ribbon or flat telephone cable. If all your I2C is on-board or only using short cables (e.g. under 10~20cm or so) then 4.7k should be fine. I'd use it...(Yes, it does gloss over the calculation of those values, but it gives you the basic idea of how they're calculated/estimated - the rise time of the R/C network formed by the chosen resistor & cable capacitance - as well as going into how all that affects the overall bus timing.)Was there a particular reason for chosing that line driver? With its bidirectional/unidirectional conversion & high voltage drive ability it would seem to be overkill for I2C compared to something like a TCA9517 or similar straight I2C level translator.

author: gcardinal
author_rank: Unknown
timestamp: May 19, 2014, 07:27:46 am
content: Thank you so much for the reply, that helps a lot!Quote from: Tac Eht Xilef on May 19, 2014, 03:30:54 amThis is my first attempt to design a PCB and I just want to keep it as simple as possible with through-hole components only - so main reason was a DIP-8 case of P82B96. And also availability seems to be good and I find testing circuit with thru-hole components much easier.Also I was lucky to get a 1 year license for Altium Designer - and I really want to test out how it is to go from thru-hole to SMD design.Edit: And the only down-side (please correct me if Im wrong) seems to be price and it is not that bad at 3$

author: Unknown
author_rank: Unknown
timestamp: May 19, 2014, 09:23:22 am
content: Quote from: Tac Eht Xilef on May 19, 2014, 03:30:54 amActually, I forgot that one side is 3.3v - ideally, I'd choose something like 2~3k on the 3.3v side and 4.7k on the 5v side. That said, if it was on the same board or fairly close (i.e. a rPi or arduino shield, etc) I'd use 3.3k or 4.7k on both, depending on what was handy or already in the BoM.(Realistically, you can often get away with anything from a few hundred ohms to 10's of kohms. Many people tend to just throw 10k or 4.7k pullups on there and it works 9 times out of 10 - I2C tends to be very forgiving right up to the point where it starts giving you troubles!)I've got a really good appnote (from TI, I think) on the subject of pullup calculation somewhere - but I can't find it. However,this linkgives a pretty clear and fairly simple explanation of it all.Quote from: gcardinal on May 19, 2014, 07:27:46 amFair enough; I just thought there might have been a reason you chose that specifically e.g. you needed to drive a long line or something.Give up on the through-hole stuff though - SMD is much easier; just get some decent test clips and probesQuote from: gcardinal on May 19, 2014, 07:27:46 amThey look much the same at my end; both the TCA/PCA9517 and P82B96 are ~AU$3 ea retail in unit quantities for the SOIC (I couldn't find the latter in a DIP-8 on a quick look). As long as they both do the job...

author: gcardinal
author_rank: Unknown
timestamp: May 20, 2014, 12:23:12 pm
content: Quote from: Tac Eht Xilef on May 19, 2014, 09:23:22 amThank you again! I ended up putting standalone resistors on both sides with proper value - this way I can also test and if needed quickly switch different values and tune it in with oscilloscope ones I get prototype assembled.But as the same time I also turned out this crazy thing, where I used network array of 8 elements of 3.3kohm, so it turns out to be 2 x 3.3kohm and 2 x 5kohm - from one unit:)Appnote is great, gave me much needed insight! At the same time it a bit overwhelming for me - I hope that where I get it on my bench and start testing it will all make much more senseAnd yes working with through-hole stuff only is pure pain... routing of the board is a nightmare - but at the same time it feel like switching from through-hole stuff to SMD will be a breeze.Again thank for the help, it was one of the last issues in my project!