element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Experts, Learning and Guidance
  • Technologies
  • More
Experts, Learning and Guidance
Ask an Expert Forum SPI communication problem in CM pi 4
  • Blog
  • Forum
  • Documents
  • Leaderboard
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Experts, Learning and Guidance to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 2 replies
  • Subscribers 287 subscribers
  • Views 482 views
  • Users 0 members are here
Related
See a helpful answer?

Be sure to click 'more' and select 'suggest as answer'!

If you're the thread creator, be sure to click 'more' then 'Verify as Answer'!

SPI communication problem in CM pi 4

AmitRS
AmitRS 2 months ago

Hello,
I am using PI CM 4 as SPI master and receiving data from the slave. The transmission works fine till 18 MHz in SPI mode01 or 11 (SPI mode 00 and 10 gives corrupts data even at lower speed). However, a bit shift is noticed beyond 18 MHz i.e when tested at 25 or 31 MHz the bit shifts by one place e.g If I am sending 00100111 00010111 then pi receives 00010011 10001011. I have tested with shorter wires but the problem still persist. The oscilloscope readings show no extra 0 as is recorded in, only change that is happening from 18Mhz to 25 Mhz is the delay between the rising edge of MISO to that of falling edge of SCK is decreasing with increase in clock speed: at 18Mhz it is 15.2ns, at 25Mhz it is 7.8ns and at 31 Mhz it is 3.2ns.

In given oscilloscope readings blue is clock (SCK) and green is MISO. The data is sampled at the falling edge of the clock.imageimage


Please help me fix this issue.

  • Sign in to reply
  • Cancel

Top Replies

  • michaelkellett
    michaelkellett 2 months ago +3
    I suspect that your transmitter and receiver are not set up correctly - it looks as if the transmitter is changing state based on rising edge of clock and receiver clocking data on falling edge. I can…
Parents
  • kmikemoo
    0 kmikemoo 2 months ago

    AmitRS  This is just a crazy idea... will/does this phenomenon remain unchanged if you underclock or overclock your Pi?  Could it be a glitch caused by aliasing?
    Again... just a random, crazy thought.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • kmikemoo
    0 kmikemoo 2 months ago

    AmitRS  This is just a crazy idea... will/does this phenomenon remain unchanged if you underclock or overclock your Pi?  Could it be a glitch caused by aliasing?
    Again... just a random, crazy thought.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube