I have a Nano set up to connect to a MCP23017 using the adafruit library to connect
when I try the sketch on the Nano it locks up at the mcp.beginei2c() line.
for reference I am also using the i2cscanner sketch.
now just to check to see i connected it to a uno board same sketches and everything works.
I would start by checking each board to determine which is SCL and SDA, not all are the same. Connect A4 to A4 and A5 goes to A5, they do not cross. Be sure to connect the grounds, but if both the Uno and Nano are connected by their USB don't connect the 5V together. You may need external pull up resistors (4.7K). Not knowing your physical layout you may need to add the pull up resistors. Your schematic does not show both as the same. I may be wrong as there are several different board assemblies available. I have always done the following:
Connect SCL to SCL pin (analog 5 on Arduino UNO to analog 5 on Nano)
Connect SDA to SDA pin (analog 4 on Arduino UNO to analog 4 on Nano)
some explanation on the diagram
these are 2 different circuits
1 is the uno to the mcp23017 and associated wiring this circuit works IRL (In Real Life)
the other is the nano to the mcp23017 and associated wiring this circuit does not work IRL
they are wired the same the scl to A5 and sda to a4
(nano and uno ports are the same)
so unless there is something in the internal pull up resistors on the nano i cant figure out what is different
Try external pull up resistors, my nano does not have them. You need something between 2K to 10K depending on bus capacitance. Default for most is 4.7K. The analog pins do not have pull up resistors, they are open drain outputs.