seems all to be correct! the moment you write a 1 to a pin, the pin pulls up with max. 1ma, while = the second fet is on. then, after a short time, this fet is turned off = and the pin only sources the 100ua from the other fet. so after writing a 1 to the pin, you can also use it as an input (with = integrated pull-up) tino >-----Original Message----- >From: Jan-Erik Soderholm [mailto:jan-erik.soderholm@TELIA.COM] >Sent: Friday, February 13, 2004 7:32 PM >To: PICLIST@MITVMA.MIT.EDU >Subject: Re: [PIC:] I2C with Philips PCF8574 remote 8-bit I/O expander > >John Plocher wrote : > >> I am starting to play with I2C and the 8574 I/O expander chip, >> and I am running into some of those "I don't think I understand >> the manual" types of problems. >> >> Manual: http://www-us.semiconductors.philips.com/pip/PCF8574.html >> >> I think I grok the cases where the chip is used as either 8 bits >> of input or 8 bits of output, but I am clueless about section 7.3, >> where it talks about using some pins as inputs at the same time that >> other pins are used as outputs. The reference to Figure 15 isn't >> helping. It sounds like the chip is mainly intended to be used as an >> "all inputs" or "all outputs" device, but it has some voodoo that >> can make it pretend to do mixed I/O if you line up various planets... > >It looks like when you want a pin to act as an input, you must >set it HIGH (which also is the power on state). In that case an = external >device may pull the pin HIGH or LOW (and when LOW, sink the >current from the 100uA currect source. You probably should take >care not to write a LOW to that pin in this case... > >When using a pin as output, you just send a HIGH or LOW to that >pin as you want. But note that when HIGH, it can only source 100uA >(I think)... > >Now, the thing I don't understand, is the extra FET that, when ON, >shorts the 100uA current source and ties the pin hard HIGH. But >this might be an missunderstanding... > >Anyway, on the URL you quoted above, are also AN469, which >better explains this. There are also a few very similiar devices >(from Philips) but with separate I/O-direction control registers >(also described in the AN469 app note). > >And, there are also the MCP23016, which is a very similar >device from Microchip. You cold get three free samples to play >with from them :-) > >> The other bit of confusion has to do with the "how are i2C slaves >> intended to be used" department. The timing diagrams imply that >> you can read a slave's data by either >> >> START, address-a-chip, READ, STOP >> or >> START, address-a-chip, READ, READ, READ, READ, ..., STOP >> >> In the second case, I'm assuming that since the 8574 only has a >> single 8-bit chunk of data to read, it simply resends the current >> (possibly changing) states as the READs are processed. > >As I understands it. > >> Or (and >> thus my confusion), is the multi-read case only for devices that >> have more than one byte of data to read? > >No, I don't think so. > >> Obviously, I'm missing something basic here - can anyone share a >> clue or two to help? > >I've never used the chip, just wild guessing :-) > >Regards >Jan-Erik. > >-- >http://www.piclist.com hint: The PICList is archived three different >ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads