YTread Logo
YTread Logo

Raspberry Pi Pico

Apr 25, 2024
Welcome to another video explaining computers, this time we are going to look at this

raspberry

pi

pico

along with a small tin of

raspberry

pi

pico

accessories that I was able to use with the board and the raspberry pi pico what it is. It is the first microcontroller launched by the raspberry pi foundation the raspberry pi pico is not a computer it is a microcontroller and that is why in this video the first thing we have to do is explain the differences between a computer and a microcontroller between the pico and other Raspberry boards Pi and then of course we'll get the pickaxe up and running, so with everything explained let's go and take a closer look.
raspberry pi pico
Here we have our Raspberry Pi pico, which is officially priced at four dollars at the one I purchased. for three quid sixty here in the UK, so let's take it out of its little bag, there we are a little thing, the raspy pie pick and here's the accessory tin which I also bought to use with the board, another shiny tin, go in here, there we are all. of foam and there are several things here, there is a USB cable, there are several headings that we will use later in the video, but I said I would start by explaining the differences between a microcontroller like the raspberry pi pico and a computer, so take the raspberry pi pico and put it here next to a raspberry pi zero, which is a five dollar general purpose computer, so aside from the physical size, what are the key differences?
raspberry pi pico

More Interesting Facts About,

raspberry pi pico...

Well, a microcontroller like a raspberry pi pico or an arduino is programmable. device to control other electronic components microcontrollers are loaded with a program to perform a specific task and therefore do not need to run an operating system or have a lot of RAM or a lot of storage or have connectors for traditional computer peripherals such as a monitor or a keyboard, If we compare the pi pico with the pi zero, we see that the pi zero has massive storage on a micro SD card, it has an HDMI connector to connect a monitor, it has a micro USB connector, a power board but also a second micro USB connector To connect a keyboard or other USB peripherals, the Pi Zero also runs an operating system, obviously Raspberry Pi OS, and this allows the Pi Zero to be used as a computer for high-end computing applications, in contrast to the Raspberry Pi Pico. a single micro USB connector to power the board and transfer programs to it from the computer and it communicates with other electronic devices using its general purpose input and output connectors here on either side of the board, what this all means is that if you want to run End user applications or want to perform complex, memory-intensive computing tasks, such as recording or playing videos, but need a computer like a Raspberry Pi Zero;
raspberry pi pico
However, if you want to use a dedicated piece of code to control the electronics and do so very powerfully efficiently, then a microcontroller like the Raspberry Pi Pico is a much better option. The Pi Pico also has analog input which we don't find on other Raspberry Pi models and also offers much better low latency GPIO control. The Raspberry Pi Pico is a It has a size of only 51 by 21 millimeters and at the heart of the board is the Raspberry Pi Foundation's RP 2040 microcontroller chip, which contains a dual-core Arm Cortex M0 Plus CPU that has a frequency up to 133 megahertz.
raspberry pi pico
Also on the rp2040 it is the peak. 264 kilobytes of RAM and yes, it is 264 kilobytes, since this is a microcontroller next to the rp2040. There is a chip that contains two megabytes of built-in flash storage. It may not seem like much, but it is perfectly enough to store a large amount of code next to the storage chip. Next we have a start selector button that is used to put the peak into programming mode. At the end of the board we find an LED and a single micro USB 1.1 port to transfer programs to the pico and to power the board.
It could also be supplied by gpio pin 39 and a ground pin such as pin 38, with the peak accepting a 1.8 to 5.5 volt input. I've already started referencing the gpio connectors on the pico, these 40 pads on each side of the board and which we'll add some headers to later in the video, if we flip the board over you'll also see that on the back everything is labeled very nicely , that's great to see and to give you the headlines of the 40 pins we have here, 26 is multiple. They work with gpio pins including two uart connectors, two spi controllers and two i square c controllers and we have 16 pwm channels so what all this means is that the pico is great for things like controlling servos and the spi and i square c connectors can To be used to wire an LCD display, as noted above, the GPIO pins also include three analog inputs that will return a 12-bit number representing the voltage between zero and 3.3 volts.
It's also worth noting that the pico has a chipless clock as well as a temperature sensor, although sadly the raspberry pi foundation failed to include any functionality for making a cup of tea on the board, the raspberry pi pico doesn't run a Full operational, but can be programmed in several languages, including C and Micro Python. Python is a version of Python written in C and optimized to run on microcontrollers like our Raspberry Pi Pico, so what we are going to do now is install Micro Python on our Pico and this can be done using any type of computer, a machine with Windows. a Linux machine, although here as you can see I'm using a raspberry pi 400 running a fully updated version of the raspberry pi operating system and I have the USB cable that came with my pico accessory can plugged into the back of the 400, so all i need to do is grab the pike and hold down its boot select switch to get it to boot into programming mode but i need to plug in the pi cable like this and hopefully if we keep our fingers crossed we'll be the pi ha picked up the picot which is mounted as a drive and if we click ok we will see the picot in the file manager and there are a couple of files here one of which is a Raspberry Pi foundation index file we click on it .
It takes us to a web page and gives us a lot of support for not only the pico but also other rp 2040 based microcontrollers. Oh look, we have to tend to get rid of cookies. I wonder how much human time is wasted with all of us telling it. On computers, we don't mind having cookies, which we obviously will if we use the web anyway. There's already enough of this stuff down here, we can see there's a lot of useful stuff, including how to get started with Micro Python, which we can install in our drag and drop method, but I'm not going to do that.
I'm going to do an even easier method which is run, get rid of that too, we'll run Sony on the schedule here that we have on the pi we have Sony pre-installed and if you're not working on a pi you can download it from sony.org and when it appears you'll see in the bottom right that tells us which Python interpreter we have. We're currently using Python 3.7.3, but if we click on it with our pi pico connected, we can select micro python raspberry pi pico and you'll see what that brings up this dialog because we don't have micro.
Python is currently on the Raspberry Pi Pico so I can click here to install and it does everything for us which is very helpful so it says getting started hopefully it will be fixed it should be nice and quick there we are "It looks pretty good." it's done great and if we close that, you can see down here in the shell in thoni, we're running python on the raspberry pi pico, it's not that surprising, so now we can do something, what should we do? Let's run print and greetings like this. and there we are by the magic of computing we print the word greetings and for even more excitement let's try to turn on the led down here on the raspberry pi pico and let's give ourselves a little more space to do this there we are like this we need to do three commands for this, first of all, we need to configure the corresponding gpio pin, which is pin 25 permanently connected to the pico LED, so we will make an import pin from the machine like that and then we will define the LED to be pin 25 like we said and it will be a pin output because we want to control the LED, there we are, now everything is set up and finally, if we write LED high like this and hopefully, there we are, we have turned it on. the LED at the peak, which is very exciting and if we can sustain the pace, we can turn it off again with a low LED and there we are, we are using micro Python commands to control the Raspberry Pi Pico hardware now as we spin.
Turning the beak's own LED on and off can keep us entertained. Ideally we want to control our own components and to facilitate this, I'm going to solder some headers and a lot of people will take mail headers and I'll put them under the board. I'll put them like this here and like this there like this and the reason they'll do things like this is because you can take the picot and you can plug it into a board, but as you can see, my little board here is too small. have a picot plugged into the top, so what I'm going to do is a little different.
I'm not going to use those male heads. I'm going to use two female heads that will fit on top. the board like this and like that, that's the configuration I'm going to choose, so now it's time to get out of my soldering line and do some soldering and 40 shiny cast metal connections. Then the Raspberry Pi Pico is to get high with two headers and as you can see I also put it on a small motherboard just to keep it nice and stable and I connected up to five LEDs on this board with appropriate current limiting resistors so let's connect it to the pi.
No need to press the button this time, we'll just connect it normally to the Raspberry Pi 400, cross the Pi 400 desktop and launch the Sony editor as we did before, which will hopefully appear. there we are and you can see we're connected to the peak running micro python, but if we weren't, we'd go here at the bottom right and select the appropriate interpreter, so we could have gone in, for example, and found that. Sony was using the Python 373 interpreter but if it was on we would just select Raspberry Pi Pico and see that we are on Pico when we get the pico shell anyway the code I wrote here is good. and simple just to test things out we are basically importing pin for the machine like before and we are importing the utime library which is a time library that uses the real time clock in peak instead of the library called time instead of your time. which uses OS time and we don't have OS time here to use and then configure five gpio pins called led a8e for our five leds as you can see I'm defining a variable called delay and then we have an infinite looper while the true loop inside which I have code that says turn on the first LED wait for the delay turn it off turn on the second etc.
It's not the best written code, but it will work for our purposes testing things here, so If I run the code and there we are, we now have a beak operated running light. I like that you can't go wrong with an LED running light. Can? It's great to see it working, so that's all well and good, but of course what's happening here is that we're running it with the Pico connected to the Raspberry Pi 400. We really want to run it independently, that's the purpose of a microcontroller. , so I will stop the program and save this code. not on the pi 400 where it is saved right now but on the pica so I will click save as and we will select not this computer but raspberry pi pico and we will call it main point pi and if you save a Python program on the pico called main dot pi will run automatically, so I can click OK, that's all done.
I'm not going to close it, funny, and I'll also disconnect the pi from the picot. Greetings here I am back and Now I have a USB power bank that I'm going to use to power the spike so let's plug this in here like this and then the power bank has a power switch here so when I press the power switch , the peak We should boot up and run our main.point code so let's try it and there it is, it works and this is really what microcontrollers mean: running a piece of code that controls some electronic components.
This is very exciting, I'm sure some of you are saying Chris, this is not that exciting. I said look, we have a running light. They are always very exciting. Think about what Glennae Larson did with running lights. LED characters like the first Cylons and equipped the car. She made a whole. running no character LED light running and more generally of course this is just a test demonstrating the sort of things that can be done with a microcontroller by running a piece of code on a board to link it to other electronic components , they could be LED. servos, it could be sensors, all kinds of things like that, so I think this is a very exciting development in the world of raspy pydum, the new raspberry pi pico, the raspberry pi pico is the firstmicrocontroller that I have seen here when explaining computers. and it presents all kinds of possibilities in areas like robotics, if you want me to see the spike in more detail in future videos or look at other microcontrollers, let me know in the comments section, but that's it. another video, if you liked what you saw here, hit the like button, if you haven't subscribed, please subscribe and I hope to talk to you again very soon.

If you have any copyright issue, please Contact