This page (revision-15) was last changed on 2021-05-07 09:36 by Murray Altheim

This page was created on 2021-03-08 04:23 by Murray Altheim

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
15 2021-05-07 09:36 7 KB Murray Altheim to previous
14 2021-05-07 09:31 7 KB Murray Altheim to previous | to last
13 2021-03-09 09:47 7 KB Murray Altheim to previous | to last
12 2021-03-09 09:33 7 KB Murray Altheim to previous | to last
11 2021-03-09 09:33 7 KB Murray Altheim to previous | to last
10 2021-03-09 09:26 6 KB Murray Altheim to previous | to last
9 2021-03-09 09:22 6 KB Murray Altheim to previous | to last
8 2021-03-09 09:15 5 KB Murray Altheim to previous | to last
7 2021-03-08 05:22 5 KB Murray Altheim to previous | to last
6 2021-03-08 05:04 4 KB Murray Altheim to previous | to last
5 2021-03-08 04:47 4 KB Murray Altheim to previous | to last
4 2021-03-08 04:44 4 KB Murray Altheim to previous | to last
3 2021-03-08 04:37 2 KB Murray Altheim to previous | to last
2 2021-03-08 04:35 2 KB Murray Altheim to previous | to last
1 2021-03-08 04:23 1 KB Murray Altheim to last

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 1 changed one line
On the 21st of January, 2021, the Raspberry Pi Foundation released its own [microcontroller] board called the __[Raspberry Pi Pico|RaspberryPiPico]__. Despite its name, the Pico is a __microcontroller__, not a small __microcomputer__ (i.e., a Single Board Computer or SBC) like the [Raspberry Pi], uses a different CPU chipset (the __RP2040__, a proprietary design by the Raspberry Pi Foundation), and is significantly smaller and cheaper than any Pi at ''US$4''.
%%alias
Aliased from [Pico]
%%
At line 3 changed one line
It comes with a C SDK, a GCC-based toolchain, Visual Studio Code integration, and can be programmed in __[Micropython]__.
On the 21st of January, 2021, the Raspberry Pi Foundation released its own [microcontroller] board called the __[Raspberry Pi Pico|RaspberryPiPico]__. Despite its name, the Pico is a __microcontroller__, not a small __microcomputer__ (i.e., a Single Board Computer or SBC) like the [Raspberry Pi], uses a different CPU chipset (the __[RP2040]__, a proprietary design by the Raspberry Pi Foundation), and is significantly smaller and cheaper than any Pi at ''US$4''.
At line 7 added 3 lines
It comes with a C SDK, a GCC-based toolchain, Visual Studio Code integration, and can be programmed in __[Micropython]__. The [RP2040] CPU is currently available in the Pico form factor as released by the Raspberry Pi Foundation, but announcements have been made by many vendors like Adafruit and Pimoroni for Feather, Itsy Bitsy, QT, Tiny, and other familiar designs.
At line 48 changed one line
!! Links
!! I2C
At line 50 changed 4 lines
* [Meet Raspberry Silicon: Raspberry Pi Pico now on sale at $4|https://www.raspberrypi.org/blog/raspberry-pi-silicon-pico-now-on-sale/] (release announcement)
* [Pico Specification|https://www.raspberrypi.org/products/raspberry-pi-pico/specifications/] (Raspberry Pi Foundation)
* [Getting Started|https://www.raspberrypi.org/documentation/rp2040/getting-started/] (Raspberry Pi Foundation)
* [Getting Started with Raspberry Pi Pico|attach/RaspberryPiPico/getting-started-with-pico.pdf] (34.6MB PDF, local copy)
The RP2040 has two [I2C] controllers (0 and 1), both accessible via the Pico's GPIO pins, where the selection of SDA and SDL pins used for each controller is configured in software as per the following table:
At line 55 changed one line
* [Raspberry Pi Pico Python SDK|attach/RaspberryPiPico/raspberry-pi-pico-python-sdk.pdf] (2.8MB PDF, local copy)
|| I2C Controller || GPIO Pins
| I2C0 – SDA | GP0/GP4/GP8/GP12/GP16/GP20
| I2C0 – SCL | GP1/GP5/GP9/GP13/GP17/GP21
| I2C1 – SDA | GP2/GP6/GP10/GP14/GP18/GP26
| I2C1 – SCL | GP3/GP7/GP11/GP15/GP19/GP27
At line 57 changed 2 lines
* [Hardware design with RP2040|attach/RaspberryPiPico/hardware-design-with-rp2040.pdf] (19.7MB PDF, local copy)
* [RP2040 Datasheet|https://datasheets.raspberrypi.org/rp2040/rp2040-datasheet.pdf] (4.9MB PDF, Raspberry Pi Foundation)
The I2C controller can run in master or slave mode (default slave address is 0x55); a choice of three speeds: Standard (0-100kB/s), Fast (up to 400kB/s) and Fast Plus (<=1000kB/s). The Raspberry Pi's default I2C frequency is 100kB/s, unless altered in /boot/config.txt. It can be used in either interrupt or DMA mode and includes transmit and receive buffers to
improve performance. There are [some I2C examples in Micropython|https://github.com/raspberrypi/pico-micropython-examples/tree/master/i2c] on github.
! Example Code
The first block sets the SDA and SCL pins for I2C Controller 0 to pin 8 and 9 (resp.), then writes 3 bytes of data to the slave address 76, then reads 4 bytes back from the same address. The second configures I2C Controller 1 to pin 6 and 7, then writes 3 bytes to memory address starting at 6, then reads 4 bytes starting at address 2 of the slave at memory address 76.
{{{
from machine import Pin, I2C
i2c = I2C(0, scl=Pin(9), sda=Pin(8), freq=100000)
i2c.scan() # scan for slaves, returning a list of 7-bit addresses
i2c.writeto(42, b'123') # write 3 bytes to slave with 7-bit address 42
i2c.readfrom(42, 4) # read 4 bytes from slave with 7-bit address 42
i2c = I2C(1, scl=Pin(7), sda=Pin(6), freq=100000)
i2c.scan()
i2c.readfrom_mem(42, 8, 3) # read 3 bytes from memory of slave 42,
# starting at memory-address 8 in the slave
i2c.writeto_mem(42, 2, b'\x10') # write 1 byte to memory of slave 42
# starting at address 2 in the slave
}}}
For further information consult the [documentation for the Micropython machine library for I2C|https://docs.micropython.org/en/latest/library/machine.I2C.html], or the [C++ API|https://raspberrypi.github.io/pico-sdk-doxygen/group__hardware__i2c.html]. Note that I2C can be established either via hardware or software on the Pico.
!! Links
*From __Raspberry Pi Foundation__:
** [Meet Raspberry Silicon: Raspberry Pi Pico now on sale at $4|https://www.raspberrypi.org/blog/raspberry-pi-silicon-pico-now-on-sale/] (release announcement)
** [Pico Specification|https://www.raspberrypi.org/products/raspberry-pi-pico/specifications/]
** [Getting Started|https://www.raspberrypi.org/documentation/rp2040/getting-started/]
** [Pico Product Brief|https://datasheets.raspberrypi.org/pico/pico-product-brief.pdf]
** [RP2040 Datasheet|https://datasheets.raspberrypi.org/rp2040/rp2040-datasheet.pdf] (4.9MB PDF)
* local documentation copies
** [Raspberry Pi Pico Python SDK|attach/RaspberryPiPico/raspberry-pi-pico-python-sdk.pdf] (2.8MB PDF, local copy)
** [Getting Started with Raspberry Pi Pico|attach/RaspberryPiPico/getting-started-with-pico.pdf] (34.6MB PDF, local copy)
** [Hardware design with RP2040|attach/RaspberryPiPico/hardware-design-with-rp2040.pdf] (19.7MB PDF, local copy)
* [Pico Micropython Examples|https://github.com/raspberrypi/pico-micropython-examples] on github (adc, blink, i2c, irq, multicore, pio, pwm, spi, uart/loopback)
At line 103 added one line
*[An Introduction to the Raspberry Pi Pico with MicroPython|https://makersportal.com/blog/raspberry-pi-pico-tests-with-micropython], MakerPortal blog post by Joshua Hrisko, 28 Jan 2021
At line 63 changed one line
[{Tag Pico}]
[{Tag Pico RP2040}]