2 Replies Latest reply on Jun 10, 2016 2:45 AM by m_h

    D2000 SPI word/frame size

    m_h

      Can somebody tell me how to set the word size when using the D2000 as the SPI master?

       

      The January 2016 version of the D2000 datasheet specifies "4 bit to 32 bit Frame Size" under the feature list for SPI (section 15.2).

       

      In section 15.3.1.1, the specification for Control Register 0 (CTRLR0) there is a "Data Frame Size in 32-bit mode (DFS_32)" field that makes reference to "SSI_MAX_XFER_SIZE", but I have failed to find any more info on this, i.e. what register it is in, or how to set it. From reading between the lines I would assume that this SSI_MAX_XFER_SIZE sets the word size...

        • 1. Re: D2000 SPI word/frame size
          MichelleC_Intel

          Have you had a look at the 'SPI' example provided in ISSM ? This includes an example of how to set the Frame Size - 8-bit in this case. Is this what you are looking for ?

           

          /*  Initialise SPI configuration */
          cfg.frame_size = QM_SPI_FRAME_SIZE_8_BIT;
          cfg.transfer_mode = QM_SPI_TMOD_TX_RX;
          cfg.bus_mode = QM_SPI_BMODE_0;
          cfg.clk_divider = SPI_CLOCK_DIV;

           

          qm_spi_set_config(QM_SPI_MST_0, &cfg);

           

          The QMSI API documentation has some further information and is available within the ISSM package - or can be downloaded here Download Intel® Quark™ Microcontroller Software Interface

          1 of 1 people found this helpful
          • 2. Re: D2000 SPI word/frame size
            m_h

            Thanks Michelle.

             

            I had seen that ISSM example. Digging deeper I see that cfg.frame_size sets the "Data Frame Size in 32-bit mode (DFS_32)" field in Control Register 0 (CTRLR0). It's the description of this field that had/has me confused. Maybe it's just me, but I don't find it particularly clear, especially the part I've bolded. Especially given that I can find no other reference to SSI_MAX_XFER_SIZE anywhere in the D2000 documentation.

            Used to select the data frame length in 32 bit mode. These bits are only valid when SSI_MAX_XFER_SIZE is configured to 32. When the data frame size is programmed to be less than 32-bits, the receive data is automatically right-justified by the receive logic, with the upper bits of the receive FIFO zero-padded. Transmit data must be right-justified by the user before writing into the transmit FIFO. The transmit logic will ignore the upper unused bits when transmitting the data.

            As an example contrast this with the Data Size Select (DSS) field of SPI Control Register 0 (SSCR0) for the X1000 (see section 20.5.1 on page 807 here: http://www.intel.ie/content/dam/www/public/us/en/documents/datasheets/quark-x1000-datasheet.pdf).

             

            All that said, it's not going to worry me for now. I was just grasping at straws that the word size might be causing a timing issue I'm seeing when trying to communicate with another MCU over SPI but I'll look elsewhere for the issue instead.