Any good goide for reading and understanding datsheets for SPI interface?
CuriousOne
Posts: 931
Hello.
I'm experimenting with various SPI devices and basic stamp. EEPROMs, temperature sensors, display drivers, all are fine. However, the problem is that I don't understand (since used ready made code) how the description of commands in datasheet, is transformed into apropriate SHIFTIN, SHIFTOUT statements? I've read the wiki article about SPI and I know how it works in terms of electric connection, signal polarity, and so on.
For example, I there's high precision, 48 channel PWM generator from linear - http://www.linear.com/product/LT8500 it is SPI driven, and considering it's capabilities, I'd like to use it for polyphonic synthesizer. But I have trouble understanding datasheet parts to convert into SHIFTOUT and so on.
I'm experimenting with various SPI devices and basic stamp. EEPROMs, temperature sensors, display drivers, all are fine. However, the problem is that I don't understand (since used ready made code) how the description of commands in datasheet, is transformed into apropriate SHIFTIN, SHIFTOUT statements? I've read the wiki article about SPI and I know how it works in terms of electric connection, signal polarity, and so on.
For example, I there's high precision, 48 channel PWM generator from linear - http://www.linear.com/product/LT8500 it is SPI driven, and considering it's capabilities, I'd like to use it for polyphonic synthesizer. But I have trouble understanding datasheet parts to convert into SHIFTOUT and so on.
Comments
Page 11 of the datasheet shows it is very simple, just clock in a total of 584 bits of data per chip = 73 x 8 bits if your SHIFTOUT uses 8-bit shifts and then as it shows just pulse the LDI line anytime you are ready which will cause it to load all those 585 bits from the serial to parallel shift register (if it is that) into the output register. SPI is always simple, just send one bit at a time and clock it until you have the correct number of bits to pulse or toggle some load or chip enable line.
BTW, don't expect a very fast update rate with the BS at all and adding more chips to the daisy chain just means you need to clock multiples of 73 SHIFTOUTs before the LDI which will only slow it down more.