Trying to connect mcp23017 to 16f877a using i2c

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
Richard
Posts: 9
Joined: Sun Jan 10, 2016 7:18 pm
Has thanked: 2 times
Been thanked: 4 times
Contact:

Trying to connect mcp23017 to 16f877a using i2c

Post by Richard »

Hi,

I am trying to connect 4 individual mcp23017 expansion chips to a 16f877a using I2C. I have dip switches for the A0, A1,A2 pins to set the address on each chip, with 5.6K pulldown resistors. The Reset pin on the 23017 is connected to 5v. I have pull-ups on the I2C lines. All I am using it for is to turn on an off 16 remote leds as a linear bar graph. There is no 23017 component in V6, so how do I simulate this. I have ordered the chips, but they aren't here yet, so I can't breadboard it to try it. Just trying to stay ahead of the game. Any help would be appreciated. Thanks in advance.

Richard

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Trying to connect mcp23017 to 16f877a using i2c

Post by Benj »

Hello Richard,

This blog post might help you with the I2C communications if you are unfamiliar with them.
https://www.matrixtsl.com/blog/simplifi ... c-and-spi/

A component would be nice but this is new functionality so may be done for v7 only. I'll have a think on it as it would be nice if it worked in simulation with LEDs and switches.

Richard
Posts: 9
Joined: Sun Jan 10, 2016 7:18 pm
Has thanked: 2 times
Been thanked: 4 times
Contact:

Re: Trying to connect mcp23017 to 16f877a using i2c

Post by Richard »

Thanks. I am familiar with I2C, but the 23017 is a little different as it has 2 internal registers for the ouputs, so it appears the "sendbytetransaction" won't work. I will just have to "transmitbyte" everything.

Richard

Post Reply