1
1
1bd_1l_Bari2017-12-21 15:56:49
Programming
1bd_1l_Bari, 2017-12-21 15:56:49

How to connect mcp23017 to atmega via i2c?

Good afternoon. On the breadboard there is a port expander connected to the mega via the i2c interface. LEDs are connected to the legs of the expander. I won’t write all the code, I’ll write it in pseudocode I
initialize i2s,
Then start i2s,
Then send the expander address byte
Then send the high byte (0)
Then the low byte (0)
Then stop.
Today, having written the code according to this algorithm and setting the bits in this way, the LEDs lit up! But then I turned off the power from the breadboard, they went out. And when I turned on the power again, they no longer burn. What could be the matter?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Cyril, 2017-12-21
@argz

The state of the pins in the MCP23017 is not saved after power off. It must be re-configured every time after switching on.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question