MCP23016 I2C serial I/O expander chip


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Location
    Arvada Colorado
    Posts
    31

    Default Ok ok

    Thanks Jeff.............
    An email to melabs support got me the answer. Here it is:
    I2Cread portc.4, portc.3, %01000000, command, [insin], noitwoc

    Where command is what register you want to read 0 or 1. Now I get the value of the I/O expansion chip into the variable insin. Just missed the brackets around the variable name!

    Now I'm trying to figure out the write command. Some difficulties, I'll post my results. Hope this helps someone. This is a nice chip set. The I/O's on pics go fast. Faster and faster the deeper I get into designing with them.

    Joe

  2. #2
    Join Date
    Feb 2006
    Location
    Arvada Colorado
    Posts
    31

    Default Reading and writing successfully

    i2cwrite portc.4, portc.3, %01000010, %00000111, [%00000000] ' SET U9 PORT 1 TO OUTPUTS
    i2cwrite portc.4, portc.3, %01000010, %00000011, [acout] ' WRITE VARIABL ACout TO U9 PORT 1 LATCH REGISTER
    insin = 0
    i2cread portc.4, portc.3, %01000000,[insin]', noitwoc ' READ U8 PORT 0 AND 1 PIN STATES
    i2cread portc.4, portc.3, %01000010, %00000000, [inson] ' READ U9 PORT 0 PIN STATES

    Here are the write and read lines I've found to be successful with the MCP23016 I/O expander chip.

    Use in good health.

Similar Threads

  1. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 23:31
  2. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 22:07
  3. MCP23016 I/O expander
    By Demon in forum mel PIC BASIC Pro
    Replies: 42
    Last Post: - 24th October 2005, 02:01
  4. MCP23016 I/O expander with PBP?
    By Jon Chandler in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 22nd August 2005, 10:32
  5. I2C I/O Expander PCF8574 hanging?
    By NavMicroSystems in forum Serial
    Replies: 12
    Last Post: - 4th August 2005, 03:26

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts