Buffer can be defined with a 2D array:
volatile uint8_t buffer[4][4] =
{{B0000, B0000, B0000, B0000},
{0x0, 0x0, 0x0, 0x0},
{0x0, 0x0, 0x0, 0x0},
{0x0, 0x0, 0x0, 0x0}};
First dimension is [z] and gives a 1D array: {0x0, 0x0, 0x0, 0x0}.
Second dimension is [y] and gives a byte.
Each bit of this byte [x] defines the LED status.
Buffer can also be defined as 1D array:
volatile uint16_t buffer[4] = {0x0000, 0x0000, 0x0000, 0x0000};
Array index [z] gives a 16-bit byte.
Each byte contains LED status in four group [y] of 4-bit chunks [x].
Tests were run with each buffer architecture and consisted of driving the 164 SR to set the 16 anodes using the buffer.
2D 8-bit buffer: 159us
1D 16-bit buffer: 271us
This code is critical since it represents the time the cube is fully off thus affecting the duty cycle.
Buffer can be defined with a 2D array: volatile uint8_t buffer[4][4] = {{B0000, B0000, B0000, B0000}, {0x0, 0x0, 0x0, 0x0}, {0x0, 0x0, 0x0, 0x0}, {0x0, 0x0, 0x0, 0x0}}; First dimension is [z] and gives a 1D array: {0x0, 0x0, 0x0, 0x0}. Second dimension is [y] and gives a byte. Each bit of this byte [x] defines the LED status.
Buffer can also be defined as 1D array: volatile uint16_t buffer[4] = {0x0000, 0x0000, 0x0000, 0x0000}; Array index [z] gives a 16-bit byte. Each byte contains LED status in four group [y] of 4-bit chunks [x].
Tests were run with each buffer architecture and consisted of driving the 164 SR to set the 16 anodes using the buffer.
2D 8-bit buffer: 159us 1D 16-bit buffer: 271us
This code is critical since it represents the time the cube is fully off thus affecting the duty cycle.