Hi,
I am trying to make my new design work using a TLC59108F.
Using I2C bus, I can write the reset bus command and I can also write to any internal register and they all read back OK.
Nevertheless, the outputs will never react to any of my commands. I tried pulling up pin 14 with 1K resistor, no reaction, it always stays up to 5V.
I tried 2 different parts in case one of them would be broken.
I wonder what I could be missing...
I have attached a sch of my design. The code I tried is as follows:
void Write_TLC59108 ()
{
char buf[OUTBUFSIZE];
char Arr[24];
errno = 0;
ioctl(i2cDrvFp, I2C_SLAVE, 0x4B); // Set TLC59108 I2C bus reset address "1001 011+(R/W)".
usleep(100);
sched_yield();
errno = 0;
buf[0] = 0xA5; // I2C software Reset byte 1.
buf[1] = 0x5A; // I2C software Reset byte 2.
write(i2cDrvFp, buf, 2);
usleep(10000);
sched_yield();
errno = 0;
ioctl(i2cDrvFp, I2C_SLAVE, 0x47); // Set TLC59108 I2C ctrl address "1000 111+(R/W)".
usleep(100);
sched_yield();
buf[0] = 0x80; // Set MODE1 reg adr.
memset(Arr, 0, 24);
write(i2cDrvFp, buf, 1);
read(i2cDrvFp, Arr, 20);
errno = 0;
buf[0] = 0x0C;
buf[1] = 0x55;
write(i2cDrvFp, buf, 2);
usleep(100);
sched_yield();
errno = 0;
buf[0] = 0x80;
memset(Arr, 0, 24);
write(i2cDrvFp, buf, 1);
read(i2cDrvFp, Arr, 20);
errno = 0;
buf[0] = 0x0C;
buf[1] = 0;
write(i2cDrvFp, buf, 2);
usleep(100);
sched_yield();
errno = 0;
buf[0] = 0x80;
memset(Arr, 0, 24);
write(i2cDrvFp, buf, 1);
read(i2cDrvFp, Arr, 20);
errno = 0;
buf[0] = 0x0C;
buf[1] = 0xFF;
write(i2cDrvFp, buf, 2);
usleep(100);
sched_yield();
errno = 0;
buf[0] = 0x80;
memset(Arr, 0, 24);
write(i2cDrvFp, buf, 1);
read(i2cDrvFp, Arr, 20);
errno = 0;
buf[0] = 0x0D;
buf[1] = 0x55;
write(i2cDrvFp, buf, 2);
usleep(100);
sched_yield();
errno = 0;
buf[0] = 0x80;
memset(Arr, 0, 24);
write(i2cDrvFp, buf, 1);
read(i2cDrvFp, Arr, 20);
errno = 0;
buf[0] = 0x0D;
buf[1] = 0xFF;
write(i2cDrvFp, buf, 2);
usleep(100);
sched_yield();
errno = 0;
buf[0] = 0x80;
memset(Arr, 0, 24);
write(i2cDrvFp, buf, 1);
read(i2cDrvFp, Arr, 20);
errno = 0;
ioctl(i2cDrvFp, I2C_SLAVE, 0x4B); // Set TLC59108 I2C bus reset address "1001 011+(R/W)".
usleep(100);
sched_yield();
buf[0] = 0xA5; // I2C software Reset byte 1.
buf[1] = 0x5A; // I2C software Reset byte 2.
write(i2cDrvFp, buf, 2);
usleep(10000);
sched_yield();
ioctl(i2cDrvFp, I2C_SLAVE, 0x47); // Set TLC59108 I2C ctrl address "1000 111+(R/W)".
buf[0] = 0x80;
memset(Arr, 0, 24);
write(i2cDrvFp, buf, 1);
read(i2cDrvFp, Arr, 20);
errno = 0;
buf[0] = 0x0D; //
buf[1] = 0xFF; //
write(i2cDrvFp, buf, 2);
usleep(100);
sched_yield();
errno = 0;
buf[0] = 0x80;
memset(Arr, 0, 24);
write(i2cDrvFp, buf, 1);
read(i2cDrvFp, Arr, 20);
errno = 0;
}