element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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
  • 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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum RP2040 PIO/SPI MORE THAN 32 BITS
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 10 replies
  • Subscribers 662 subscribers
  • Views 3704 views
  • Users 0 members are here
  • spi
  • rp2040
  • swd
  • PIO
Related

RP2040 PIO/SPI MORE THAN 32 BITS

gabofienco
gabofienco over 3 years ago

Hello,

I am working with RP2040 using the PICOPROBE code with some modifications, do you have any idea how to send more than 32 consecutive bits, setting values with the clock is ok, more than 32 periods if I want to, but on data it limits to a uint32_t.... and if I send another frame it generates an undesired delay:

yellow CLOCK, green MOSI.

image

I am trying to generate the SWD initi sequence on code, it will be good to send at least 200 clock pulses with its respective Data.

Thanks.

  • Sign in to reply
  • Cancel
Parents
  • scottiebabe
    0 scottiebabe over 3 years ago

    Yes, you can write a PIO routine to output n-bit SPI. Are you using this PIO routine: https://github.com/raspberrypi/picoprobe/blob/master/src/probe.pio 

    It gets complicated having to reload the OSR every 32-bits.  You could use the autopull feature, but then it gets complicated syncronizing on the first FIFO write which sets the bit count.

    If you only need n-bit SPI to clock 0's, you could just write another pio routine clock out N zeros.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • gabofienco
    0 gabofienco over 3 years ago in reply to scottiebabe

    Thanks for your answer, Yes I am having some issues reloading the OSR and sincronizing it.

    that is the PIO file I am using, I am trying to emulate the SWD init sequence, I think that the main problem I don't get any response from the other rp2040 is because of the delay on data every 32btis, I don't know if that makes sense to any of you ?

    Thanks again.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 3 years ago in reply to gabofienco

    Hi,

    Regarding: "I think that the main problem I don't get any response from the other rp2040"

    I'm confused - the PicoProbe code is already designed to work with RP2040, and has been used in that way by hundreds/thousands of people surely? Does it not already use the SWD sequence you are attempting, or am I misunderstanding it?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • gabofienco
    0 gabofienco over 3 years ago in reply to shabaz

    Yes, but I am trying to move a data that is already stored on another flash address from rp2040_1 to the SWD pins from rp2040_2, I don't use the USB to download the data to rp2040_2 and letting it do all the syncronization that way (on my board I don't have access to those pins, is not a raspberry pi pico board is my own board).

    So, I am having problems trying to get the SWD init, I think that even with the delay between spi frames it should work as PICOPROBE seems to make it work that way already.

    That is how it has to work for the hardware I already have on the boards, does it make any sense to you?

    I had checked so much info about the sequence to init SWD that I don't that I am sending wrong bits.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 3 years ago in reply to gabofienco

    Hi,

    The PicoProbe USB code portion is likely decoupled from the SWD code (I've not checked, but it should be), so if you're not using USB in your version of code, it should make no difference.

    As you yourself say, since PicoProbe already functions on the SWD interface side, then it should work with your version of code. The delay may be a red herring, you can prove it to yourself by examining with a 'scope if possible (or a logic analyzer), and comparing the normal PicoProbe with your version, to see where the discrepancy is, if source code examination isn't helping so far.

    It makes no sense that it would not work in your code if the normal PicoProbe works (have you tested the normal PicoProbe code with a normal Pi Pico with your RP2040 target, just to be 1000% sure that you don't have an issue elsewhere in the system?).

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • shabaz
    0 shabaz over 3 years ago in reply to gabofienco

    Hi,

    The PicoProbe USB code portion is likely decoupled from the SWD code (I've not checked, but it should be), so if you're not using USB in your version of code, it should make no difference.

    As you yourself say, since PicoProbe already functions on the SWD interface side, then it should work with your version of code. The delay may be a red herring, you can prove it to yourself by examining with a 'scope if possible (or a logic analyzer), and comparing the normal PicoProbe with your version, to see where the discrepancy is, if source code examination isn't helping so far.

    It makes no sense that it would not work in your code if the normal PicoProbe works (have you tested the normal PicoProbe code with a normal Pi Pico with your RP2040 target, just to be 1000% sure that you don't have an issue elsewhere in the system?).

    • Cancel
    • Vote Up +2 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