Announcement

Collapse
No announcement yet.

SPI SD card

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • SPI SD card

    Hello,
    I have some questions regarding the xPico Wifi SDK.
    I am trying to write an SD card driver for the xPico Wifi and I am following the following guide: http://elm-chan.org/docs/mmc/mmc_e.html.

    - The guide specifies for initialization, I need to set the clock rate to 400khz. Later this needs to be changed to a higher rate, about 20-25mhz. Can I do this in code or only in the webinterface?
    - I also need to have the CS pin high during the initialization, which later needs to be low during the commands I send. Can I change the pin

  • #2
    I'm not familiar with SD card specifications, but as far as your questions:

    You can change configurable items by importing XML with the ltrx_xml_import_from_stream() function in the SDK. You can see an example here: https://github.com/Lantronix/vc0706_...aster/vc0706.c


    The chip select pin is always driven low when there is a SPI access. If you need that to be disabled but still have SPI transactions going through, then you should gate it when a CP. For example, put an OR gate on your board, and use a CP and the CS as the inputs. Set the CP to level high when you need a high output. Set the CP low when you need the output of the gate to be equal to the CS. Since you're running at high speeds, make sure you don't have propagation delay issues with the gate.

    mariano

    Comment


    • #3
      Thank you for your quick response.

      The xml import is a good idea, I will probably use that.
      Do you think I can get away with not using the CS pin at all? I think a CP pin would do the job fine on it's own.

      It seems half of my post is missing so I still have some more questions:

      - In the "ltrx_spi_descriptor" struct in the SDK, what do the "cmd_buf" and "cmd_bytes" fields do? I cannot find anything in the docs.
      - If I were to not use the SPI functions at all and do everything with

      Comment


      • #4
        Still missing half my post. There seems to be a limit but it does not tell me when editing.
        - If I were to not use the SPI functions at all and do everything with bitbanging using only the CPM library, haow can I get the timing right? There is no function to wait a few microseconds.

        Thanks,
        Dirk

        edit: The forum does not like quotation marks, that's why half my post was missing
        Last edited by byFlow; 04-24-2018, 01:44 PM.

        Comment


        • #5
          cmd_buf is in case you want to have two different buffers to send data onto the SPI line. For example a Command and a Data. You don't need to provide it if you don't want to.

          As for bitbanging with CPM, that will be slow. I would recommend that you speak with your Lantronix FAE to go into more details on this part of the design.

          Mariano

          Comment

          Working...
          X