MCP23017 GPIO & OLAT problems

Guest #3548870
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 
0x00!!
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

Reply

A question of your own? This thread is over 12 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.