I2c Converter

PCF8574 is 8-bit I2C/Parallel converter.
It is used in Arduino CPUs extend pins.
Expecially with LCD.
There is also a Microchip version of the program.

PCF8574.jpg
www.mjkdz.com.JPG

'= ===================
' here is Arduino version
'===================
How to find I2C address
from http://todbot.com/blog/2009/11/29/i2cscanner-pde-arduino-as-i2c-bus-scanner/

void scanI2CBus(byte from_addr, byte to_addr) {
byte data = 0; // not used, just a ptr to feed to twi_writeTo()
for( byte addr = from_addr; addr < = to_addr; addr++ ) {
byte rc = twi_writeTo(addr, &data, 0, 1, 0);
if( rc == 0 ) {
Serial.printl("Device found at address ");
Serial.println(addr,DEC);
}

}
}

Here is Microchip PIC version

#define LCD_SDA PIN_C4
#define LCD_SCL PIN_C3

#use i2c(master, sda= LCD_SDA, scl= LCD_SCL,FORCE_HW)
===============================================
look for i2c-address from OH3GDO
//===============================================

void scanI2CBus(byte from_addr, byte to_addr) {
unsigned int8 found;
unsigned int8 addr;
unsigned int8 data = 0; // not used, just a dummy data

for( addr = from_addr; addr < to_addr; addr++ )
{

i2C_start();
i2C_write( addr); // search address
i2C_write( 0); // command mode
found=i2C_write( 0); // data dummy
if( found== 0 ) {
printf("\r Device found at address 0x%x ",addr);

}
i2C_stop();

}
}

Here is Youtube picture

i2CLCD.jpg
Pekka OH3GDO
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License