	{"id":1600,"date":"2022-11-25T23:01:24","date_gmt":"2022-11-25T23:01:24","guid":{"rendered":"http:\/\/www.myusro.id\/?p=1600"},"modified":"2022-11-25T23:02:53","modified_gmt":"2022-11-25T23:02:53","slug":"raspberry-pi-pico-getting-started-tutorial-with-micropython","status":"publish","type":"post","link":"https:\/\/myusro.id\/?p=1600","title":{"rendered":"Raspberry Pi Pico Getting Started Tutorial with MicroPython"},"content":{"rendered":"<h5><span id=\"Overview\">From:\u00a0https:\/\/how2electronics.com\/raspberry-pi-pico-getting-started-tutorial-with-micropython\/<\/span><\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1601 aligncenter\" src=\"https:\/\/myusro.id\/wp-content\/uploads\/2022\/11\/raspberry-pi-pico-getting-started-1080x607.jpg\" alt=\"\" width=\"1080\" height=\"607\" srcset=\"https:\/\/myusro.id\/wp-content\/uploads\/2022\/11\/raspberry-pi-pico-getting-started-1080x607.jpg 1080w, https:\/\/myusro.id\/wp-content\/uploads\/2022\/11\/raspberry-pi-pico-getting-started-1080x607-300x169.jpg 300w, https:\/\/myusro.id\/wp-content\/uploads\/2022\/11\/raspberry-pi-pico-getting-started-1080x607-768x432.jpg 768w, https:\/\/myusro.id\/wp-content\/uploads\/2022\/11\/raspberry-pi-pico-getting-started-1080x607-1024x576.jpg 1024w\" sizes=\"auto, (max-width: 1080px) 100vw, 1080px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><span id=\"Overview\"><strong>Overview<\/strong><\/span><\/h3>\n<p>In this Getting Started tutorial, we will learn about the\u00a0<strong>Raspberry Pi Pico<\/strong>, a brand new exciting Microcontroller board based on\u00a0<strong>RP2040 Microcontroller<\/strong>\u00a0from the\u00a0<a href=\"https:\/\/www.raspberrypi.org\/about\/\" target=\"_blank\" rel=\"noopener\"><strong>Raspberry Pi Foundation<\/strong><\/a>. The Raspberry Pi Pico is a low-cost Arm-based microcontroller that we can program using\u00a0<strong>C\/C++<\/strong>\u00a0and\u00a0<strong>MicroPython<\/strong>.<\/p>\n<p>Over the years Raspberry Pi boards have become a must tool for students, hobbyists,s or Industrialists. But when it comes to cost, the Raspberry Pi Board is overtaken by\u00a0<strong>Arduino, ESP32, STM32<\/strong>, or other\u00a0<strong>AVR, ARM, and PIC<\/strong>\u00a0Microcontrollers. The Raspberry Pi computer costs around\u00a0<strong>35-40$<\/strong>\u00a0whereas the other microcontrollers barely cost\u00a0<strong>2-5$<\/strong>\u00a0only. This is the reason why\u00a0<strong>Raspberry Pi Foundation<\/strong>\u00a0released their low-cost powerful competitive Raspberry Pi Pico Board with RP2040, a\u00a0<strong>Dual Core ARM Cortex-M0+ Microcontroller<\/strong>.<\/p>\n<p>The tutorial covers the RP2040 Microcontroller, its\u00a0<strong>features<\/strong>\u00a0&amp;\u00a0<strong>specifications<\/strong>. We will also learn about the Raspberry Pi Pico Board, its layout, and specifications. The detailed guide of Raspberry Pi Pico Pins like\u00a0<strong>ADC pins, I2C Pins, SPI Pins, UART<\/strong>, etc can help you to interface any\u00a0<strong>sensors<\/strong>\u00a0or\u00a0<strong>module<\/strong>\u00a0with this powerful board.<\/p>\n<p>Since it\u2019s a\u00a0<strong>Raspberry Pi Pico getting started tutorial<\/strong>, so we will only program the device using Micropython. For that, you can either use\u00a0<a href=\"https:\/\/thonny.org\/\" target=\"_blank\" rel=\"noopener\"><strong>Thonny IDE<\/strong><\/a>\u00a0or you can also go with\u00a0<a href=\"https:\/\/github.com\/DFRobot\/uPyCraft\" target=\"_blank\" rel=\"noopener\"><strong>uPyCraft IDE<\/strong><\/a>. In some other tutorials, we will learn how to program Raspberry Pi Pico with C\/C++. Even the\u00a0<strong>Arduino IDE<\/strong>\u00a0will support Raspberry Pie Pico in the future as it is in the development phase now. We will go through the basic\u00a0<strong>Raspberry Pi Pico LED Blink Code<\/strong>\u00a0&amp; check the board functionality.<\/p>\n<h3><span id=\"What_is_RP2040_Microcontroller\"><strong>What is the RP2040 Microcontroller?<\/strong><\/span><\/h3>\n<p><!--more--><\/p>\n<p>Earlier all the Raspberry Pi boards like\u00a0<strong>Raspberry Pi 3<\/strong>\u00a0or\u00a0<strong>4<\/strong>\u00a0or\u00a0<strong>Raspberry Pi Zero<\/strong>\u00a0featured Broadcom Processors like\u00a0<strong>BCM2835, BCM2836, BCM2711,<\/strong>\u00a0etc. The RP2040 chip was announced on 21st January 2021 and is the first processor designed by the Raspberry Pi Foundation.<\/p>\n<p>The RP2040 is a\u00a0<strong>32-bit<\/strong>\u00a0dual\u00a0<strong>ARM Cortex-M0+ microcontroller<\/strong>\u00a0integrated circuit released simultaneously as part of the Raspberry Pi Pico board. The processor is a low-cost microcontroller and costs around\u00a0<strong>US$4<\/strong>. The chip is\u00a0<strong>40nm<\/strong>\u00a0silicon in a\u00a0<strong>7\u00d77 mm QFN-56<\/strong>\u00a0package.<\/p>\n<p>The RP2040 contains two\u00a0<strong>ARM Cortex-M0+<\/strong>\u00a0cores clocked at\u00a0<strong>133 MHz<\/strong>\u00a0together with\u00a0<strong>264 KB<\/strong>\u00a0of RAM. The Program memory is external and supports up to\u00a0<strong>16 MB<\/strong>. The device has everything you expect from a modern microcontroller like\u00a0<strong>UARTS, SPI,<\/strong>\u00a0and\u00a0<strong>I2C<\/strong>\u00a0ports, and there are timers, PWM, DMA, and a 12-bit analog-to-digital converter\u00a0<strong>(ADC)<\/strong>.<\/p>\n<hr \/>\n<h3><span id=\"Meaning_of_RP2040\"><strong>Meaning of RP2040<\/strong><\/span><\/h3>\n<p>The name RP2040 has an exciting meaning explained below.<br \/>\n<strong>1. RP means<\/strong>: Raspberry Pi<br \/>\n<strong>2. Number 2 means<\/strong>: Processor Cores as a dual-core microcontroller. So, the value is 2.<br \/>\n<strong>3. Number 0 means<\/strong>: Type of Processor Core as it is ARM Cortex-M0+. So, the value is 0.<br \/>\n<strong>4. Number 4 means<\/strong>: Represents On-chip RAM. RP2040 has 264 KB of RAM. The formula to get 4 values is floor (log2 (ram \/ 16k)). So, the value is 4.<br \/>\n<strong>5. Number 0 means<\/strong>: Represents On-chip Flash. As there is no on-chip flash, the value is 0.<\/p>\n<h4><span id=\"RP2040_Key_features\"><strong>RP2040 Key features:<\/strong><\/span><\/h4>\n<p>1.\u00a0<strong>133MHz<\/strong>\u00a0dual ARM Cortex-M0+ cores<br \/>\n2. 264kB SRAM in six independent banks<br \/>\n3. Support for up to\u00a0<strong>16MB<\/strong>\u00a0of off-chip Flash memory via a dedicated QSPI bus<br \/>\n4.\u00a0<strong>DMA<\/strong>\u00a0controller<br \/>\n5. Fully-connected AHB crossbar<br \/>\n6. Interpolator and integer divider peripherals<br \/>\n7. On-chip programmable\u00a0<strong>LDO(Low-dropout_regulator)<\/strong>\u00a0to generate core voltage<br \/>\n8. 2 on-chip\u00a0<strong>PLLs<\/strong>\u00a0to generate USB and core clocks<br \/>\n9.\u00a0<strong>30 GPIO<\/strong>\u00a0pins, 4 of which can be used as\u00a0<strong>analog inputs<\/strong><\/p>\n<hr \/>\n<p><span id=\"Introduction_to_Raspberry_Pi_Pico\"><strong>Introduction to Raspberry Pi Pico<\/strong><\/span><\/p>\n<p>The Raspberry Pi Pico is the first microcontroller board based on the RP2040. It looks a lot like other\u00a0<strong>microcontroller boards<\/strong>\u00a0with the MCU in the center, a micro-USB connector on one end, and a row of contacts along each side. A 3-pin\u00a0<strong>debug connector<\/strong>\u00a0is available at the other end of the board.<\/p>\n<p>The Raspberry Pi Pico measures\u00a0<strong>51 by 21 mm<\/strong>, which is the exact same size as an ESP32 Pico Kit &amp; slightly larger than an Arduino Nano or Micro. The Pico comes with\u00a0<strong>2 MB of QSPI Flash memory<\/strong>\u00a0and 25 of the 30 GPIO pins of the RP2040 have been brought out on the extension connectors. The board is\u00a0<strong>breadboard friendly<\/strong>\u00a0and fits perfectly on a breadboard.<\/p>\n<h4><span id=\"Features_of_Raspberry_Pi_Pico\"><strong>Features of Raspberry Pi Pico<\/strong><\/span><\/h4>\n<p>Following are the features of the Raspberry Pi Pico Board.<br \/>\n1. Based on\u00a0<strong>RP2040<\/strong>\u00a0Microcontroller<br \/>\n2.\u00a0<strong>2 MB<\/strong>\u00a0of SPI Flash Memory<br \/>\n3.\u00a0<strong>Type B Micro-USB<\/strong>\u00a0port for power &amp; programming<br \/>\n4.\u00a0<strong>40 DIP<\/strong>\u00a0style IO Pins<br \/>\n5. 3-pin ARM Serial Wire Debug (SWD) interface<br \/>\n6.\u00a0<strong>12 MHz Crystal<\/strong>\u00a0oscillator<br \/>\n7. Boot Selection Button<br \/>\n8. Programmable LED connected to GPIO 25<br \/>\n9.\u00a0<strong>3.3V<\/strong>\u00a0Fixed Output\u00a0<strong>Buck-Boost SMPS Converter<\/strong><\/p>\n<h4><span id=\"Raspberry_Pi_Pico_Pinout\"><strong>Raspberry Pi Pico Pinout<\/strong><\/span><\/h4>\n<p>There are <b>40 pins<\/b>\u00a0on the Raspberry Pi Pico. Out of those\u00a0<strong>40 pins<\/strong>, 26 pins are Input-Output (IO Pins). All those 14 pins are analog, digital, and other Serial Pins. There are\u00a0<strong>14 power<\/strong>\u00a0and system-related pins. The remaining 3 more pins are used for\u00a0<strong>SWD Debugging<\/strong>.<\/p>\n<p>There are two I2C peripherals available, I2C0 and I2C1. Similarly, there are two SPI peripherals, SPI0 and SPI1The number of UART Pins is also two, UART0 and UART1. You can assign any of these to the pins on which they are available.<\/p>\n<p>Before you start using Raspberry Pi Pico, you have to\u00a0<strong>solder 40-pin male headers<\/strong>, 20 on each side of the board.<\/p>\n<h3><span id=\"Programming_Raspberry_Pi_Pico\"><strong>Programming Raspberry Pi Pico<\/strong><\/span><\/h3>\n<p>The Pi Pico can be programmed using\u00a0<strong>C\/C++<\/strong>\u00a0or\u00a0<strong>Python<\/strong>, among other languages. Pico is adaptable to a vast range of applications and skill levels, and getting started is as easy as dragging and dropping a file. If you are working with C, then it is recommended to use a\u00a0<strong>Linux-based system<\/strong>\u00a0like a Raspberry Pi Computer as it is easy to download the SDK and write C Programs in Linux.<\/p>\n<p>But I will recommend using\u00a0<strong>MicroPython<\/strong>\u00a0to program the Raspberry Pi Pico Board. MicroPython is a Python Language Interpreter that is developed for Microcontrollers and\u00a0<strong>embedded systems<\/strong>. The\u00a0<strong>Syntax for MicroPython<\/strong>\u00a0is very similar to Python. So, if you worked with Python, then working with MicroPython will be very easy.<\/p>\n<p>To program the Raspberry Pi Pico using Micropython, you can either use:<br \/>\n<strong>1. Thonny IDE<br \/>\n2. uPyCraft IDE<\/strong><\/p>\n<p>But before getting started with Raspberry Pi Pico, you have to install MicroPython on Raspberry Pi Pico Board.<\/p>\n<hr \/>\n<h3><span id=\"Installing_MicroPython_on_Raspberry_Pi_Pico\"><strong>Installing MicroPython on Raspberry Pi Pico<\/strong><\/span><\/h3>\n<p>Push and hold the BOOTSEL button on the Pico, &amp; then immediately connect the Pico Board to your computer using a micro USB cable. Release BOOTSEL once the drive RPI-RP2 appears on your computer.<\/p>\n<p>Open the\u00a0<strong>RPI-RP2 drive<\/strong>\u00a0that appears in the Drives tab.<\/p>\n<p>Visit the Raspberry Pi Pico Official Documentation page from here:\u00a0<a href=\"https:\/\/www.raspberrypi.org\/documentation\/rp2040\/getting-started\/\" target=\"_blank\" rel=\"noopener\"><strong>Raspberry Pi Documentation<\/strong><\/a>.<\/p>\n<p>Download the MicroPython UF2 file from the MicroPython tab.<\/p>\n<p>Drag and drop the UF2 file onto the RPI-RP2 drive. The Raspberry Pi Pico will reboot and will now run MicroPython.<\/p>\n<p>&nbsp;<\/p>\n<p>Tutorial Source :\u00a0https:\/\/how2electronics.com\/raspberry-pi-pico-getting-started-tutorial-with-micropython\/<\/p>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>From:\u00a0https:\/\/how2electronics.com\/raspberry-pi-pico-getting-started-tutorial-with-micropython\/ &nbsp; Overview In this Getting Started tutorial, we will learn about the\u00a0Raspberry Pi Pico, a brand new exciting Microcontroller board based on\u00a0RP2040 Microcontroller\u00a0from the\u00a0Raspberry Pi Foundation. The Raspberry Pi Pico is a low-cost Arm-based microcontroller that we can program using\u00a0C\/C++\u00a0and\u00a0MicroPython. Over the years Raspberry Pi boards have become a must tool for students, hobbyists,s [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,11,3,6],"tags":[],"class_list":["post-1600","post","type-post","status-publish","format-standard","hentry","category-mengajar","category-mikrokontroler","category-riset","category-unj"],"_links":{"self":[{"href":"https:\/\/myusro.id\/index.php?rest_route=\/wp\/v2\/posts\/1600","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myusro.id\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myusro.id\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myusro.id\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myusro.id\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1600"}],"version-history":[{"count":3,"href":"https:\/\/myusro.id\/index.php?rest_route=\/wp\/v2\/posts\/1600\/revisions"}],"predecessor-version":[{"id":1604,"href":"https:\/\/myusro.id\/index.php?rest_route=\/wp\/v2\/posts\/1600\/revisions\/1604"}],"wp:attachment":[{"href":"https:\/\/myusro.id\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myusro.id\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myusro.id\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}