miandehe / Arduino-TLC5973

6 stars 3 forks source link

Not working with arduino uno #2

Open hirani89 opened 7 years ago

hirani89 commented 7 years ago

Hi @miandehe ,

I can't get the library to work with an arduino. Is there some special wiring? I wired the circuit as shown in the datasheet.

reganface commented 5 years ago

@hirani89 did you ever get it to work?

reganface commented 5 years ago

Figured out my issue. I had to add two more nop commands to the writeZero() method as the timing was off. This was for an AtMega328P. I would imagine this might be slightly different for different microcontrollers.

void TLC5973::writeZero() {
    pulse();
    NOP;
    NOP;
    NOP;
    NOP;
}
JoostDN commented 3 years ago

I guess this depends on the compiler. I had to double the amount of NOPs to for both writeZero and writeNone

void TLC5973::writeNone(){
    NOP;
    NOP;
    NOP;
    NOP;
    NOP;
    NOP;
    NOP;
    NOP;
}