It seems that the addressing bits do not prevent mirroring when using addresses seven and eight.
I am using the following for all mcl (mcp0 to mcp7) with mixed input and output. A simple test I ran showed that not declaring mcl.begin still allowed mirrored bits.
mcp5.gpioRegisterWriteByte(mcp0.IOCON, 0b00101000);//HAEN,SEQOP,MIRROR -remove mirror (ie INT pin connection)
mcp5.gpioRegisterWriteByte(mcp0.GPPU, 0xff, true);//pull-up only required input pins???
mcp5.gpioRegisterWriteWord(mcp0.GPINTEN, 0x1f1f);// enable interrupts on these
mcp5.gpioRegisterReadByte(mcp0.INTCAP); //read interrupt capture port A (it clear port)
mcp5.gpioRegisterReadByte(mcp0.INTCAP + 1);//read interrupt capture port B (it clear port)
Hi there,
It seems that the addressing bits do not prevent mirroring when using addresses seven and eight. I am using the following for all mcl (mcp0 to mcp7) with mixed input and output. A simple test I ran showed that not declaring mcl.begin still allowed mirrored bits. mcp5.gpioRegisterWriteByte(mcp0.IOCON, 0b00101000);//HAEN,SEQOP,MIRROR -remove mirror (ie INT pin connection) mcp5.gpioRegisterWriteByte(mcp0.GPPU, 0xff, true);//pull-up only required input pins??? mcp5.gpioRegisterWriteWord(mcp0.GPINTEN, 0x1f1f);// enable interrupts on these mcp5.gpioRegisterReadByte(mcp0.INTCAP); //read interrupt capture port A (it clear port) mcp5.gpioRegisterReadByte(mcp0.INTCAP + 1);//read interrupt capture port B (it clear port)