Tuesday, January 26, 2021

First Power up Raspberry Pi Pico and install MicroPython firmware, on Raspberry Pi.



It's the first time I plug-in the new Raspberry Pi Pico to Raspberry Pi 4B/4G, install MicroPython firmware on Raspberry Pi Pico using Thonny Python IDE, and play around MicroPython REPL.


Play around in with MicroPython REPL:
To get information:
>>> import uos
>>> uos.uname()

Get CPU frequency in hertz:
>>> import machine
>>> machine.freq()

Get memory info:
>>> import micropython
>>> micropython.mem_info()
Remark to enter boot mode:

In boot mode, the Pico will be recognized as a removable driver named "RPI-RP2". And you can install MicroPython firmware in Thonny (as shown in the video). You can also manually download firmware .uf2 and drag to "RPI-RP2", refer to "Flash the MicroPython firmware" section on MagPi - Programming Raspberry Pi Pico with Python and MicroPython.

In my first power-up of Raspberry Pi Pico, it enter boot mode automatically, no need to press and hold the on board BOOTSEL while powering up, as shown in the video. Once installed, Pico will not enter boot mode automatically. 

To enter boot mode again:
- Disconnect USB cable to Raspberry Pi Pico.
- Press and hold the onboard BOOTSEL button.
- Connect USB cable to Raspberry Pi Pico.
- Pico will be recognized as a removable driver named "RPI-RP2".


Useful Tips: 

More exercise for Raspberry Pi Pico
MicroPython:
Install/Update MicroPython firmware to Raspberry Pi Pico using Thonny Python IDE
CircuitPython:

Arduino Framework:

No comments: