Running a MCP23017 on 5V
Running a MCP23017 on 5V
Hi,
I want to use the MCP23017 port expander for a project. The logic I'm driving with the MCP23017 is on 5V so I want to use 5V to power the MCP23017. My question is: since SDA and SDC are open drain connections on the I2C bus, is it OK to use the ESP to drive the MCP23017? The ESP has internal pullups to 3.3V on its I2C port so I think it should be fine. However, the datasheet for the MCP23017 has some AC characteristics in section 1.2: http://ww1.microchip.com/downloads/en/D ... 01952C.pdf
It shows a pullup to VDD in that schematics. Is that an internal pull in the MCP23017? I could not find any indication.
Long in short: is it OK to connect an ESP via I2C to a MCP23017 running on 5V without any level-shifters?
TIA,
AP
I want to use the MCP23017 port expander for a project. The logic I'm driving with the MCP23017 is on 5V so I want to use 5V to power the MCP23017. My question is: since SDA and SDC are open drain connections on the I2C bus, is it OK to use the ESP to drive the MCP23017? The ESP has internal pullups to 3.3V on its I2C port so I think it should be fine. However, the datasheet for the MCP23017 has some AC characteristics in section 1.2: http://ww1.microchip.com/downloads/en/D ... 01952C.pdf
It shows a pullup to VDD in that schematics. Is that an internal pull in the MCP23017? I could not find any indication.
Long in short: is it OK to connect an ESP via I2C to a MCP23017 running on 5V without any level-shifters?
TIA,
AP
Re: Running a MCP23017 on 5V
That AC diagram your referring to is to show what the pin with those loads will meet for the timing specifications.
Yes, you can power the MCP23017 from 5V. The only thing you need to do is run your 2 pullup resistors to +3.3v and not +5v
Yes, you can power the MCP23017 from 5V. The only thing you need to do is run your 2 pullup resistors to +3.3v and not +5v
Re: Running a MCP23017 on 5V
Thanks for your response. Just to clarify on the pull-ups: the built-in pull-ups that get enabled with sda_pullup_en and scl_pullup_en of i2c_config_t are sufficient, correct?
AP
AP
-
- Posts: 9709
- Joined: Thu Nov 26, 2015 4:08 am
Re: Running a MCP23017 on 5V
It could work but wouldn't count on it if you want a high-speed bus: internal pull-ups are 50K'ish while I2C normally wants something in the 5K range.
Re: Running a MCP23017 on 5V
I'm gonna to do MCP23017 +5V supply with fast I2C ESP32 3.3V and INTA/INTB.
I will have a short I2C length (5cm), so I'm not sure if I really need strong pull-up resistors (5kohm) for SDA and SCL at 400kHz or 1.7MHz. So, I think that I will first test with the internal 30...50kohm pull-up ESP32. If it does not work, I could always add 2pcs 5k later on.
However, I'm gonna to use MCP23017 with its INTA output. There, INTA 5V output signal could domage ESP32 irremediably. Therefore, I will apply not a voltage shifter but just 2 stupide resistors as voltage divider to step down INTA to 3V, to be compatible to ESP32 GPIO. Does it look correct?
Anybody who has ever try MCP23017 5V supply with INTA/INTB link to ESP32 GPIO?
I will have a short I2C length (5cm), so I'm not sure if I really need strong pull-up resistors (5kohm) for SDA and SCL at 400kHz or 1.7MHz. So, I think that I will first test with the internal 30...50kohm pull-up ESP32. If it does not work, I could always add 2pcs 5k later on.
However, I'm gonna to use MCP23017 with its INTA output. There, INTA 5V output signal could domage ESP32 irremediably. Therefore, I will apply not a voltage shifter but just 2 stupide resistors as voltage divider to step down INTA to 3V, to be compatible to ESP32 GPIO. Does it look correct?
Anybody who has ever try MCP23017 5V supply with INTA/INTB link to ESP32 GPIO?
-
- Posts: 9709
- Joined: Thu Nov 26, 2015 4:08 am
Re: Running a MCP23017 on 5V
That should work. I would still advise against using the internal pull-ups, though; just add those two resistors, they're cheap anyway.
- martinayotte
- Posts: 141
- Joined: Fri Nov 13, 2015 4:27 pm
Re: Running a MCP23017 on 5V
Here is a quote from MCP23017 specs :
The INTn interrupt output can be configured as active-
low, active-high or open-drain via the IOCON register.
-
- Posts: 9709
- Joined: Thu Nov 26, 2015 4:08 am
Re: Running a MCP23017 on 5V
However, do note that by default it's not an open-drain configuration, so in theory you can have a startup scenario where the chip will output 5V on the pin. I'd personally not be comfortable with that.martinayotte wrote: ↑Tue Aug 11, 2020 4:14 pmHere is a quote from MCP23017 specs :
The INTn interrupt output can be configured as active-
low, active-high or open-drain via the IOCON register.
Re: Running a MCP23017 on 5V
The specs say that on POR the default is to have interrupts disabled (GPINTEN register). So it is possible to configure that pin as open drain and then enable interrupts. That is what I have been doing and it is working as expected.ESP_Sprite wrote: ↑Wed Aug 12, 2020 9:38 amHowever, do note that by default it's not an open-drain configuration, so in theory you can have a startup scenario where the chip will output 5V on the pin. I'd personally not be comfortable with that.martinayotte wrote: ↑Tue Aug 11, 2020 4:14 pmHere is a quote from MCP23017 specs :
The INTn interrupt output can be configured as active-
low, active-high or open-drain via the IOCON register.
AP
Re: Running a MCP23017 on 5V
Thanks you very much for all your valuable comments.
My I2C:
ADS1115 : 100kHz, 400kHz, 3.4MHz
ADS1115 : 100kHz, 400kHz, 3.4MHz
MCP23017 :100kHz, 400kHz, 1.7MHz
I don't want to apply several I2C bus's, so I will have to limit to 400kHz. For 400kHz with 5cm bus, internal R's should be OK. At least, it is worth to try.
I was not aware of this open-drain INT output but I like it! I will re-investigate Datasheet....
Apuder, can't you share an SW exemple how to configure MCP23017 INT open-drain at boot? I guess this is only few line inside void setup().
My I2C:
ADS1115 : 100kHz, 400kHz, 3.4MHz
ADS1115 : 100kHz, 400kHz, 3.4MHz
MCP23017 :100kHz, 400kHz, 1.7MHz
I don't want to apply several I2C bus's, so I will have to limit to 400kHz. For 400kHz with 5cm bus, internal R's should be OK. At least, it is worth to try.
I was not aware of this open-drain INT output but I like it! I will re-investigate Datasheet....
Apuder, can't you share an SW exemple how to configure MCP23017 INT open-drain at boot? I guess this is only few line inside void setup().
Who is online
Users browsing this forum: No registered users and 275 guests