Shop OBEX P1 Docs P2 Docs Learn Events
Any good goide for reading and understanding datsheets for SPI interface? — Parallax Forums

Any good goide for reading and understanding datsheets for SPI interface?

CuriousOneCuriousOne Posts: 931
edited 2014-08-10 02:05 in General Discussion
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.

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-08-10 01:57
    CuriousOne wrote: »
    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.

    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.
  • CuriousOneCuriousOne Posts: 931
    edited 2014-08-10 02:05
    For particular chip, data will be loaded only once at startup - there will be 12 oscillator groups, 4 channels in each, which will generate the base 12 notes. Other notes will be achieved by using simple frequency divider IC.
Sign In or Register to comment.