Microcontroller to interface with Led Driver

536 views Asked by At

My knowledge of Micro-controllers is fairly limited at this point, but here goes.

I have an Led Driver PT6959 which I'm trying to interface with. Data is read serially by the Driver IC on the input CLK rising edge once the STB input line goes low.

My question is, how do I know what the input CLK frequency should be?

Does it matter? Or should it be the same as the Led Driver OSC Pin frequency?

I've read the datasheet but can't find any reference to specifying an input CLK frequency.

2

There are 2 answers

0
Clifford On BEST ANSWER

If your microcontroller has a SPI port, connect as follows:

DIN <-- SPI-MOSI
CLK <-- SPI-CLK
STB <-- CS (often just a GPIO rather than a dedicated SPI chipselect)

The SPI peripheral will then do most of the work for you. Most SPI peripherals allow different combinations of polarity and phase known as modes:

Mode  CPOL  CPHA
0     0     0
1     0     1
2     1     0
3     1     1

The PT6959 operates in mode 3.

The clock rate is probably not be critical. If you are bit-banging it rather than using SPI, it need not even be periodic or fixed - it is the state of DIN on rising and falling edges that is critical - not the frequency. The device will have some maximum rate - the data sheet specifies this in terms of minimum mark/space widths of >=400ns, assuming a 50% mark:space, that would correspond to 1.25MHz, but there is little benefit in operating at the maximum speed.

3
Ruslan Gerasimov On

I have found it finally here the bigger datasheet fourteen (14) pages, not three.

So the time constraints for this signal as below,

PW CLK (Clock Pulse Width) ≥ 400ns
t setup (Data Setup Time) ≥ 100ns
t CLK-STB (Clock - Strobe Time) ≥ 1μs
t TZH (Rise Time) ≤ 1μs
t TZL < 1μs
V1.7
PW STB (Strobe Pulse Width) ≥ 1μs
t hold (Data Hold Time) ≥ 100ns
t THZ (Fall Time) ≤ 10μ
fosc=Oscillation Frequency
t TLZ < 10μs

As you can see the minimum clock pulse can be as 400ns which means the maximum clock frequency can found as 1/(2x400x10-9) = 1250000Hz (1.25Mhz)

Other calculations you can do the same way. But, yes, it is everything needed better covered at time-diagrams, which are given in the document above. I place them here just in case the link can die one day.

enter image description here enter image description here enter image description here