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
  • 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
Test & Tools
  • Technologies
  • More
Test & Tools
Forum mini project: PICO-PI programmable Lab Switch (with SCPI and FreeRTOS)
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Test & Tools to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 4 replies
  • Subscribers 349 subscribers
  • Views 1500 views
  • Users 0 members are here
  • pico_freertos_smp
  • pico_freertos_scpi_switch
  • pico
  • scpi
Related

mini project: PICO-PI programmable Lab Switch (with SCPI and FreeRTOS)

Jan Cumps
Jan Cumps over 2 years ago

goal: make a programmable lab switch, that can switch a set of signals or supplies on or off

  • can be used in an automated process, with other lab instruments
  • may be used to switch power on/off, simulate a button click, switch an audio input on/off, ...
  • simple: you can control IO pins, that can drive a relay, FET, or any other switching element that can be controlled with a generic 3.3V GPIO.

image

reality: It 'll be a Pico with relais attached, and you control these over its USB port.
I've made several designs earlier, that use the patterns for this project:

  • SCPI library to turn user commands into to GPIO output pin state changes (yes: just on/of Grinning)
  • UART handling in FreeRTOS, with interrupt support
  • FreeRTOS concepts like: messaging, queues, semaphore, tasks

SCPI commands and matching LabVIEW driver will be compatible with a similar project I made for the Pi Propper.
A typical command would look like this:
:DIGITAL:OUTPUT0 ON

A LabVIEW flow:

image

real goal: it 'll be a showcase for using FreeRTOS with the PICO-PI in a real-world application. I've been testing out the multi-core version of the RTOS on the Pico lately, and this is a practical use case.
little bonus: It 'll run on FreeRTOS standard, and on the multi-core FreeRTOS SMP. On SMP, it 'll use both RP2040 cores.

If you have a Pico (or other RP2040 board), you can play along. No additional hardware required (the on-board LED will do) , and you can use a simple terminal (PuTTY, ...) or Python instead of LabVIEW.
I've attached the project skeleton to this post. It's a FreeRTOS blinky (already adapted for this project), a good way to check if you can successfully build a project for the Pico C SDK and the FreeRTOS port. That's the only assumption I make at the start of this series.

Link to all posts

freertos_scpi_switch_20221016.zip

  • Sign in to reply
  • Cancel

Top Replies

  • wolfgangfriedrich
    wolfgangfriedrich over 2 years ago +6
    Genius little detail is the way to tame the long jumper wires on the breadboard. I am going to add this to my small helpful tricks folder of my prototyping toolbox.
  • ntewinkel
    ntewinkel over 2 years ago in reply to wolfgangfriedrich +3
    I noticed that too! Funny how sometimes the details stand out like that
  • wolfgangfriedrich
    wolfgangfriedrich over 2 years ago +2
    And reading that, I always wanted to know more about SCPI. rscasny this might be a good topic for an essentials lesson.
  • wolfgangfriedrich
    wolfgangfriedrich over 2 years ago

    Genius little detail is the way to tame the long jumper wires on the breadboard. I am going to add this to my small helpful tricks folder of my prototyping toolbox. Thumbsup

    • Cancel
    • Vote Up +6 Vote Down
    • Sign in to reply
    • Cancel
  • ntewinkel
    ntewinkel over 2 years ago in reply to wolfgangfriedrich

    I noticed that too!

    Funny how sometimes the details stand out like that Smiley

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Cancel
  • fmilburn
    fmilburn over 2 years ago

    I will be back at home next week and try to follow. I’m interested in FreeRTOS and have a Pico but haven’t tried to get it running yet. 

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • wolfgangfriedrich
    wolfgangfriedrich over 2 years ago

    And reading that, I always wanted to know more about SCPI. rscasny this might be a good topic for an essentials lesson.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
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