Did some more "perfect scenario" calculations for the possible frame rates, after failing math hard at supercon, thinking that I am sending out half a million bytes for a frame on the cube.
- 12 displays
- 192 bytes of data - 12x16 pwm values for 64 LEDs, even though I'm using only 51 LEDs
- every byte is followed by an ACK from the peripheral
So we have 12 * 192 * 9 bits to fly over of raw data, not including addressing and setting PWM page. At a 400kHz clock speed or 400000 bits/s we arrive at a hypothetical 19.3 fps.
What did I change to get here? After sending the data for the LEDs in bursts, I arrived at roughly 10fps and hooked the cube up to the oscilloscope to see what's going on. Turned out the clock was at roughly 200kHz instead of the expected 400kHz o.o
This might look very obvious at first sight to some, but the spikes aren't supposed to look like this and there is this magical thing that you can add to I2C lines, when it looks like that - I forgot about pull-up resistors! To allow for a fast rise you need resistors connected to VCC to help rise the potential of the capacitive natured data and clock line. To be honest I have no idea how to better explain this, but I hope the image helps a bit.
I've added 2.2k resistors to the module and suddenly arrived at 16fps! I might be able to go even faster with a different controller, but I still like the XIAO NRF52840 sense too much with all its features that I have yet to use :D