Hvilken processor bruger du?
Asm, C eller noget helt andet?
http://ww1.microchip.com/downloads/en/DeviceDoc/21952b.pdfUmiddelbart virker det som om BANK bit vælger mellem tabel 1.3 og 1.4 samt 1.5 og 1.6
Hvor de cyane farved er dem der er forskellige afhængig at bank bit
Måske Evaluation boardet kan inspirer ... der er C kode med
http://www.microchip.com/DevelopmentTools/ProductDetails.aspx?PartNO=mcp23x17ev#dtDocumentationThe BANK bit changes how the registers are mapped
(see Table 1-5 and Table 1-6 for more details).
• If BANK = 1, the registers associated with each
port are segregated. Registers associated with
PORTA are mapped from address 00h - 0Ah and
registers associated with PORTB are mapped
from 10h - 1Ah.
• If BANK = 0, the A/B registers are paired. For
example, IODIRA is mapped to address 00h and
IODIRB is mapped to the next address (address
01h). The mapping for all registers is from 00h -
15h.
It is important to take care when changing the BANK bit
as the address mapping changes after the byte is
clocked into the device. The address pointer may point
to an invalid location after the bit is modified.
For example, if the device is configured to
automatically increment its internal Address Pointer,
the following scenario would occur:
• BANK = 0
• Write 80h to address 0Ah (IOCON) to set the
BANK bit
• Once the write completes, the internal address
now points to 0Bh which is an invalid address
when the BANK bit is set.
For this reason, it is advised to only perform byte writes
to this register when changing the BANK bit.