Raspberry Pi Pico
by Ramatronics Laboratory in Circuits > Raspberry Pi
876 Views, 9 Favorites, 0 Comments
Raspberry Pi Pico
INTRODUCTION:
In modern world, coding(programming ) is being used widely in every field of engineering. So for engineering students it is necessary that they should learn coding or programming. There are many programming languages to learn. Some of the programming languages which are mostly used are listed below:
- Basic
- C
- C++
- Python
- Java
- Cobol
all programming based projects that I have uploaded before were based on Arduino programming which is a combination of C and C++. But there are some other languages such as python which is as popular as C and C++. So I am going to give you a basic knowledge of python programming and which IDE is easier to start learning python programming. We shall also find is there any microcontroller board available in the market which can be programmed using python. If available, how we can use it to make projects, robots and IOT projects. So let's get started.
Downloads
Supplies
Electronic Hardware and Tools:
Raspberry pi pico
https://quartzcomponents.com/products/raspberry-pi-pico?_pos=1&_sid=06a984e38&_ss=r
Micro-B USB Cable (For programming Raspberry pi pico)
https://quartzcomponents.com/products/raspberry-pi-cable-for-charging?_pos=1&_sid=3f31527c7&_ss=r
Bread board
Tools:
Soldering Iron
https://quartzcomponents.com/products/analog-soldering-iron-60w?_pos=10&_sid=4903fed02&_ss=r
Soldering Flux
https://quartzcomponents.com/products/rma-223-solder-flux-paste?_pos=3&_sid=df0351680&_ss=r
Soldering Wire
https://quartzcomponents.com/products/flux-core-solder-wire-18swg-50gms?_pos=2&_sid=df0351680&_ss=r
Male headers
Raspberry Pi Pico
Raspberry pi pico
Raspberry pi pico is a microcontroller development board developed by Raspberry. The main thing about this microcontroller board is that it can be programmed either by C/C++ or by Python. This quality of this board makes it unique for using it in project designing.
Some advanced features of Raspberry pi pico over arduino are given below
Raspberry pi pico uses Raspberry pi 'RP2040' dual core ARM microcontroller. The microcontroller's name can be broken down into sections, each of which has a particular meaning:
RP: means 'Raspberry Pi' simply enough
2: is the number of processor cores the microcontroller has
0: is the type of processor core, indicating in this case the RP2040 uses a processor core called Cortex-M0+ from Cambridge-based Arm.
4: is how much random access memory(RAM) the microcontroller has, based on a special mathematical function: floor(log at base 2 (RAM/16)). In this case, '4' means the chip has 264 Kilobytes(KB) of RAM.
0: is how much non-volatile(NV) storage the chip has, and is worked out in the same way as the RAM: floor(log at base 2(NV/16)). In this case, 0 simply means there is no non-volatile memory storage on-board. The RP2040 is the first microcontroller from Raspberry Pi.
CPU: 32bit dual-core ARM Cortex-M0+ at 48MHz, configurable up to 133 MHz
RAM: 264KB of SRAM in six independently configurable banks
Storage: 2MB external flash RAM
GPIO: 26 pins
ADC: 3 x 12-bit ADC pins
PWM: Eight slices, two outputs per slice for 16 total
Clock: Accurate on-chip clock and timer with year, month, day, day-of-week, hour, second, and automatic leap-year calculation.
Sensors: On-chip temperature sensor connected to 12-bit ADC channel.
LEDs: On-board user-addressable LED
Bus Connectivity: 2 x UART, 2 x SPI, 2 x I2C, Programmable Input/Output(PIO)
Hardware Debug: Single-Wire Debug(SWD)
Mount Options: Through-hole and castellated pins(unpopulated) with 4 x mounting holes
Power: 5V via USB connector, 3.3 V via 3V3 pin or 2-5V via VSYS pin
Downloads
Programming Raspberry Pi Pico
Programming the Raspberry pi pico.
As I have mentioned earlier that the Raspberry pi pico can be programmed using either C/C++ or python(Micro Python/Circuit Python). Here I am going to program the raspberry pi pico using Python(Micro Python) programming language. To write python code or sketches, obviously, we need an Integrated development Environment (IDE). The most popular and simplest IDE is Thonny. you can download the Thonny by the link provided below
you can visit the above link to install Thonny on computer or laptop:
Connecting Raspberry Pi Pico to Laptop and Installing Firmware on It
Connect your Raspberry pi pico board to the computer through a micro-B USB Cable. Now download the UF2 file from the link given below:
https://micropython.org/download/rp2-pico/
https://www.raspberrypi.com/documentation/microcontrollers/micropython.html
After downloading UF2 file, disconnect you Raspberry pi pico board from laptop and now keep on pressing the bootsel button of pico board and again connect the board to the laptop and now please release bootsel button. As you release the bootsel button a folder will automatically open on the screen of your laptop, now paste the downloaded UF2 file in this folder and now your pico board will automatically connect to your laptop and install the latest Raspberry pi pico firmware on the Raspberry pi pico. now open run Thonny on your computer and now you have to select the micropython Raspberry pi pico and COM port at which your pico board is connected to and click on ok. Now to check whether your pico board is connected to Thonny or not type print('hello world') in the shell and just press enter. now if pico board returns you hello world back, means your pico board is connected to Thonny successfully.
Soldering Male Headers on Pico
To make your raspberry pi pico breadboard friendly, you should solder male headers to both left and right side of your pico board using soldering tools. you can take the help of my pictures if you don't know how to do that and follow the given steps:
- Insert male headers inside the holes provided on both sides of pico board.
- Now you can insert the pico board in bread board.
- Start soldering the male headers with soldering tools(Soldering iron, flux and wire)
Warning: it is necessary to insert the pico board in bread board and after this you should start soldering otherwise. pico board will not insert in the breadboard easily.
Run Led Blinking Program on Pico Board
Now go to files and click on new to open a new python file and then type the given python program on the editor
from machine import Pin
from time import sleep
led = Pin(25, Pin.OUT)
while True:
led.toggle()
sleep(1)
after writing the above program click on save and then save it either on your computer or Raspberry pi pico board with name. main.py and click on run option. and on-board LED which is connected to the GPIO 25 of the RP2040 starts blinking.
Congratulations! now you have successfully run your first python program on Raspberry pi pico
Enjoy it
Thank you