Hello,
I work on TLC59116 LED driver and I want to drive group pins (for example pins 0, 1, 2 and 3) using register GPRPWM, I write value in this register, but my LEDs don't light. Can someone help me with this problem ?
Best regards,
Nikola
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello,
I work on TLC59116 LED driver and I want to drive group pins (for example pins 0, 1, 2 and 3) using register GPRPWM, I write value in this register, but my LEDs don't light. Can someone help me with this problem ?
Best regards,
Nikola
This is my schematic for this device. And my I2C interface working very well. When I write same value in register GRPPWM, after that I read same value which I wrote. But my group LEDs don't work. I do not see in the datasheet that it is necessary to another another register.
This is my schematics:
Thanks
Hi Nikola,
Would you try the attachment sample code?
Thanks!
Summer
/*
* TLC59116.c
*
* Created on: Dec 25, 2015
* Author: a0222632
*/
#include <msp430.h> // Generic MSP430 Device Include
#include "TLC59116.h"
uint8_t g_ui8TLC59116_DEFAULT_SETTING[] =
{
0x81, // MODE1
0x80, // MODE2
0x0F, // PWM0
0x10, // PWM1
0x15, // PWM2
0x20, // PWM3
0x25, // PWM4
0x30, // PWM5
0x35, // PWM6
0x40, // PWM7
0x45, // PWM8
0x50, // PWM9
0x55, // PWM10
0x60, // PWM11
0x65, // PWM12
0x70, // PWM13
0x75, // PWM14
0x80, // PWM15
0xFF, // GRPPWM
0x00, // GRPFREQ
0xFF, // LEDOUT0
0xFF, // LEDOUT1
0xFF, // LEDOUT2
0xFF, // LEDOUT3
};
bool
TLC59116_Init(uint8_t ui8Address)
{
//
// Init the UCB0 I2C Peripheral
//
UCB0_MasterI2C_init();
// Put reset pin high
P2OUT |= BIT2;
//
// Init TLC59116 (Default Configuration)
//
UCB0_I2C_write(ui8Address, (Auto_increment_all | MODE1), (uint8_t*)&g_ui8TLC59116_DEFAULT_SETTING, 24);
return true;
}
// ui8Brightness percentage of brightness 0 ~ 100
void TLC59116_Global_Brightness(uint8_t ui8Address, uint16_t ui16Brightness)
{
uint16_t g_ui16TLC59116_Temp;
g_ui16TLC59116_Temp = 0x80;
UCB0_I2C_write(ui8Address, (No_auto_increment | MODE2), (uint8_t*)&g_ui16TLC59116_Temp, 1);
g_ui16TLC59116_Temp = 0x00;
UCB0_I2C_write(ui8Address, (No_auto_increment | GRPFREQ), (uint8_t*)&g_ui16TLC59116_Temp, 1);
g_ui16TLC59116_Temp = ui16Brightness * 256 / 100;
UCB0_I2C_write(ui8Address, (No_auto_increment | GRPPWM), (uint8_t*)&g_ui16TLC59116_Temp, 1);
}
// ui16Blinking_period ms 0 ~ 10000
void TLC59116_Global_Blinking(uint8_t ui8Address, uint16_t ui16Blinking_period)
{
uint16_t g_ui16TLC59116_Temp;
g_ui16TLC59116_Temp = 0x20;
UCB0_I2C_write(ui8Address, (No_auto_increment | MODE2), (uint8_t*)&g_ui16TLC59116_Temp, 1);
g_ui16TLC59116_Temp = 0x7F;
UCB0_I2C_write(ui8Address, (No_auto_increment | GRPPWM), (uint8_t*)&g_ui16TLC59116_Temp, 1);
g_ui16TLC59116_Temp = ui16Blinking_period * 24 / 10 - 1;
UCB0_I2C_write(ui8Address, (No_auto_increment | GRPFREQ), (uint8_t*)&g_ui16TLC59116_Temp, 1);
}
uint8_t g_ui8TLC59116_ROLL_SETTING[16][16] =
{
{ 0x85 , 0x10 , 0x15 , 0x20 , 0x25 , 0x30 , 0x35 , 0x40 , 0x45 , 0x50 , 0x55 , 0x60 , 0x65 , 0x70 , 0x75 , 0x80 , },
{ 0x80 , 0x85 , 0x10 , 0x15 , 0x20 , 0x25 , 0x30 , 0x35 , 0x40 , 0x45 , 0x50 , 0x55 , 0x60 , 0x65 , 0x70 , 0x75 , },
{ 0x75 , 0x80 , 0x85 , 0x10 , 0x15 , 0x20 , 0x25 , 0x30 , 0x35 , 0x40 , 0x45 , 0x50 , 0x55 , 0x60 , 0x65 , 0x70 , },
{ 0x70 , 0x75 , 0x80 , 0x85 , 0x10 , 0x15 , 0x20 , 0x25 , 0x30 , 0x35 , 0x40 , 0x45 , 0x50 , 0x55 , 0x60 , 0x65 , },
{ 0x65 , 0x70 , 0x75 , 0x80 , 0x85 , 0x10 , 0x15 , 0x20 , 0x25 , 0x30 , 0x35 , 0x40 , 0x45 , 0x50 , 0x55 , 0x60 , },
{ 0x60 , 0x65 , 0x70 , 0x75 , 0x80 , 0x85 , 0x10 , 0x15 , 0x20 , 0x25 , 0x30 , 0x35 , 0x40 , 0x45 , 0x50 , 0x55 , },
{ 0x55 , 0x60 , 0x65 , 0x70 , 0x75 , 0x80 , 0x85 , 0x10 , 0x15 , 0x20 , 0x25 , 0x30 , 0x35 , 0x40 , 0x45 , 0x50 , },
{ 0x50 , 0x55 , 0x60 , 0x65 , 0x70 , 0x75 , 0x80 , 0x85 , 0x10 , 0x15 , 0x20 , 0x25 , 0x30 , 0x35 , 0x40 , 0x45 , },
{ 0x45 , 0x50 , 0x55 , 0x60 , 0x65 , 0x70 , 0x75 , 0x80 , 0x85 , 0x10 , 0x15 , 0x20 , 0x25 , 0x30 , 0x35 , 0x40 , },
{ 0x40 , 0x45 , 0x50 , 0x55 , 0x60 , 0x65 , 0x70 , 0x75 , 0x80 , 0x85 , 0x10 , 0x15 , 0x20 , 0x25 , 0x30 , 0x35 , },
{ 0x35 , 0x40 , 0x45 , 0x50 , 0x55 , 0x60 , 0x65 , 0x70 , 0x75 , 0x80 , 0x85 , 0x10 , 0x15 , 0x20 , 0x25 , 0x30 , },
{ 0x30 , 0x35 , 0x40 , 0x45 , 0x50 , 0x55 , 0x60 , 0x65 , 0x70 , 0x75 , 0x80 , 0x85 , 0x10 , 0x15 , 0x20 , 0x25 , },
{ 0x25 , 0x30 , 0x35 , 0x40 , 0x45 , 0x50 , 0x55 , 0x60 , 0x65 , 0x70 , 0x75 , 0x80 , 0x85 , 0x10 , 0x15 , 0x20 , },
{ 0x20 , 0x25 , 0x30 , 0x35 , 0x40 , 0x45 , 0x50 , 0x55 , 0x60 , 0x65 , 0x70 , 0x75 , 0x80 , 0x85 , 0x10 , 0x15 , },
{ 0x15 , 0x20 , 0x25 , 0x30 , 0x35 , 0x40 , 0x45 , 0x50 , 0x55 , 0x60 , 0x65 , 0x70 , 0x75 , 0x80 , 0x85 , 0x10 , },
{ 0x10 , 0x15 , 0x20 , 0x25 , 0x30 , 0x35 , 0x40 , 0x45 , 0x50 , 0x55 , 0x60 , 0x65 , 0x70 , 0x75 , 0x80 , 0x85 , },
};
void TLC59116_Wheel()
{
uint8_t g_ui8TLC59116_Temp;
uint8_t g_ui8index;
g_ui8TLC59116_Temp = 0x80;
UCB0_I2C_write(DEVICEALL_ADDR, (No_auto_increment | MODE2), (uint8_t*)&g_ui8TLC59116_Temp, 1);
for(g_ui8index = 0; g_ui8index < 16; g_ui8index++)
{
UCB0_I2C_write(DEVICEALL_ADDR, (Auto_increment_indi | PWM0), (uint8_t*)&g_ui8TLC59116_ROLL_SETTING[g_ui8index], 16);
__delay_cycles(250000);
}
}
Hi Nikola,
Could you post all your register value for the double confirm?
Thanks!
summer