I'm really close to driving these LEDs over SPI. I'm sending the bytes to the AVR serial console and the SPI module simultaneously.
Every time I send the bytes, the 3 LEDs act quite randomly and or at least mostly random... so close!.
Code: Select all
spi_out.data_in = ledArrayManager.tx_data;
spi_out.start = ledArrayManager.new_tx;
avr.new_tx_data = ledArrayManager.new_tx;
avr.tx_data = ledArrayManager.tx_data;
It reads in starting at the last byte in the array....
data2 = {.............8hff, 8b0, 8b0, 8h1e, 8he3, 8b0, 8b0, 8b0, 8he3, 8b0, 8b0, 8h1e, 8he3, 8b0, 8b0, 8b0, 8b0};
The APA102 data protocol is described here: https://cpldcpu.wordpress.com/2014/11/3 ... -superled/
I've tried a bunch of mixing the bytes around with no avail... The 32 0s start frame is most important. I think it's a problem with interfacing with the SPI module.
- as 32 bits of 0s for the start of the sequence
- followed by a 32 bits per LED frame of 3 bits (111) and 5 bits (brightness), and 1 byte per R,G,B...
- followed by 32 bits of 1 or 0 depending on what you read