<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>mini project: PICO-PI programmable Lab Switch - 4: Your Homework - extra pins</title><link>/technologies/test-and-measurement/b/blog/posts/mini-project-pico-pi-programmable-lab-switch---4-your-homework---extra-pins</link><description>In this series, I design a programmable lab switch based on RP2040, that can turn a set of signals or supplies on or off. Over USB. SCPI compatible.In the previous post I gave you homework, but you didn&amp;#39;t do it . So I&amp;#39;ll pick up t...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: mini project: PICO-PI programmable Lab Switch - 4: Your Homework - extra pins</title><link>https://community.element14.com/technologies/test-and-measurement/b/blog/posts/mini-project-pico-pi-programmable-lab-switch---4-your-homework---extra-pins</link><pubDate>Fri, 21 Oct 2022 19:12:25 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:d8c19773-e105-4758-ab45-1e8bd901421a</guid><dc:creator>shabaz</dc:creator><slash:comments>4</slash:comments><description>&lt;p&gt;I built your code. (the version that uses UART from the previous blog), it works well : )&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For anyone interested in doing it with CLion (I didn&amp;#39;t use VS Code), the steps&amp;nbsp;that worked for me are&amp;nbsp;(some of these steps can be replaced with environmental variable changes if desired):&lt;/p&gt;
&lt;p&gt;0. Install &lt;strong&gt;CLion&lt;/strong&gt; and the&lt;strong&gt; ARM toolchain&lt;/strong&gt; and the&lt;strong&gt; Pico SDK&lt;/strong&gt;. The steps are here:&amp;nbsp;&lt;a href="/products/raspberry-pi/b/blog/posts/using-clion-for-easier-coding-with-pi-pico-and-c-c"&gt;/products/raspberry-pi/b/blog/posts/using-clion-for-easier-coding-with-pi-pico-and-c-c&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1.Create a Pico development folder, e.g. &lt;strong&gt;C:\development\pico&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;2. In that folder place the pico programmable lab switch source code, i.e. unzip the &lt;strong&gt;freertos_scpi_switch.zip&lt;/strong&gt; so the path to&amp;nbsp;its contents&amp;nbsp;is &lt;strong&gt;C:\development\pico\freertos_scpi_switch&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;3. Download FreeRTOS, I downloaded the full&amp;nbsp;FreeRTOSv202112.00.zip from&lt;strong&gt;&amp;nbsp;&lt;a href="https://www.freertos.org/a00104.html"&gt;https://www.freertos.org/a00104.html&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;4. Unzip it. I did it in th pico folder too, although you could put it outside that folder if you wish to use it with other microcontrollers too. My path was&amp;nbsp;&lt;strong&gt;C:\development\pico\FreeRTOSv202112.00&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;5. Download the &lt;strong&gt;scpi-parser&lt;/strong&gt; source zip file from&amp;nbsp;&lt;strong&gt;&lt;a href="https://github.com/j123b567/scpi-parser/releases"&gt;https://github.com/j123b567/scpi-parser/releases&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;6. I extracted the scpi-parser zip file to the pico library (you could extract it elsewhere if you wish to use it with other microcontrollers too). My path was&amp;nbsp;&lt;strong&gt;C:\development\pico\scpi-parser-2.2&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;7. In the &lt;strong&gt;freertos_scpi_switch\CMakeLists.txt&lt;/strong&gt; file, I&amp;nbsp;did search-replace to change the text&lt;strong&gt;&amp;nbsp;$ENV{SCPI_LIB_PATH}&lt;/strong&gt; with&amp;nbsp;&lt;strong&gt;../scpi-parser-2.2/libscpi&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;8. In the&amp;nbsp;C:\development\freertos_scpi_switch\FreeRTOS_Kernel_import.cmake file I added a line near the top of the file:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;set(FREERTOS_KERNEL_PATH &amp;quot;C:/development/pico/FreeRTOSv202112.00/FreeRTOS/Source&amp;quot;)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;9. I opened the&amp;nbsp;&lt;strong&gt;freertos_scpi_switch&lt;/strong&gt;&amp;nbsp;folder project using CLion. As part of its Open Project Wizard, it brings up a window where one line needs to be typed in this box:&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-d8c19773-e105-4758-ab45-1e8bd901421a/pastedimage1666376214162v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The line to type is&amp;nbsp;&lt;strong&gt;PICO_SDK_PATH=c:\development\pico\pico-sdk&lt;/strong&gt;&amp;nbsp; (this assumed you have previously installed the SDK there as discussed in the blog in step 0).&lt;/p&gt;
&lt;p&gt;10. Click the hammer icon to build the code.&amp;nbsp;CLion created a folder and the&amp;nbsp;&lt;strong&gt;.uf2&lt;/strong&gt; suffix executable was available in&amp;nbsp;&lt;strong&gt;C:\development\pico\freertos_scpi_switch\cmake-build-debug&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;11. The executable can be uploaded onto the Pico by first holding down the &lt;strong&gt;BOOTSEL&lt;/strong&gt; button and plugging in the USB connection into the PC, and then dropping the .uf2 suffix file into the USB drive letter that appears. There are a couple of steps with CLion to enable PicoProbe if that&amp;#39;s preferred. I can write up those steps if anyone wants help with that.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=24627&amp;AppID=13&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: mini project: PICO-PI programmable Lab Switch - 4: Your Homework - extra pins</title><link>https://community.element14.com/technologies/test-and-measurement/b/blog/posts/mini-project-pico-pi-programmable-lab-switch---4-your-homework---extra-pins</link><pubDate>Thu, 20 Oct 2022 20:45:13 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:d8c19773-e105-4758-ab45-1e8bd901421a</guid><dc:creator>genebren</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Very well done.&amp;nbsp; This was an excellent series of blogs.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=24627&amp;AppID=13&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: mini project: PICO-PI programmable Lab Switch - 4: Your Homework - extra pins</title><link>https://community.element14.com/technologies/test-and-measurement/b/blog/posts/mini-project-pico-pi-programmable-lab-switch---4-your-homework---extra-pins</link><pubDate>Thu, 20 Oct 2022 20:13:38 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:d8c19773-e105-4758-ab45-1e8bd901421a</guid><dc:creator>dougw</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I works for me when somebody else does my homework for me.&amp;nbsp;[emoticon:fbd079a1c4f748c5a234faee215de9cc]&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=24627&amp;AppID=13&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>