On Tue, 1 Nov 2005, James Newton, Host wrote: >> I think that if you set them high & then use them as inputs >> you are OK. If you only read from them then the high current >> pulse output is not enabled. The only time it is enabled is >> if you are writing to them as outputs and are going through a >> low-high transistion. > > Right, but how does one avoid writing a 1 to the pins you are using as > inputs while at the exact same time writing 1's or 0's to the other pins > which you are using as outputs? You do write 1s to the pins used as inputs, during their being read. Then you write them back as zeros. be Mi an input mask (1s for any input bits) and Ro an output shadow register (has 0 or 1 for any output bits and 0s for any input bits), then: read_inputs: Sdata = Mi | Ro write_i2c Sdata ; turn on inputs which are not held low Temp = read_i2c & Mi ; inputs only write_i2c Ro ; turn off input pullups return All data is on 16 bits in this scheme. The internal schematic of the 8575 does not seem to reflect the Schmitt scheme I wrote about but I think I am right about it. Maybe this variant does not have the schmitt scheme. Peter -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist