Logo Banner
Decoration Picture

ELECTRONICS - [designs & projects] - [I²C board] - [page 3/8]

I²C expansion board

3. RESEARCH OF THE PCF8574
:: 3.1 Schematic

schematic diagram for the PCF8574

:: 3.2 The Powering
The IC "PCF8574" is made in a DIL-16 housing, a 16-pens IC. Powering it happens via Vdd (+5V) and Vss (0V, ground). It is important to connect all grounds to each other when having several devices, each with their own power supply.

:: 3.3 The I²C Interface
It's possible to connect the IC to the I²C bus, by using the pens SCL and SDA. This allows the IC to react to commands from a slave. Because these commands are address-based, this address must be set on the IC. This can be done with the pens A0, A1 and A2. This allows connecting 2³ or 8 PCF8574 controllers to the bus. Note that not the complete address can be set. The complete address for this IC is:

Addressing on the bus

:: 3.4 The I/O ports
The IC has 8 ports, which can work bidirectional. The ports itself provides no voltage, but are based on the principle of "open collector" outputs. You can imagine such I/O port as a electronic controlled switch, connecting/not connecting the I/O port with the ground. To be able to use the I/O port, a pull up resistor must be placed between the port and the +VCC.

Now there are 2 possible conditions: when the switch is closed, the current will flow via the resistor to the ground. The voltage at the output of the I/O port is 0 V, because it's connected with the ground via the switch. If the switch is open, there is no flow of current and at the output of the I/O port will be a voltage of +VCC. This principle is shown in the figure below.

Input/Output Port

With an I/O port, it's also possible to read the state of the switch: the I²C controller can read the voltage on an I/O pen, and determine the state. To do so, you need to add a switch S which connects the I/O port with the ground. The internal switch must be open so the output of the I/O port is high, when switch S is opened. When the switch S is closed, the voltage level on the I/O pen becomes low. This principle is shown in the picture below.

I/O input port

:: 3.5 Using interrupts
The interrupt allows you to programs with less processor load. A pulse is being generated when the signal at an I/O port changes (for example by a switch). When coupling this interrupt to the interrupt pen of the 8051, it becomes possible to make a function that is only called when a switch changes. In this case it's no longer required to read the switches all the time, and other tasks can run during this spared time.

previous - home - next

Copyright ©1998-2010 Vanderhaegen Bart - last update: June 01, 2009