Shop OBEX P1 Docs P2 Docs Learn Events
PCF8574 circuit question — Parallax Forums

PCF8574 circuit question

T ChapT Chap Posts: 4,223
edited 2008-10-14 01:41 in General Discussion
I may have done something backwards. First time using an expander as input, the documents say regarding the 8575 and 8574 that they are to be written high before being used as inputs. However writing them high, means they have 3.3 volts sitting on the pins at time of read, so this is really confusing. Whatever you write, is what you read. The only difference being if you force the pin to a lower or higher state than it was written to, so why no damage forcing the high to a low, or low to a high?

In the circuit below, I set the inputs to be pulled low with a 47k on each pin. When all pins are written high as instructed, the pins read over 1.5v.

Here are the I2C steps:

Start
Send address, write state + 0
Write all pins high %1111_1111
Send address, read state + 1
testbyte := i2c.i2cread(address, 1)
Stop

This produces %1111_1111 on read regardless of the buttons state, as it is seeing a voltage above it's threshold based on being written high previously, the 47k pull downs are not enough to drop it below the trigger level.

So I am now considering cutting some traces and reversing things, so the buttons pull down, and the resistor pulls up instead, reverse logic at the inputs.

It would be much simpler to replace the 6 req'd pull down's with a stronger pull, hopefully to get the voltage down below the trigger point.

I really don't get this concept of putting a high on pins you intend to read, I suppose it is just a compromise to allow it to both read and write.

Which way do I go to solve this guys?

Thanks
677 x 641 - 89K

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-14 00:28
    Follow the manufacturer's directions.· The I/O pin circuitry provides an easy way for the I/O pin to be used for output and input without a separate configuration register.· It has a strong pulldown to produce a logic low output and a weak pullup to produce a logic low output or to be used for input mode (with a built-in pullup).

    The I/O pin structure uses a weak pullup with a "booster" that provides a stronger pullup for a short time, then turns off.· After the I/O pin is written with a·1, the weak pullup remains in operation, but can easily be pulled down with any logic output or switch.· The weak pullup usually uses a current source, a circuit that supplies a specific maximum amount of current (often 150uA or something similar).
  • T ChapT Chap Posts: 4,223
    edited 2008-10-14 01:41
    Thanks for the ideas Mike. Yeah I read over their data sheet plenty, but just couldn't see how they were pulling up the output without damaging it when other inputs were connected.

    It was too much hassle to redo the schematic to put pullups on the pins, so I simply put 10k's where the 47k's were, which solved the problem with the inputs sitting above the trigger threshold.
Sign In or Register to comment.