EmbDev.net

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


von David Walker (Guest)


Rate this post
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 
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

von rama g (Guest)


Rate this post
useful
not useful
You must configure IODIR register to 0

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.