Shop OBEX P1 Docs P2 Docs Learn Events
MCP23017/MCP23018 speed and usefulness? — Parallax Forums

MCP23017/MCP23018 speed and usefulness?

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2012-10-18 09:44 in Propeller 1
Ok so this board im designing right now is going to be using the MCP23018 which is basically the same as the 23017 except it has an open collector and 5v tolerant pins, yay! Anyways as the design stands right now the board will have 53 I/O pins. This is because I plan on chaining my i2c chips on the same bus as the EEPROM. This got me thinking about some stuff though which im a little hazy about and didn't even realize it till now.

First of all the data sheet for the 230xx devices isnt to clear about speed, it says the chips can be ran on an i2c bus at 100khz, 400khz or 1.7mhz... now thats all fine and dandy that means the chip will communicate with the prop at the chosen clock for your i2c chain. Here is what im unclear on though how fast can the acuall GPIO used, I would assume its a bit slower than the i2c bus speed because the prop has to send or receive data down the bus then the mcp230xx has to find the correct pin and send or receive data.

Im thinking if the prop can read write the data on the expanders pins at at least 400khz this should be fine for most tasks anyone wants to use I/O for except communicating with memory and higher speed things like that, but for flashing LEDs and running motor or serial LCD displays these pins should be just fine correct, or will you have to do something like bit bang a uart to get serial devices working on these gpios? Since this board is geared more towards robotics im thinking about slapping some h-bridge chips on and using the expanders gpio to handle motor control and PWM, this way its not wasted on higher speed direct propeller pins, does this sound like a bad idea for any of you that are more familiar with these chips.

Next thing im a little hazy on is I know when the propeller loads the eeprom ob boot it only clock the i2c lne at 400khz right? So after the eeprom is loaded can the i2c bus be bumped up to 1.7mhz, so the i2c expander and Hi-eeprom can communicate with the propeller faster, Or am I better off just using a separate set of pins as an i2c bus if I want a higher bus sped than 400khz.

Im sorry if these questions sound stupid I really need to read up alot more on i2c, I just havent had the need to use any i2c devices until now acually, most of the time im either using the props built in kind of peripherals or SPI chips and I have enough pins to just give the chip its own 3 pins all to itself.

Comments

  • jmgjmg Posts: 15,173
    edited 2012-10-17 02:55
    Next thing im a little hazy on is I know when the propeller loads the eeprom ob boot it only clock the i2c lne at 400khz right? So after the eeprom is loaded can the i2c bus be bumped up to 1.7mhz, so the i2c expander and Hi-eeprom can communicate with the propeller faster, Or am I better off just using a separate set of pins as an i2c bus if I want a higher bus sped than 400khz.

    It is always a good idea to start separate, and try to share later.

    The risk of going above the specified baud rate, is of confusing the wrong address and corrupting the EEPROM.

    If you can find a EEPROM that is specified to work at the higher speed, you have much less risk.
    1MBd seems easy to find, higher less so.
  • JonnyMacJonnyMac Posts: 9,108
    edited 2012-10-18 09:44
    I share the EEPROM buss with other devices all the time. That said, I agree that you probably shouldn't push buss speed above what the connected EEPROM will tolerate. I tend to use Spin for these things as the EEPROM write cycle is the time culprit and faster buss speed doesn't buy my projects anything. Yours may be different.
Sign In or Register to comment.