I am struggling with reading the datasheet for the STLED316S 7-segment/Discrete LED driver IC.
I'm writing code for an STM32 chip, but also using Arduinos as well. I'm having no problems writing the code, but really struggling with interpreting the datasheet (apparently so are a number of other people according to a google search) to send the correct bits across the SPI interface.
Basically all I want to do is set the display to on, and then write in the value to the segments but I just don't really know where to start - is the data meant to be sent over one byte at a time, or strings of bytes? I'm not using the key interrupt at the moment, so fortunately that doesn't complicate too much.
The datasheet can be found here.
Any insight into this would be much appreciated.
Edit:
I think I may have made a little headway, but still don't think its correct.
Right, I think, although I could be horribly wrong, that I have it. No thanks to the datasheet, but fortunately another similar chip from ST (here) had a slightly better one with an example!
Okay, so:
- STB LOW
- Turn on display 00001101
- STB HIGH
- STB LOW
- Configure 7-segment display 00100000
- Set configuration 011111101 (Brightness 14/16, constant brightness, 6 digits in display)
- STB HIGH
- STB LOW
- Define address 00100000 (LED 2/7)
- Write bytes to turn on segments 11111110 (writes 8, no DP)
- Write byte to turn on segments of LED 3/7 11111110
- STB HIGH
I think it's what the datasheet is trying to say? The last 2 bytes go against what the datasheet says, but I don't really see any other way to write it... I think the rest is correct though.