xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

Raspberry Pi Pico All In One

Raspberry Pi Pico All In One

tty.usbmodem

# Linux 查看真实的 tty.usbmodem
$ lsusb

# macOS 查看真实的 tty.usbmodem

# /dev => devices ✅
$ cd /dev && ls | grep "usbmodem"
# cu.usbmodem14601
# tty.usbmodem14601

image

https://www.cnblogs.com/xgqfrms/p/17277209.html

Raspberry Pi Pico

树莓派 Pico 和 Pico H
Raspberry Pi Pico 是一款低成本、高性能的微控制器板,具有灵活的数字接口。主要特点包括:

英国Raspberry Pi设计的RP2040微控制器芯片

双核 Arm Cortex M0+ 处理器,灵活的时钟频率高达 133 MHz

264kB SRAM 和 2MB 板载闪存

支持设备和主机的 USB 1.1

低功耗睡眠和休眠模式

使用 USB 大容量存储进行拖放编程

26×多功能 GPIO 管脚

SPI、2×I2C、2×UART、3×12位ADC、16×可控PWM通道

精确的片上时钟和定时器

温度感应器 / Temperature sensor

片上加速浮点库

8 个可编程 I/O (PIO) 状态机,用于自定义外设支持

Raspberry Pi Pico 是一个蜂窝状模块,可以直接焊接到载板上,而 Pico H 则带有预焊接头。

image

https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html

Raspberry Pi Pico Datasheet
An RP2040-based microcontroller board

https://datasheets.raspberrypi.com/pico/pico-datasheet.pdf

Getting started with Raspberry Pi Pico
C/C++ development with Raspberry Pi Pico and other RP2040-based microcontroller boards

https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf

pi@raspberrypi:~/Desktop $  df -h
文件系统        容量  已用  可用 已用% 挂载点
/dev/root        29G  6.4G   22G   23% /
devtmpfs        243M     0  243M    0% /dev
tmpfs           248M     0  248M    0% /dev/shm
tmpfs           248M  6.6M  241M    3% /run
tmpfs           5.0M  4.0K  5.0M    1% /run/lock
tmpfs           248M     0  248M    0% /sys/fs/cgroup
/dev/mmcblk0p1  253M   51M  202M   21% /boot
tmpfs            50M     0   50M    0% /run/user/1000
pi@raspberrypi:~/Desktop $ 

image

Software Development

Raspberry Pi Pico C/C++ SDK
Libraries and tools for C/C++ development on RP2040 microcontrollers

https://datasheets.raspberrypi.com/pico/raspberry-pi-pico-c-sdk.pdf

Raspberry Pi Pico Python SDK
A MicroPython environment for RP2040 microcontrollers

https://datasheets.raspberrypi.com/pico/raspberry-pi-pico-python-sdk.pdf

The API level Doxygen documentation for the Raspberry Pi Pico C/C++ SDK is also available as a micro-site.

https://www.raspberrypi.com/documentation/pico-sdk/

https://rptl.io/pico-doxygen

Raspberry Pi tutorials

https://www.raspberrypi.com/tutorials/

RP2040 microcontroller

image

image

https://www.raspberrypi.com/documentation/microcontrollers/rp2040.html#welcome-to-rp2040

https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf

Raspberry Pi Pinout

Raspberry Pi Model 3B V1.2

$  pinout
,--------------------------------.
| oooooooooooooooooooo J8     +====
| 1ooooooooooooooooooo        | USB
|                             +====
|      Pi Model 3B  V1.2         |
|      +----+                 +====
| |D|  |SoC |                 | USB
| |S|  |    |                 +====
| |I|  +----+                    |
|                   |C|     +======
|                   |S|     |   Net
| pwr        |HDMI| |I||A|  +======
`-| |--------|    |----|V|-------'

Revision           : a22082
SoC                : BCM2837
RAM                : 1GB
Storage            : MicroSD
USB ports          : 4 (of which 0 USB3)
Ethernet ports     : 1 (100Mbps max. speed)
Wi-fi              : True
Bluetooth          : True
Camera ports (CSI) : 1
Display ports (DSI): 1

J8:
   3V3  (1) (2)  5V    
 GPIO2  (3) (4)  5V    
 GPIO3  (5) (6)  GND   
 GPIO4  (7) (8)  GPIO14
   GND  (9) (10) GPIO15
GPIO17 (11) (12) GPIO18
GPIO27 (13) (14) GND   
GPIO22 (15) (16) GPIO23
   3V3 (17) (18) GPIO24
GPIO10 (19) (20) GND   
 GPIO9 (21) (22) GPIO25
GPIO11 (23) (24) GPIO8 
   GND (25) (26) GPIO7 
 GPIO0 (27) (28) GPIO1 
 GPIO5 (29) (30) GND   
 GPIO6 (31) (32) GPIO12
GPIO13 (33) (34) GND   
GPIO19 (35) (36) GPIO16
GPIO26 (37) (38) GPIO20
   GND (39) (40) GPIO21

For further information, please refer to https://pinout.xyz/
pi@raspberrypi:~/Desktop $ 


image

https://pinout.xyz

Raspberry Pi Pico GPIO

GPIO 25LED 针脚

Download the Pinout Diagram (PDF)

https://datasheets.raspberrypi.com/pico/Pico-R3-A4-Pinout.pdf

Download Design Files (Cadence Allegro)

https://datasheets.raspberrypi.com/pico/RPi-Pico-R3-PUBLIC-20200119.zip

Download STEP File

https://datasheets.raspberrypi.com/pico/Pico-R3-step.zip

Download Fritzing Part for Raspberry Pi Pico

https://datasheets.raspberrypi.com/pico/Pico-R3-Fritzing.fzpz

UF2 file

https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html#software-utilities

Raspberry Pi Debug Probe

Debug Probe / 调试探针

No.
Picture
1 image
2
3
4
5

https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html#about-the-debug-probe

MicroPython

https://www.raspberrypi.com/documentation/microcontrollers/micropython.html#what-is-micropython

https://micropython.org/

https://github.com/micropython/

https://micropython.org/unicorn/

https://github.com/micropython/micropython-unicorn

MicroPython 环境搭建

您可以通过 USB 将 Pico 连接到计算机,然后将文件拖放到它上面来对 Pico 进行编程,因此我们整理了一个可下载的 UF2 文件,让您可以更轻松地安装 MicroPython。

rp2-pico-20230329-unstable-v1.19.1-994-ga4672149b.uf2

https://micropython.org/download/rp2-pico/rp2-pico-latest.uf2

image

  1. macOS Terminal
# 安装
$ brew install minicom

# 连接 
$ minicom -b 115200 -o -D /dev/tty.usbmodem0000000000001


image

2.3. Connecting from a Mac

https://datasheets.raspberrypi.com/pico/raspberry-pi-pico-python-sdk.pdf

??? minicom 没反应,不好使 ❌

minicom 太难用了 💩

  1. Thonny IDE

https://thonny.org/

https://github.com/thonny/thonny/releases/download/v4.0.2/thonny-4.0.2.pkg

https://www.raspberrypi.com/documentation/microcontrollers/micropython.html

Get Started with MicroPython on Raspberry Pi Pico

https://hackspace.raspberrypi.com/books/micropython-pico

https://hsmag.cc/picobook

https://hackspace.raspberrypi.com/downloads/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBaThSIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--d43ee613629bddf78bc41c1479c2acb2ec6ef34e/RPi_PiPico_Digital_v10.pdf

(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

demos

Raspberry Pi Pico + MicroPython + LED

https://youtube.com/shorts/-QGFbMWpKjY?feature=share

picozero API

from picozero import LED, Button

led = LED(1)
button = Button(2)

button.when_pressed = led.on
button.when_released = led.off

https://picozero.readthedocs.io/en/latest/

LED

image

refs

https://github.com/xgqfrms/Raspberry-Pi#Pico

https://www.cnblogs.com/xgqfrms/p/17264471.html#5163258

minicom

https://www.cnblogs.com/xgqfrms/p/17275859.html



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2023-03-30 20:57  xgqfrms  阅读(65)  评论(17编辑  收藏  举报