MCP23017 - Breakout Board - Understanding the datasheet

Thread Starter

Clayton Allen

Joined Feb 15, 2016
17
Greetings All,

So I have been working on a Breakout Board for the MCP23017 to be used for various deving projects. Currently I have one built on a weird protoboard I bought from RadioShack.

Bottom
IMG_0516 2.JPG

Top (Shown with Particle Photon Installed)
IMG_0515 2.JPG

Well I have had some issues with choosing the correct pullup resistors for SDA/SCL. Then for the Photon (3.3v) I found folks were saying that 4.7k is optimal for pullups which is what you see installed in between the buttons by the two little header pins. Well this circuit works as it should but I have a feeling it won't be great as a stand alone setup. I managed to get it working on an Arduino also although I think I toasted the Arduino because it won't work anymore. Which is weird because my oscilloscope still shows a data waveform but no LEDs are lighting up when instructed. Anyways, all this fussing about with this clunky board has led me to develop a PCB in which I want to have made. But just before I pull the trigger on that I wanted to read the datasheet again and really make sure I'm getting the most of Rev#1.0.

MCP23017 Breakout (Top)
MCPTOP.png

MCP23017 Breakout (Bottom)
MCPBottom .png

Here is what I have designed thus far. It's not great by any means I know. So here begins my questions which I hope you all may be able to talk some sense into this project. Lets start with the addressing pins. As you can see I have some switches (A0, A1, A2) on the board, and each of those switches are connected to VDD(left side of switch) and VSS(right side of switch). Now from here I read about the use of pullup and pulldown resistors. Is it good practice to put these in place when trying to externally bias? On the ugly board way up top I literally just connected straight up to VDD and VSS. And if indeed this is good practice what is a good resistance ,10k?

Next design issue, If you look on the image that is the top of the PCB; You will see another resistor in place to pull the RESET pin up to VDD. On the ugly board up top, I literally just soldered that straight into VDD. Now in this process, I thought is it possible to put a button in here to actually have a manual reset? But nothing I've read would indicate that I can.

This leads to a confusing bit of the datasheet.
Screen Shot 2016-05-17 at 7.40.20 PM.png
Here I see what looks like a pullup of 1k and then a capacitor! None of the articles I have read have ever shown a capacitor on the breadboards. So I'm think what purpose does that serve? I am a total rookie at best. But I take all these things seriously and want to learn.

Now the next question is, let's say I want to interface with 3+ of these breakouts at the same time; how would I have to adjust my design to allow for this? I have seen various boards on Sparkfun that had an I2C header on one side of their board and another on the opposite side. I want to include this concept on my breakout board as well to allow for simple daisy chaining. The other thing I want to include is a spot for some jumpers to be soldered in if needed to allow for safe and simple hookup of the oscilloscope or logic analyser. At this point I don't intend this to be an actual product to be sold but if I'm going to make this a shareable PCB on OSHPark, I want it to be awesome and educational. I'm a hobbyist at best but I have done this with all my projects. I start on the breadboard then move into Eagle and design the schematics and PCB for actual print so I have a few PCBs laying around for two reasons.

1. It allows me to have a finished project so I am not trying to fiddle around with jumper wires and breadboards just to show my friends what I did.
2. It's kind of like a portfolio of my work for one day when I graduate in EE and want to have something to show how I've progressed over time. Although it did add up $$$.

View attachment 106311 View attachment 106312 View attachment 106313 View attachment 106314 View attachment 106311 View attachment 106312 View attachment 106313 View attachment 106314 View attachment 106311 View attachment 106312

Here is an example of another project I just finished (not related to this post):
 
Last edited:

ErnieM

Joined Apr 24, 2011
8,377
That cap is just there for testing the chip itself. Do not put one in your circuit.


Sorry, that is all I could digest from your post for the moment.
 

ErnieM

Joined Apr 24, 2011
8,377
Picking out specific points is a ad difficult from your post. Please try to be very specific: I have board x to interface with a b and c...

The I/O expande will need 16 lines to go out, plus a ground at least. Each needs 4 lines from the controller for power and I2C signals. To daisy chain them you might make an input and output on opposite sides so you can make a linear lash up, with the IO lines out top or bottom. You can set up to 8 addresses with the A0 to A2 lines so you can run up to 8 of these things off one bus.

For addresses I would direct tie them hi or low, no pull ups. For your clear you damn well better add that pull up if you want to add a reset button or you will reset by pulling down your power supply.
 

Thread Starter

Clayton Allen

Joined Feb 15, 2016
17
Sorry the post is kind of not specific enough. So I will sort of pick out main points:

  1. This intended to be a breakout board. What I mean by this is that the MCP23017 will be on board with 8 LEDs and 8 BUTTONS. So this first revision is not meant to be more than a part for learning to code with i.e. Learning to do different things like turning on/off LEDs using binary and other coding methods, as well as being able to understand how to read inputs.
  2. As far as the address pins. I think you clarified the fact resistors are not needed between VDD and VSS. So those will be removed. I do intend to silk the various combos of addresses a user could achieve by tying either to VDD or VSS on the PCB.
  3. Daisy chaining. So if you were to add up to eight of these PCBs to your microcontroller, as I understand it, you would simply need 4 signal lines in on each PCB and 4 signal lines out on each PCB. Would a small capacitor be a good idea between VDD and VSS to filter out any weird voltage spikes?
  4. The RESET pin. Okay so there should definitely be resistor there. But could you perhaps clarify whether it's tied to VDD or VSS? As I understand it without a button or switch, it should be pulled up to VDD. Now if there is button there, do we tie it ground with a resistor? That could potentially be bad when hooked for the power supply right? I'm probably overthinking this one, sorry in advance.
  5. I didn't really want to be specifically tied to one microcontroller or another. I intended it to work on various boards like the Raspberry PI, Arduino, Photon, ESPXXXX, etc... With that being said, I think it's best to say that a breadboard will still be used to add pullup resistors between the microcontroller SDA, SCL and this breakout board. My reasoning for this is that for example a Photon may need a different amount of resistance than say the Arduino.
Cheers,
 

ErnieM

Joined Apr 24, 2011
8,377
1. Noted.

2. Noted.

3. At least 4 lines. These chips have 2 interrupt outputs if you want to use them. Also that reset line...
For caps, read this: Decoupling or Bypass Capacitors, Why?

4. RESET is normally hi, make it low to do a reset. Typically there is one source of the reset so you reset the entire system together. So to use a reset on your daisy chain you need another daisy chain line. Or put an RC on each device so reset happens on power up.

5. I2C is not "tied" to any microcontroller. I even have converters that do it from a PC.
Do be careful about the pull up resistors. You need ONE pair somewhere. Not one pair on every device.
And if you "add pullup resistors between the microcontroller SDA, SCL and this breakout board" you will
have a mess. They go from SDA to VDD and SCL to VDD.

You need to make a schematic before making a board. Post it.
 
Top