Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Lopy SPI

    Scheduled Pinned Locked Moved LoPy
    spilopy
    1 Posts 1 Posters 677 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K Offline
      Kergilo
      last edited by Kergilo

      Hi.
      I am communicating through SPI an adc with integrated SPI with a lopy. My problem is that I receive the correct data most of the time but not all the time, so I used a logical analyzer to see the data frame sent by the lopy, and when I saw it I realized that sometimes the clock gets out of control. Is there any way to make sure that this doesn't happen?

      SPI config:
      from machine import SPI
      spi = SPI(0, mode=SPI.MASTER, baudrate=4000000, polarity=0, phase=1, firstbit=SPI.MSB)
      rbuf = bytearray(4)
      spi.write_readinto(bytes([0xD5, 0x8B, 0xD5, 0x8B]), rbuf)

      Images of the logic analyzer (three data frames):
      The data frame above is the clock and the bottom one is the MOSI. As you can see in the third image, the clock isn't correct in the second and third byte.
      0_1516040839006_1.JPG
      0_1516040942659_2.JPG
      0_1516040946514_3.JPG
      Thank you and sorry about my english.

      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • 1 / 1
      • First post
        Last post

      Pycom on Twitter

      Pycom