yes and no, i have checked the code, but not very in deep.My question :
Have you gone through the source code of MBI5026 driver? Is it working? Is the driver maintaining soft PWM properly?
I have doubt on it. I don’t think it is working and it can support 8bit and 10 bit PWM.
The code does PWM at 10bit, other bit depth is configurable changing the Led.h file.
The resistor measurement as asked should give responce to the flaw into the pwm source.
Annother thing, the pwm code is not made specifically for leds, it´s standard pwm code.
The code for PWM should be this, but there is some question that i don´t have investigated,
here as sort of pseudocode that are not 100% accurate (X and Y may be inverted, .... ).
Code: Select all
for(MUX=0;MUX<LED_MUX;MUX++) {
memset(drivebuf,sizeof(drivebuf),0);
for(X=0;X<LED_X;X++) {
for(Y=0;Y*LED_MUX<LED_Y;Y++) {
outval=dot_adj(X,Y*MUX,gamma_adj(color_adj(buffer[X][Y*MUX])));
if (~outval&0x200) // bit9 == low
for (i=0; i<9; i++,outval >>= 1)
drivebuf[i][X] |= ( (outval & 1) << (Y) );
else // bit9 == high
outval >>= 9;
drivebuf[9][X] |= ( (outval & 1) << (Y) );
}}
spi_addr=MUX;
for(i=0;i<10;i++) {
output_drivebuf_to_pins(i);
delay_led(1<<i);
}
}
The impression for making such a hardcoding if bit9 is set force the other
bits to be zero is that either the cpu otherwise run out of time or alternativly
to limit the led duty cycle and it´s intensity to max 50%.