TLC59208F anyone know how to use this thing?

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is an LED driver with brightness control.

I have it kind of working, but I can't write to a single register, I can only write with autoincrement on and writing multiple registers.

 

I'm hoping someone has figured it out.

It could be my i2c driver I suppose....

 

 

Here's the data sheet;

http://www.ti.com/general/docs/l...

Keith Vasilakes

Firmware engineer

Minnesota

Last Edited: Wed. Jan 7, 2015 - 06:37 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, it appears to be straight-up I2C. Reading and writing a register is one of the most fundamental things to do after proper addressing and ack/nak recognition.

 

First, can you read a single register?

 

Second, there has to be a distinction between the end of a single write and and the end of the first write in a multiple write sequence. Are you terminating that single write properly?

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

//--------------------------
void spiout8(char c){
//send c out spi
char stat,cnt;

  SPDR=c; //char to spi    
  cnt=0;
  do{
    stat=SPSR;
    cnt++;
    if(cnt==255){
      cprintf("spi write timeout! ");
      break;
    }
  }while((stat & 0x80)==0);
}

//------TLC59282 16 ch const current led driver----------
#define LATHI() PORTF |=  0x02 //pf1
#define LATLO() PORTF &= ~0x02
//----------------------------
void updateledspacked(void){
//update leds on spi
//ledpacked are hi bit first. Sent out spi lsb first 3,2,1,0
unsigned int n;

 for(n=0; n < 4; n++){
   spiout8(ledpacked[3-n]);
 }
 LATHI(); //shake the latch line
 LATLO();
}
 

I had 2 of the 16 bit chips (32 leds) in series, so this routine sends 4 bytes then shakes the latch,

 

Imagecraft compiler user

Last Edited: Sat. Jan 10, 2015 - 08:49 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Keith,

 

It looks like regular I2C protocol.    Auto-increment is generally the most convenient way to access multiple registers.

OTOH,   you can do it one at a time if you want.

 

I suspect that your I2C device will work much the same as Bob's SPI device.     But you might need to smoke a bit before you reach Bob's consciousness level.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My crystal ball said the commands are probably similar. Same led driver, different io

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm suspecting my I2C driver.

What do you guys use?

ATMega164 and C or C++

Keith Vasilakes

Firmware engineer

Minnesota