Shop OBEX P1 Docs P2 Docs Learn Events
BS2 and LCD with IO expander — Parallax Forums

BS2 and LCD with IO expander

Nikhil VoraNikhil Vora Posts: 7
edited 2005-11-10 17:02 in BASIC Stamp
Hello,

I have seen an example of the MCP23016 IO expander intefaced with the the BS2p to control an LCD. It uses the I2COUT commands to control everything. The article is in the Nuts and Volts Magazine.
I was wondering if it is possible to use a BS2 with the MCP23016 to control an LCD, i.e, without using the I2COUT commands.

I would appreciate a reply.

Nikhil Vora

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-11-10 07:25
    Nikhil -

    It is absolutely possible. I2CIN and I2COUT are merely specialized commands which permit the programmer easier access to the statndard I2C interface.

    Those two commands had predecessor commands, SHIFTIN and SHIFTOUT, which also could be used with an I2C interface, just not quite as easily. It's not really that it's any more difficult to do, it's that there are more responsibilities which fall to the programmer when using the more basic commands SHIFIN and SHIFTOUT, rather than I2CIN and I2COUT.

    I will search around to see if I have any examples handy, but even if I don't I'm SURE there are others that have SHIFTIN / SHIFTOUT examples which access I2C devices.

    Regards,

    Bruce Bates
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-11-10 10:48
    Nikhil -

    Here is a program written by Jon Williams to access the Philips PCF8574A, an I2C device. This Philips chip·is a device similar in function·to the one you're working with, but they don't operate the same, insofar as·the internal registers are concerned! The prgram is wriiten for the Stamp BS-2.

    Regards,

    Bruce Bates
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-11-10 13:13
    Here's an I2C core that you can use on the BS2.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Nikhil VoraNikhil Vora Posts: 7
    edited 2005-11-10 15:58
    Thanks for the help, I will try understanding the code and use it with the LCD.

    -Nikhil Vora
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-11-10 16:05
    This article may help you get a handle on I2C for the BS2: http://www.parallax.com/dl/docs/cols/nv/vol5/col/nv115.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Tom-Matrix OrbitalTom-Matrix Orbital Posts: 38
    edited 2005-11-10 17:02
    Hi Nikhil,

    There are I2C appnotes for talking to a Matrix Orbital display at www.matrixorbital.ca/appnotes/basic_stamp/ .

    Best Regards,

    Tom Lam
Sign In or Register to comment.