Forum: µC & Digital Electronics MCP23017 GPIO & OLAT problems

Author: David Walker (Guest)
Posted on:

Rate this post
0 useful
not useful
Ich am testing the MCP23017 for a large project, and am writing 0x28 to 
OLATB & GPIOB (defined in IODIRB as  Output) and then read what is in 
the  MCP23017 GPIOB and OLATB registers ..and that's absolutely zero !!

IOCON.BANK=1 mode >>NOTE<<, therefore the "unusual" addresses), & GPIOB 
is set up as 8 x output by IODIRB (0x00)

we write test pattern 0x28 to GPIOB & OLATB (@ 0x19, @0x1A)

Diagnostic-Messages activated                  my comments below
-----------------------------------             --------------------
I2C: Device 0x21 wrote 0x28 to register 0x19    >> GPIOB write (set = 1)
I2C: Device 0x21 wrote 0x28 to register 0x1A    >> OLATB write (set = 1)

I2C: Device 0x21 returned 0x00 from reg 0x19 << read von GPIOB, noch 
I2C: Device 0x21 returned 0x00 from reg 0x1A  << read vom OLATB

these are 4 diagnostic messagesfrom 4 consecutive program read/write 
calls (Python 2.7). As can be seen,  the value 0x28 disappears 
immediately , reads to GPIOB and OLATB return  0x00 every time.

Anyone experienced anything similar??

I tried writing only to OLATB (see Datasheet,  Latches Register) but it 
made no difference to GPIOB or OLATB, also tried 100 msec delays between 
calls, no change


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.