Hi. Started playing with 3.1 lib on a sam3x (due) board.

Hi.

Started playing with 3.1 lib on a sam3x (due) board.
I’m adding some custom hardware (CPLD) to drive multiple strips and reduce CPU load, but before I do this I’m verifying the output using a logic analyzer and a ws2812b software decoder.

The driver is WS2812B which instantiates arm\sam\clockless_arm_sam.h.

So far so good, but I’ve noticed an odd issue which I’m still looking into. Just wondered if anybody else had come across it.

If I set up two LEDs like this :

leds[0] = CRGB(0x00,0x01,0x02);
leds[1] = CRGB(0xfd,0xfe,0xff);

Overall brightness is set to 255. No compensation etc so I would expect a 1:1 mapping to the output.

The analyzer, - and now prints in the driver - show some dithering behaviour which I would not expect to be there at max brightness - toggling between two states:

showRGBInternal p0 0 1 2
showRGBInternal p1 252 254 254
leds 4 scale r:$255 g:255 b:255

showRGBInternal p0 0 0 1
showRGBInternal p1 253 253 254
leds 4 scale r:$255 g:255 b:255

showRGBInternal p0 0 1 2
showRGBInternal p1 252 254 254
leds 4 scale r:$255 g:255 b:255

It looks like a 255/256 scaling issue perhaps? I’ll chase it more this evening.

Thanks for a super lib, very easy to get started with it.
Cheers,
Mike

oh, if I disable dithering completely, I get the 0,0,1 / 253,253,254 output consistently, so suspect it is scaled when it shouldn’t?

You’re running an older version of the library - grab the latest master branch off of github.

Ah, oops. I’ll update and recheck, thanks.

Updated to bleeding edge. Better, but still slightly off. 0/255 are always correct now.

showRGBInternal p1 253 255 255
showRGBInternal p0 0 1 2
showRGBInternal p1 254 254 255
showRGBInternal p0 0 2 3
showRGBInternal p1 253 255 255
showRGBInternal p0 0 1 2

I’m chasing it. It’s not an issue of course visually, I only spotted it while debugging the hardware.

Ah, just found your scale 8 post. It’s as expected then (and you fixed the end points). understand the performance trade offs. Thanks.

I think I might know what’s happening here - I’ll look more tonight

no- scale8 itself is fully fixed - what you’re seeing is dithering in action, when it shouldn’t be at a scale of 255/255/255 - I need to dig into why, still