new on i/o expander

Discussion in 'The Projects Forum' started by solehin robian, Mar 16, 2014.

  1. solehin robian

    Thread Starter New Member

    Jan 27, 2014
    i'm working on project of development an electronic abacus. I used assembly on pic16f877a as micro controller. i have encounter a problem where this pic does not have enough i/o pins needed that is total about 65 input pins and 10 pins for output. i have find many solution like using mux or multiple pic.but i have find one solution that attract my interest that is using i/o expander. but the problem is i have no idea how to use it in assembly coding in order to declare the i/o expander. i really hope there is someone can help me solving this problem
  2. GopherT

    AAC Fanatic!

    Nov 23, 2012
    Why would this solution attract your attention if it is too complicated for you to understand? What can this solution do that a multiplexer cannot do?
    Last edited: Mar 16, 2014
  3. spinnaker

    AAC Fanatic!

    Oct 29, 2009
  4. AnalogKid

    Distinguished Member

    Aug 1, 2013
    The nice thing about I/O expanders, such as the ones for the I2C bus, is that you get all of the I/O connections you need using only two pins on the PIC. Two problems, first is the additional programming load, which can be significant. Another is speed. You have to scan all inputs constantly, and fast enough not to miss anything. The I2C protocol adds delays that can add up to missing inputs.

    Using multiplexer chips, you still have the timing to worry about. But the programming is much easier and the time delays should be much shorter. The 877 has more than enough I/O pins to do this. Your 10 output lines can be dedicated with no external demux or switching. If you can reduce the number of inputs to 64, then that takes 7 pins best-case, 6 for address and one for the input. For less work and more speed, bring the inputs in 8 at a time with 11 pins, 3 for address and 8 for inputs. In this case the external multiplexers aren't true mux chips, just tri-state drivers.